reseller

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

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

Të gjitha pikat e skajshme reseller

Autentifikimi

Drgoni një çelës API si një token mbajtës. Çelësi duhet të ketë lejen reseller.manage; një çelës pa të refuzohet me 403, jo 404.

Ku shkon id i organizatës suaj

Ky endpoint merr ID-në e organizatës suaj direkt në URL, si org_id. Zëvendësoni atë në shteg — nuk ka asnjë kokë (header) apo parametër query që bën punë në vend të kësaj.

ID-ja e organizatës suaj ndodhet në ekranin e çelësave API në panelin tuaj të kontrollit, pranë vetë çelësit. Është i njëjti ID në çdo thirrje që bëni.

Provoje

Zëvendësoni çdo gjë brenda kllapave këndore me vlerat tuaja dhe vendbanuesin e çelësit me një çelës nga paneli juaj.

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> }'

Jeni kyçur? Konsola e API-së në panelin tuaj plotëson ID-në tuaj reale të organizatës dhe çelësin tuaj, dhe ekzekuton kërkesën kundrejt API-së live, kështu që ju mund të shihni përgjigjen aktuale. Hapni këtë pikë fundore në konsolën e API-së

Detajet

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`.

Parametrat

EmriLlojiKërkohetÇfarë është kjo
org_id (path)UuidPoThe client organization whose balance moves. Must be one of yours.
org_id (query)UuidJoWhich of YOUR organizations is acting. Not the client.

Trupi i kërkesës

EmriLlojiKërkohetÇfarë është kjo
delta_microsintegerPoSigned USD micros. Positive gives credit to the client, negative takes unspent credit back. Zero is refused — a ledger row that means nothing.
reasonstringPoWhy. 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.

Përgjigja

EmriLlojiKërkohetÇfarë është kjo
pool_balance_microsintegerPo
client_balance_microsintegerPo
typical_callsintegerPoRoughly how many AI questions the client's new balance buys. An **illustration** — a long article costs many times a short question.

Gabimet që ky pikëndalim mund të kthejë

401 · 403 · 404 · 422 · 429