reseller
POST /v1/reseller/ai/credits/clients/{org_id}
Give one of your clients AI credit, or take unspent credit back.
Autentifikatsiya
API kalitini bearer token sifatida yuboring. Kalit reseller.manage ruxsatiga ega boʻlishi shart; ruxsatsiz kalit 404 emas, balki 403 xatosi bilan rad etiladi.
Tashkilotingiz identifikatori kiritiladigan joy
Ushbu so'rov manzili tashkilotingiz identifikatorini URL manzilining o'zida org_id sifatida qabul qiladi. Uni yo'lga o'rnating — buning o'rnini bosadigan sarlavha yoki so'rov parametri mavjud emas.
Tashkilotingiz identifikatori boshqaruv panelingizdagi API kalitlari ekranida, kalitning o'z yonida joylashgan. Bu siz amalga oshiradigan har bir so'rovda bir xil identifikator hisoblanadi.
Sinab ko'rish
Qavslardagi har qanday narsani o'z qiymatlaringiz bilan, kalit pleysxolderini эsa boshqaruv panelingizdagi kalit bilan almashtiring.
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> }'Tizimga kirganmisiz? Boshqaruv panelingizdagi API konsoli haqiqiy tashkilot ID raqamingiz va shaxsiy kalitingizni avtomatik to'ldiradi hamda haqiqiy javobni ko'rishingiz uchun so'rovni jonli API orqali bajaradi. Ushbu yakuniy nuqtani API konsolida oching
Tafsilotlar
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`.
Parametrlar
| Nomi | Turi | Majburiy | Nima bu |
|---|---|---|---|
org_id (path) | Uuid | Ha | The client organization whose balance moves. Must be one of yours. |
org_id (query) | Uuid | Yo'q | Which of YOUR organizations is acting. Not the client. |
Soʻrov tanasi
| Nomi | Turi | Majburiy | Nima bu |
|---|---|---|---|
delta_micros | integer | Ha | 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 | Ha | 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. |
Javob
| Nomi | Turi | Majburiy | Nima bu |
|---|---|---|---|
pool_balance_micros | integer | Ha | — |
client_balance_micros | integer | Ha | — |
typical_calls | integer | Ha | Roughly how many AI questions the client's new balance buys. An **illustration** — a long article costs many times a short question. |
Ushbu yakuniy nuqta qaytarishi mumkin bo'lgan xatolar
401 · 403 · 404 · 422 · 429