reseller
POST /v1/reseller/ai/credits/clients/{org_id}
Give one of your clients AI credit, or take unspent credit back.
Authenticatie
Stuur een API-sleutel mee als bearer token. De sleutel moet over de permissie reseller.manage beschikken; een sleutel zonder deze permissie wordt geweigerd met een 403 in plaats van een 404.
Waar je organisatie-id komt te staan
Dit eindpunt gebruikt je organisatie-id rechtstreeks in de URL als org_id. Vervang dit in het pad; er is geen header of queryparameter die dit kan overnemen.
Uw organisatie-id staat op het scherm met API-sleutels in uw dashboard, naast de sleutel zelf. Dit is in elke aanroep die u doet dezelfde id.
Probeer het
Vervang alles tussen punthaakjes door uw eigen waarden en de sleutelplaatsvervanger door een sleutel uit uw dashboard.
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> }'Ingelogd? De API-console in je dashboard vult je echte organisatie-id en je eigen sleutel in, en voert het verzoek uit tegen de live API zodat je de daadwerkelijke respons kunt zien. Open dit eindpunt in de API-console
Details
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`.
Parameters
| Naam | Type | Verplicht | Wat dit is |
|---|---|---|---|
org_id (path) | Uuid | Ja | The client organization whose balance moves. Must be one of yours. |
org_id (query) | Uuid | Nee | Which of YOUR organizations is acting. Not the client. |
Aanvraaglichaam
| Naam | Type | Verplicht | Wat dit is |
|---|---|---|---|
delta_micros | integer | Ja | 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 | Ja | 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. |
Reactie
| Naam | Type | Verplicht | Wat dit is |
|---|---|---|---|
pool_balance_micros | integer | Ja | — |
client_balance_micros | integer | Ja | — |
typical_calls | integer | Ja | Roughly how many AI questions the client's new balance buys. An **illustration** — a long article costs many times a short question. |
Fouten die dit eindpunt kan retourneren
401 · 403 · 404 · 422 · 429