reseller

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

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

Todos los endpoints de reseller

Autenticación

Envía una clave de API como token de portador. La clave debe tener el permiso reseller.manage; una clave que no lo tenga se rechazará con un código 403, no 404.

Donde va el ID de tu organización

Este endpoint toma el id de tu organización directamente en la URL, como org_id. Sustitúyelo en la ruta; no hay ninguna cabecera ni parámetro de consulta que sirva para ello.

El id de tu organización se encuentra en la pantalla de claves de API en tu panel de control, junto a la propia clave. Es el mismo id en cada llamada que realices.

Pruébalo

Reemplaza cualquier elemento entre corchetes angulares por tus propios valores, y el marcador de posición key con una clave de tu panel de control.

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

¿Has iniciado sesión? La consola de la API en tu panel de control rellena el ID de tu organización real y tu propia clave, y ejecuta la solicitud contra la API en vivo para que puedas ver la respuesta real. Abre este endpoint en la consola de la API

Detalles

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

Parámetros

NombreTipoObligatorio¿Qué es esto?
org_id (path)UuidThe client organization whose balance moves. Must be one of yours.
org_id (query)UuidNoWhich of YOUR organizations is acting. Not the client.

Cuerpo de la solicitud

NombreTipoObligatorio¿Qué es esto?
delta_microsintegerSigned USD micros. Positive gives credit to the client, negative takes unspent credit back. Zero is refused — a ledger row that means nothing.
reasonstringWhy. 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.

Respuesta

NombreTipoObligatorio¿Qué es esto?
pool_balance_microsinteger
client_balance_microsinteger
typical_callsintegerRoughly how many AI questions the client's new balance buys. An **illustration** — a long article costs many times a short question.

Errores que este endpoint puede devolver

401 · 403 · 404 · 422 · 429