reseller
POST /v1/reseller/ai/credits/clients/{org_id}
Give one of your clients AI credit, or take unspent credit back.
אימות
שלחו מפתח API כאסימון נושא (bearer token). על המפתח לכלול את הרשאה reseller.manage; מפתח שאינו כולל אותה יידחה בסטטוס 403, ולא 404.
המקום שבו מזהה הארגון שלך נכנס
נקודת קצה זו מקבלת את מזהה הארגון שלך בכתובת ה-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`.
פרמטרים
| שם | סוג | נדרש | מה זה |
|---|---|---|---|
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_micros | integer | כן | 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 | כן | 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_micros | integer | כן | — |
client_balance_micros | integer | כן | — |
typical_calls | integer | כן | 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