reseller

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

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

Барлық reseller соңғы нүктелері

Аутентификация

API кілтін bearer токені ретінде жіберіңіз. Кілтте reseller.manage рұқсаты болуы тиіс; онсыз кілтке 404 емес, 403 қатесі қайтарылады.

Ұйымыңыздың идентификаторы орналасатын жер

Бұл соңғы нүкте 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 консолі ұйымыңыздың нақты идентификаторы мен жеке кілтіңізді автоматты түрде толтырады да, нақты жауапты көре алуыңыз үшін сұрауды тікелей жұмыс істеп тұрған 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`.

Параметрлер

АтыTүріМіндеттіМазмұны
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.

Сұрау денесі

АтыTүріМіндеттіМазмұны
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.

Жауап

АтыTүріМіндеттіМазмұны
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