reseller

POST /v1/reseller/ai/credits/clients/{org_id}

Give one of your clients AI credit, or take unspent credit back.

Semua titik akhir reseller

Autentikasi

Kirim kunci API sebagai token bearer. Kunci tersebut harus memiliki izin reseller.manage; kunci tanpa izin tersebut akan ditolak dengan status 403, bukan 404.

Tempat ID organisasi Anda dimasukkan

Endpoint ini menggunakan id organisasi Anda di dalam URL itu sendiri, sebagai org_id. Gantikan ke dalam path — tidak ada header atau parameter kueri yang dapat menggantikannya.

ID organisasi Anda berada di layar kunci API di dasbor Anda, di sebelah kunci itu sendiri. Itu adalah ID yang sama dalam setiap panggilan yang Anda buat.

Coba

Ganti apa pun di dalam tanda kurung sudut dengan nilai Anda sendiri, dan placeholder kunci dengan kunci dari dasbor Anda.

curl -X POST https://api.zinndigital.com/v1/reseller/ai/credits/clients/{org_id} \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "delta_micros": <integer>, "reason": <string> }'

Sudah masuk? Konsol API di dasbor Anda akan mengisi ID organisasi asli dan kunci Anda sendiri, serta menjalankan permintaan terhadap API langsung sehingga Anda dapat melihat respons aktualnya. Buka titik akhir ini di konsol API

Detail

Moves credit between your pool and one client's balance in one transaction: a positive `delta_micros` gives, a negative one takes back. A client who has already **spent** the credit cannot be taken below zero — the request is refused and names what is left. A client that is not yours is refused with the same code and message as one that does not exist, so this cannot be used to discover whether an organization id is real. This is the manual route, for a trial, a goodwill gesture, or a bundle sold offline. The self-serve route is your client buying a pack from you, which draws on the same pool. Requires `reseller.manage`.

Parameter

NamaJenisWajibTentang apa ini
org_id (path)UuidYaThe client organization whose balance moves. Must be one of yours.
org_id (query)UuidTidakWhich of YOUR organizations is acting. Not the client.

Isi permintaan

NamaJenisWajibTentang apa ini
delta_microsintegerYaSigned USD micros. Positive gives credit to the client, negative takes unspent credit back. Zero is refused — a ledger row that means nothing.
reasonstringYaWhy. Required, for the same reason a staff adjustment requires one: a movement of somebody's money with no stated cause is unanswerable three months later.

Tanggapan

NamaJenisWajibTentang apa ini
pool_balance_microsintegerYa
client_balance_microsintegerYa
typical_callsintegerYaRoughly how many AI questions the client's new balance buys. An **illustration** — a long article costs many times a short question.

Kesalahan yang dapat dikembalikan oleh titik akhir ini

401 · 403 · 404 · 422 · 429