Start free

API reference

Wallet balance

Check the wallet balance in your key's environment, test or live, and the amount held by sends in flight, so you can raise an alert before it runs out.

  • 1 operation
  • Base URLhttps://api.messages.ccxcompany.co
  • AuthenticationBearer with your API key

The technical text below comes from the public contract, openapi.json, in the language the contract was written in.

Saldo da carteira de coins

GET/wallet

Saldo da carteira no ambiente da credencial. Uma chave ccx_test_* lê a carteira de sandbox; ccx_live_* lê a de produção.

balanceCoins é o saldo bruto e reservedCoins é o que está preso em envios em voo. O que paga o próximo envio é a diferença — é balanceCoins - reservedCoins que você deve alarmar, não balanceCoins.

1 coin = R$ 0,0001. lowBalanceThresholdCoins é o piso configurado na organização: abaixo dele a CCX dispara o alerta de saldo baixo (wallet.low_balance).

Permissão: billing:read.

Responses

  • 200Default Response

    Response fields and example
    FieldTypeDescription
    envrequiredstringValues:livetest
    balanceCoinsrequiredintegerSaldo bruto, em coins (1 coin = R$ 0,0001). NEGATIVO quando o crédito contratado está em uso.
    reservedCoinsrequiredintegerPreso em envios em voo.
    usableCoinsrequiredintegerbalanceCoins - reservedCoins. O saldo próprio, sem contar crédito.
    currencyrequiredstring
    lowBalanceThresholdCoinsrequiredintegerPiso que dispara wallet.low_balance. 0 ⇒ a CCX usa o default da plataforma.
    overdraftLimitCoinsrequiredintegerCrédito contratado que o envio pode consumir abaixo de zero. 0 ⇒ sem crédito.
    sendableCoinsrequiredintegerusableCoins + overdraftLimitCoins. É o que de fato paga o próximo envio — alarme neste.
    JSON
    {  "env": "live",  "balanceCoins": 0,  "reservedCoins": 0,  "usableCoins": 0,  "currency": "string",  "lowBalanceThresholdCoins": 0,  "overdraftLimitCoins": 0,  "sendableCoins": 0}
  • 401RFC 7807 problem details for UNAUTHORIZED (401).

  • 403RFC 7807 problem details for FORBIDDEN (403).

Error responses follow RFC 7807 (application/problem+json), with a stable code in the code field. See the error codes

curl example

cURL
curl 'https://api.messages.ccxcompany.co/wallet' \  -H "Authorization: Bearer $CCX_API_KEY"
Required fields only. Swap the sample values for your own.

Stuck on a route? Talk to the people who run the API.

Sign up through the site and get a US$5 test credit.