reseller

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

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

すべての reseller エンドポイント

認証

ベアラー トークンとして API キーを送信します。キーには reseller.manage 権限が付与されている必要があります。権限のないキーは 404 ではなく 403 で拒否されます。

組織 ID を入力する場所

このエンドポイントでは、URL内に組織IDを org_id として直接指定します。パスの中にその値を代入してください。この動作を代替するヘッダーやクエリパラメータはありません。

組織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