reseller

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

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

Todos os endpoints de reseller

Autenticação

Envie uma chave de API como um token de portador. A chave deve ter a permissão reseller.manage; uma chave sem ela é recusada com 403, e não 404.

Onde vai o ID da sua organização

Este endpoint aceita o ID da sua organização diretamente na URL, como org_id. Substitua-o no caminho — não há cabeçalho ou parâmetro de consulta que sirva como alternativa.

O ID da sua organização está na tela de chaves de API no seu painel, ao lado da própria chave. É o mesmo ID em todas as chamadas que você fizer.

Experimente

Substitua qualquer item entre colchetes por seus próprios valores e o espaço reservado para a chave por uma chave do seu painel.

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

Conectado? O console da API no seu painel preenche o ID da sua organização real e a sua própria chave, e executa a requisição contra a API de produção para que você possa ver a resposta real. Abra este endpoint no console da API

Detalhes

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

NomeTipoObrigatórioO que é
org_id (path)UuidSimThe client organization whose balance moves. Must be one of yours.
org_id (query)UuidNãoWhich of YOUR organizations is acting. Not the client.

Corpo da requisição

NomeTipoObrigatórioO que é
delta_microsintegerSimSigned USD micros. Positive gives credit to the client, negative takes unspent credit back. Zero is refused — a ledger row that means nothing.
reasonstringSimWhy. 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.

Resposta

NomeTipoObrigatórioO que é
pool_balance_microsintegerSim
client_balance_microsintegerSim
typical_callsintegerSimRoughly how many AI questions the client's new balance buys. An **illustration** — a long article costs many times a short question.

Erros que este endpoint pode retornar

401 · 403 · 404 · 422 · 429