Read the organization's wallet
The prepaid balance the billing provider keeps for the organization: credits paid for and given, drawn from first by every invoice.
The prepaid balance the billing provider keeps for the organization: credits paid for and given, drawn from first by every invoice. state: none until a first top-up. Read from the billing provider at the time of the call; the billing provider not answering is upstream. With billing off, a wallet in state none.
For people only: a signed-in person's token makes this call. An API key is refused with person_required. The person's role must be one that may read billing.
Request
curl "https://api.pod.mapier.ai/v1/billing/wallet" \
-H "Authorization: Bearer $POD_PERSON_TOKEN"Answer
200. The wallet.
{
"state": "none",
"currency": "example",
"balance_cents": 1,
"ongoing_balance_cents": 1,
"paid_credits_cents": 0,
"granted_credits_cents": 0
}| Field | Type | Always | What it is |
|---|---|---|---|
state | "none" | "active" | "terminated" | Yes | |
currency | string | Yes | ISO 4217. |
balance_cents | integer | Yes | |
ongoing_balance_cents | integer | Yes | The balance once the month's usage so far is drawn from it, as the billing provider estimates it. |
paid_credits_cents | integer | Yes | At least 0. |
granted_credits_cents | integer | Yes | At least 0. |
Errors
The refusals this call is known for: person_required, upstream. Any call can also answer unauthorized, rate_limited, unavailable or internal; the error list says what each means and when to send the call again.
In the SDKs
| Client | Call |
|---|---|
| TypeScript | pod.billing.wallet() |
| Python | pod.billing.wallet() |