reseller

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

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

Tutti gli endpoint reseller

Autenticazione

Invia una chiave API come token di tipo bearer. La chiave deve disporre dell'autorizzazione reseller.manage; una chiave sprovvista di tale autorizzazione viene rifiutata con 403 anziché 404.

L'ID della tua organizzazione va qui

Questo endpoint accetta l'ID della tua organizzazione direttamente nell'URL come org_id. Sostituiscilo nel percorso: non sono presenti intestazioni o parametri di query alternativi.

L'identificativo della tua organizzazione si trova nella schermata delle chiavi API nella tua dashboard, accanto alla chiave stessa. È lo stesso identificativo in ogni chiamata che effettui.

Provalo

Sostituisci qualsiasi elemento tra parentesi angolari con i tuoi valori e il segnaposto key con una chiave dalla tua 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> }'

Hai effettuato l'accesso? La console API nella tua dashboard inserisce il tuo ID organizzazione reale e la tua chiave personale, ed esegue la richiesta sull'API live in modo da poter vedere la risposta effettiva. Apri questo endpoint nella console API

Dettagli

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

NomeTipoObbligatorioChe cos'è
org_id (path)UuidThe client organization whose balance moves. Must be one of yours.
org_id (query)UuidNoWhich of YOUR organizations is acting. Not the client.

Corpo della richiesta

NomeTipoObbligatorioChe cos'è
delta_microsintegerSigned USD micros. Positive gives credit to the client, negative takes unspent credit back. Zero is refused — a ledger row that means nothing.
reasonstringWhy. 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.

Risposta

NomeTipoObbligatorioChe cos'è
pool_balance_microsinteger
client_balance_microsinteger
typical_callsintegerRoughly how many AI questions the client's new balance buys. An **illustration** — a long article costs many times a short question.

Errori che questo endpoint può restituire

401 · 403 · 404 · 422 · 429