reseller
POST /v1/reseller/ai/credits/clients/{org_id}
Give one of your clients AI credit, or take unspent credit back.
Autentificare
Trimiteți o cheie API ca token de tip bearer. Cheia trebuie să aibă permisiunea reseller.manage; o cheie care nu o are va fi respinsă cu 403, nu 404.
Unde merge ID-ul organizației tale
Acest punct final preia ID-ul organizației tale direct în URL, sub forma org_id. Înlocuiește-l în cale — nu există niciun antet sau parametru de interogare care să țină locul acestuia.
ID-ul organizației tale se află pe ecranul cheilor API din panoul de control, lângă cheia însăși. Este același ID în fiecare apel pe care îl faci.
Încearcă
Înlocuiți tot ce se află între paranteze unghiulare cu propriile valori și substituentul cheie cu o cheie din tabloul de bord.
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> }'Autentificat? Consola API din panoul de control îți completează ID-ul real al organizației și propria cheie și rulează cererea în API-ul live, astfel încât să poți vedea răspunsul efectiv. Deschideți acest punct final în consola API
Detalii
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`.
Parametri
| Nume | Tip | Obligatoriu | Ce este |
|---|---|---|---|
org_id (path) | Uuid | Da | The client organization whose balance moves. Must be one of yours. |
org_id (query) | Uuid | Nu | Which of YOUR organizations is acting. Not the client. |
Corp cerere
| Nume | Tip | Obligatoriu | Ce este |
|---|---|---|---|
delta_micros | integer | Da | Signed USD micros. Positive gives credit to the client, negative takes unspent credit back. Zero is refused — a ledger row that means nothing. |
reason | string | Da | Why. 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. |
Răspuns
| Nume | Tip | Obligatoriu | Ce este |
|---|---|---|---|
pool_balance_micros | integer | Da | — |
client_balance_micros | integer | Da | — |
typical_calls | integer | Da | Roughly how many AI questions the client's new balance buys. An **illustration** — a long article costs many times a short question. |
Erori pe care le poate returna acest punct final
401 · 403 · 404 · 422 · 429