Skip to content
TrimCarbon API
Esc
↑↓navigate↵open⌘Jpreview

Get the balance

The balance this key spends, and your rate. Test keys see a simulated balance.

GET/balance
Authorization
AuthorizationBearer token · headerrequired

An API key from the developer page: tc_live_… for real purchases, tc_test_… for tests. Keep it on your server.

Responses
200

The balance.

objectstringrequired
livemodebooleanrequired

False for test keys: nothing was charged or retired.

available_centsintegerrequired

What purchases can spend now. Test keys see a simulated balance.

currencystringrequired
rate_millicents_per_kgintegerrequired

Your rate in thousandths of a cent per kg: 4000 is $0.04/kg ($40 per tonne).

401

Missing, unknown or revoked API key.

errorobjectrequired
Show properties
typestringrequired
Allowed:authentication_errorpermission_errorinvalid_request_errorrate_limit_errorapi_error
codestringrequired
messagestringrequired
paramstring

The request field that is wrong.

balance_centsinteger

With insufficient_balance: your balance now.

required_centsinteger

With insufficient_balance: what the purchase costs.

403

api_access_inactive (the account is suspended or not approved) or insufficient_permissions (a read-only key).

errorobjectrequired
Show properties
typestringrequired
Allowed:authentication_errorpermission_errorinvalid_request_errorrate_limit_errorapi_error
codestringrequired
messagestringrequired
paramstring

The request field that is wrong.

balance_centsinteger

With insufficient_balance: your balance now.

required_centsinteger

With insufficient_balance: what the purchase costs.

429

rate_limited: wait for the Retry-After seconds.

errorobjectrequired
Show properties
typestringrequired
Allowed:authentication_errorpermission_errorinvalid_request_errorrate_limit_errorapi_error
codestringrequired
messagestringrequired
paramstring

The request field that is wrong.

balance_centsinteger

With insufficient_balance: your balance now.

required_centsinteger

With insufficient_balance: what the purchase costs.

Try it
Server
Authorization
Request
curl -X GET 'https://trimcarbon.com/api/v1/balance' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "object": "balance",
  "livemode": true,
  "available_cents": 0,
  "currency": "usd",
  "rate_millicents_per_kg": 4000
}

Was this page helpful?