reseller

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

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

Բոլոր reseller վերջնակետերը

Նույնականացում

Ուղարկեք API բանալին որպես bearer token: Բանալին պետք է ունենա reseller.manage թույլտվությունը. առանց դրա բանալին մերժվում է 403, և ոչ թե 404 կարգավիճակով:

Որտեղ տեղադրվում է ձեր կազմակերպության ID-ն

Այս վերջնակետը որպես org_id ընդունում է ձեր կազմակերպության ID-ն հենց URL-ում: Տեղադրեք այն ուղու մեջ. չկա որևէ վերնագիր կամ հարցման պարամետր, որը կարող է փոխարինել դրան:

Ձեր կազմակերպության ID-ն գտնվում է Ձեր ղեկավարման վահանակի API բանալիների էկրանին՝ բուն բանալու կողքին: Այն նույն ID-ն է Ձեր կատարած յուրաքանչյուր հարցման մեջ:

Փորձել

Փոխարինեք անկյունային փակագծերում գտնվող ցանկացած բան ձեր սեփական արժեքներով, և բանալու տեղապահը՝ ձեր վահանակի բանալիով:

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_microsintegerԱյոSigned USD micros. Positive gives credit to the client, negative takes unspent credit back. Zero is refused — a ledger row that means nothing.
reasonstringԱյո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_microsintegerԱյո
client_balance_microsintegerԱյո
typical_callsintegerԱյո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