Balances
Check what you have left to spend before a request is refused: your Development Connection's monthly cap, and the balance of the account that pays.
Neither call is charged, and neither counts towards throttling. All amounts are in New Zealand cents.
Developer balance
Endpoint URL
/a/member_developer:balance
Request: GET Parameters
key=API Key
Example
/a/member_developer:balance?key=API_Key
Response
{
"cap_cents": 2000,
"cap_balance_cents": 1250,
"cap_available_cents": 750,
"charge_account": true,
"account_available_cents": 4310
}
cap_centsis your monthly cap, excluding GST.0means no cap is set.cap_balance_centsis what your API requests have cost so far this calendar month, excluding GST. It starts again at midnight on the first day of every month, and is only counted while a cap is set.cap_available_centsis what is left before the cap refuses your requests witherr-developer-cap-reached.nullwhen no cap is set.charge_accountistruewhen your requests are charged to your CarJam account as they are made (account charging, the default on production), andfalsewhen your usage is invoiced monthly.account_available_centsis what your own account has left to spend, its balance plus any credit.nullwithout account charging. Requests are charged to the account including GST (unless you are an overseas business), so a request priced at 100 cents takes 115 from it.
With account charging a request needs both: room under the cap, and enough in the account. An account with auto top-up is topped up when it runs short, so a low account_available_cents there is not a problem by itself. A request the account cannot pay for is refused with err-developer-acc-funds.
See api key security for how the cap works and how to change it.
Cap
Endpoint URL
/a/member_developer:cap
The cap alone, for when that is all you need. The two fields mean the same as in the developer balance above.
Request: GET Parameters
key=API Key
Example
/a/member_developer:cap?key=API_Key
Response
{
"cap_cents": 2000,
"cap_balance_cents": 1250
}
Account balance
Endpoint URL
/a/account:balance
Request: GET Parameters
key=API Keyaccount_key=Account Keyof the account to check. Optional with account charging: leave it out to get the balance of your own account.
Examples
/a/account:balance?key=API_Key&account_key=Account_Key for the account you create reports on behalf of.
/a/account:balance?key=API_Key for your own account, with account charging.
Response
{
"available_cents": 4310
}
available_centsis what the account has left to spend: its balance plus any credit. It can be negative.
Without account charging there is no account of your own to report, so a request without an account_key is refused with Missing Account Key.
Error Responses
{
"code": -1,
"message": "Missing Account Key"
}