reseller
POST /v1/reseller/ai/credits/clients/{org_id}
Give one of your clients AI credit, or take unspent credit back.
Autentizace
Zašlete API klíč jako nosný token (bearer token). Klíč musí mít oprávnění reseller.manage; klíč bez něj je odmítnut s kódem 403, nikoli 404.
Sem patří ID vaší organizace
Tento koncový bod přebírá ID vaší organizace přímo v URL jako org_id. Dosaďte jej do cesty – neexistuje žádná hlavička ani parametr dotazu, které by to udělaly místo toho.
ID vaší organizace najdete na obrazovce API klíčů ve vašem přehledu, hned vedle samotného klíče. Je to stále stejné ID v každém volání, které provedete.
Vyzvednout
Nahraďte cokoli v závorkách vlastními hodnotami a zástupný symbol klíče klíčem z vašeho řídicího panelu.
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> }'Přihlášeni? Konzole API ve vašem dashboardu automaticky doplní vaše skutečné ID organizace i váš vlastní klíč a odešle požadavek na živé API, abyste viděli reálnou odpověď. Otevřete tento koncový bod v konzoli API
Podrobnosti
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`.
Parametry
| Název | Typ | Požadováno | Co to je |
|---|---|---|---|
org_id (path) | Uuid | Ano | 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. |
Tělo požadavku
| Název | Typ | Požadováno | Co to je |
|---|---|---|---|
delta_micros | integer | Ano | 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 | Ano | 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. |
Odpověď
| Název | Typ | Požadováno | Co to je |
|---|---|---|---|
pool_balance_micros | integer | Ano | — |
client_balance_micros | integer | Ano | — |
typical_calls | integer | Ano | Roughly how many AI questions the client's new balance buys. An **illustration** — a long article costs many times a short question. |
Chyby, které může tento koncový bod vrátit
401 · 403 · 404 · 422 · 429