reseller
POST /v1/reseller/ai/credits/clients/{org_id}
Give one of your clients AI credit, or take unspent credit back.
Autentifikacija
Pošaljite API ključ kao bearer token. Ključ mora imati dozvolu reseller.manage; ključ bez nje se odbija sa 403, a ne sa 404.
Gde ide ID vaše organizacije
Ovaj krajnji tačka uzima ID vaše organizacije direktno u URL-u kao org_id. Zamenite ga u putanji — ne postoji zaglavlje ili query parametar koji to može zameniti.
ID vaše organizacije nalazi se na ekranu sa API ključevima u vašoj kontrolnoj tabli, pored samog ključa. To je isti ID u svakom pozivu koji uputite.
Isprobajte
Zamenite bilo šta u uglastim zagradama sopstvenim vrednostima, a ključni placeholder sa ključem sa vaše kontrolne table.
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> }'Prijavljeni ste? API konzola na vašoj kontrolnoj tabli automatski popunjava ID vaše stvarne organizacije i vaš sopstveni ključ, i izvršava zahtev nad API-jem uživo tako da možete videti stvarni odgovor. Otvorite ovu krajnju tačku u API konzoli
Detalji
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
| Naziv | Vrsta | Obavezno | Šta je ovo |
|---|---|---|---|
org_id (path) | Uuid | Da | The client organization whose balance moves. Must be one of yours. |
org_id (query) | Uuid | Ne | Which of YOUR organizations is acting. Not the client. |
Telo zahteva
| Naziv | Vrsta | Obavezno | Šta je ovo |
|---|---|---|---|
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. |
Odgovor
| Naziv | Vrsta | Obavezno | Šta je ovo |
|---|---|---|---|
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. |
Greške koje ovaj krajnji tačka može da vrati
401 · 403 · 404 · 422 · 429