reseller

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

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

Wszystkie punkty końcowe reseller

Uwierzytelnianie

Wyślij klucz API jako token bearer. Klucz musi posiadać uprawnienie reseller.manage; klucz bez niego jest odrzucany z kodem 403, a nie 404.

Miejsce na identyfikator organizacji

Ten punkt końcowy pobiera identyfikator Twojej organizacji bezpośrednio z adresu URL jako org_id. Podstaw go w ścieżce — nie ma nagłówka ani parametru zapytania, które mogłyby go zastąpić.

Identyfikator Twojej organizacji znajduje się na ekranie kluczy API w Twoim panelu, obok samego klucza. Jest to ten sam identyfikator w każdym wywołaniu, które wykonujesz.

Wypróbuj

Zastąp wszystko w nawiasach ostrych własnymi wartościami, a zastępczy znacznik klucza kluczem ze swojego pulpitu nawigacyjnego.

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

Zalogowany? Konsola API w Twoim panelu uzupełnia rzeczywiste identyfikator organizacji oraz Twój własny klucz i wykonuje żądanie względem aktywnego API, dzięki czemu możesz zobaczyć rzeczywistą odpowiedź. Otwórz ten punkt końcowy w konsoli API

Szczegóły

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

Parametry

NazwaTypWymaganeCo to jest
org_id (path)UuidTakThe client organization whose balance moves. Must be one of yours.
org_id (query)UuidNieWhich of YOUR organizations is acting. Not the client.

Treść żądania

NazwaTypWymaganeCo to jest
delta_microsintegerTakSigned USD micros. Positive gives credit to the client, negative takes unspent credit back. Zero is refused — a ledger row that means nothing.
reasonstringTakWhy. 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.

Odpowiedź

NazwaTypWymaganeCo to jest
pool_balance_microsintegerTak
client_balance_microsintegerTak
typical_callsintegerTakRoughly how many AI questions the client's new balance buys. An **illustration** — a long article costs many times a short question.

Błędy, które ten punkt końcowy może zwrócić

401 · 403 · 404 · 422 · 429