Billing API
Balance, prices, free credit, invoices and top-ups. Read only.
The same operations are in the interactive API reference, and the whole contract is in the OpenAPI document.
GET/v1/billing/balance
Wallet and free credit balance
Returns what the organization can spend right now: the wallet balance and the free credit still unused, both in minor units (paisa) of one currency. Needs billing:read.
Money you added (wallet_minor) and free credit (free_credit_minor) are separate. Free credit pays for most use but not for bulk campaigns, which need added money. Live use that finds neither covered is refused with 402 insufficient_credit.
A test key reads the sandbox organization's wallet, where nothing is charged. The numbers are read at the moment of the request and change as calls are made, so do not use them to reserve money. Costs nothing to call.
Scope billing:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
GET/v1/billing/prices
Price list
Returns what this organization pays per unit of each product, as it is charged on real use. Needs billing:read. Prices differ between organizations that have a plan or a partner discount, so read them here instead of copying a public price list.
price_micros is millionths of the currency unit per unit: 6000000 is Rs 6. AI chat is priced per million tokens and split into tokens read, written and read again; the other products are priced per minute, message or similar. Not a paged list: the answer is { prices: [...] }, all at once.
Scope billing:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
GET/v1/billing/credits
Free credit
Returns free credit: the grants still running, and credit that expired in the last 30 days. Needs billing:read.
active shows, for each kind of credit, how much was given, how much is left and when the earliest grant ends. expired shows what was lost unused. Credit given as money has a null meter; credit given for one product (for example call minutes) names it. Each line carries a text in plain words, ready to show to a person. Not a paged list; everything comes back at once.
Scope billing:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
GET/v1/billing/invoices
List invoices
Lists the invoices billed to this organization, newest first. Needs billing:read. Only invoices issued to you by AirFone are listed: drafts are left out, and invoices you issue yourself as a reseller are not shown.
Paged, newest first: limit is 1 to 100 (default 50, out of range values are clamped) and cursor is the next_cursor of the previous page. The cursor is opaque and never built by the client; a cursor this API did not return is a 400. has_more is true while another page exists. There is no total. Use the id with GET /v1/billing/invoices/{id} for lines and tax. Amounts are in millionths of the currency unit.
Scope billing:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | integer | No | How many items to return. Default 50, at most 100. |
cursor | query | string | No | The `next_cursor` of the previous page. Opaque; never built by the client. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
GET/v1/billing/invoices/{id}
Get an invoice
Returns one invoice with its lines, tax breakdown, issuer and who it is billed to. Needs billing:read. An id that belongs to another organization is 404. Unlike the list, this also opens invoices you issued yourself as a reseller, and it can show a draft if you know its id.
status is open, overdue, paid or void; paid_at is set only once paid. Tax rates are in basis points. A PDF is available in the console but not through this API. Paying an invoice is also console only.
Scope billing:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The resource id. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |
GET/v1/billing/topups
Top-up and wallet history
Lists money movements on the wallet, newest first: top-ups, charges taken, refunds and adjustments, each with its status. Needs billing:read. Starting a top-up and paying are not available here; no payment flow is exposed through the API.
Paged, newest first: limit is 1 to 100 (default 50, out of range values are clamped) and cursor is the next_cursor of the previous page. The cursor is opaque and never built by the client; a cursor this API did not return is a 400. has_more is true while another page exists. There is no total. Each entry carries currency, the wallet currency, so amount_minor is in that currency's smallest unit.
Scope billing:read. Accepts: API key or personal access token. Open in the API reference
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | integer | No | How many items to return. Default 50, at most 100. |
cursor | query | string | No | The `next_cursor` of the previous page. Opaque; never built by the client. |
AirFone-Version | header | string | No | The API version to use, as a date. Defaults to the version the account was pinned to. |