reseller
POST /v1/reseller/ai/credits/clients/{org_id}
Give one of your clients AI credit, or take unspent credit back.
Аутентификација
Пошаљите API кључ као bearer токен. Кључ мора имати дозволу reseller.manage; кључ без ње се одбија уз 403, а не 404.
Где се уноси ID ваше организације
Ова крајња тачка узима ID ваше организације у самом URL-у, као org_id. Замените га у путањи — не постоји заглавље или параметар упита који могу послужити уместо тога.
Идентификатор ваше организације се налази на екрану са API кључевима на вашој контролној табли, поред самог кључа. То је исти идентификатор у сваком позиву који упутите.
Испробајте
Замените све што је у угластим заградама сопственим вредностима, а чувар места кључа кључем са своје контролне табле.
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> }'Пријављени сте? API конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом API-ју како бисте могли да видите стварни одговор. Отворите ову крајњу тачку у API конзоли
Детаљи
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.
Параметри
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
org_id (path) | Uuid | Да | The client organization whose balance moves. Must be one of yours. |
org_id (query) | Uuid | Не | Which of YOUR organizations is acting. Not the client. |
Тело захтева
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
delta_micros | integer | Да | 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 | Да | 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. |
Одговор
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
pool_balance_micros | integer | Да | — |
client_balance_micros | integer | Да | — |
typical_calls | integer | Да | Roughly how many AI questions the client's new balance buys. An illustration — a long article costs many times a short question. |
Грешке које ова крајња тачка може вратити
401 · 403 · 404 · 422 · 429