Return the caller's spendable credit balance.
curl --request GET \
--url https://api.example.com/v1/billing/balance \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/v1/billing/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/v1/billing/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ok": true
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}Billing
Billing credits
Read credit balances and manage prepaid account funding.
GET
/
v1
/
billing
/
balance
Return the caller's spendable credit balance.
curl --request GET \
--url https://api.example.com/v1/billing/balance \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/v1/billing/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/v1/billing/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ok": true
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}Billing endpoints use the authenticated account as the billing owner. Monetary
request and response values are decimal USD strings.
Top-ups and automatic-top-up changes require an
| Method | Path | Purpose |
|---|---|---|
GET | /v1/billing/balance | Return the spendable balance and active promotional or paid lots. |
GET | /v1/billing/transactions | Return recent credit-ledger activity. |
GET | /v1/billing/invoices | Return recent Stripe payment receipts. |
POST | /v1/billing/payment-method/setup | Start secure card setup and return a Stripe client secret. |
POST | /v1/billing/payment-method/complete | Confirm that card setup completed for this account. |
POST | /v1/billing/top-ups | Purchase $5.00–$500.00 of prepaid funds. |
GET | /v1/billing/top-ups/:purchaseId | Poll one top-up owned by the caller. |
GET | /v1/billing/auto-top-up | Read the automatic top-up policy. |
PUT | /v1/billing/auto-top-up | Enable, disable, or update automatic top-up. |
Idempotency-Key header.
Top-up presets are $5, $25, $100, and $500; custom amounts from $5.00
through $500.00 are accepted. Automatic top-up is opt-in and defaults to
recharging the balance to $25.00 when it reaches $5.00.
A top-up may return 202 while payment is pending. Poll its returned URL until
the status is paid, failed, or action_required. Funds are not spendable
until payment succeeds.
Was this page helpful?
