Balance and billing
For your balance and rates in code, use GET /v1/account. The /billing endpoints below power the dashboard: they aren’t versioned, and fields not listed here can change. Prices are on Billing and pricing. To add money or turn on Auto top-up, use Add funds in Settings → Billing (Add money).
#The Transaction object
One row of billing history.
row_typestringtransaction(a top-up, credit or refund on your balance),daily_usage(usage summed per day per category; usage isn’t itemized per text) orstripe_charge(a card charge that doesn’t touch the balance, for example a brand registration).idstring or integer- Treat it as an opaque string.
typestring- The kind of row within its
row_type, for exampledaily_sms,stripe_chargeorbonus. cost_usdnumber- Positive, whether money came in or went out, except on
adjustmentandadmin_deductionrows, which are negative when money left your balance. Useis_creditfor the direction. is_creditbooleantruemeans money came onto your balance.descriptionstring- What the row is, in words.
created_atstring- When it happened. A usage row carries the end of its day.
amountinteger- A legacy count, not money. Ignore it.
#Get balance and rates
Your balance and the exact rates you’re billed at, including any negotiated rate.
Returns
data.balance_usdnumber | null- Your balance, rounded to cents. Use
balance_centsfor exact math. data.balance_centsinteger | null- Your balance in cents.
data.planstring | null- Always
null. Ready bills from your balance, not a plan; the field is kept so older integrations don’t break. data.sms_rate_usd_per_segmentnumber | null- Your per-segment rate.
nullif it couldn’t be read; retry. data.carrier_fee_usd_per_segmentnumber | null- The carrier fee per segment.
nullwhen the rate is. data.compliance_usd_per_segmentnumber | null- The compliance surcharge per segment for the checks your account has on: number validation and TCPA scrubbing, each when it’s on.
0when both are off or your account isn’t charged it.nullif it couldn’t be read; retry. data.mms_usd_per_messagenumber | null- Your price for one text with an image, carrier fee included, whatever its length.
nullif it couldn’t be read; retry. data.managed_billing_hiddenboolean- Only present, as
true, when an agency pays for your account. Its wallet and prices are the agency’s, so the balance, plan and every price above arenull.
Errors
| HTTP | Code | When |
|---|---|---|
| 500 | internal_error | Read failed. Retry. |
#List billing history
Top-ups, credits, refunds and card charges one by one, and usage summed per day. Needs the view_billing permission.
Parameters
from, toYYYY-MM-DD · query- UTC dates, inclusive. Without
fromyou get the last 90 days. Any other format is ignored, not rejected: checksummary.fromandsummary.toto confirm your filter applied. An account its agency pays for gets nofromortoinsummary. limitinteger · queryDefault20Max1000- Page size.
0, negative or non-numeric values fall back to 20. offsetinteger · queryDefault0- Rows to skip.
Returns a list of Transaction objects in data. For per-message cost, use cost_usd on GET /v1/messages. At most the 200 newest top-up and credit rows, and the 200 newest refunds, are returned per range, so narrow from and to to see older ones. A new top-up or credit shows at once. Usage can lag up to 30 seconds, and the first load after a quiet spell may show older usage while it refreshes.
Returns
totalinteger- Rows in the range.
summaryobjectspend_usd(money charged to your card in the range),count,from,to. For an account its agency pays for (a sub-account made withbilling: "agency", or any call withX-Sub-Account-Idfor one), the rows are its own usage, one per day, andsummaryis only{ "complete": true }.
Errors
| HTTP | Code | When |
|---|---|---|
| 503 | permission_check_unavailable | The permission check couldn’t run. Retry. |
| 500 | no code | Transactions couldn’t be loaded. Retry. |
#Export billing history as CSV
The same history as List billing history, as one CSV file. Needs the view_billing permission.
Parameters
from, toYYYY-MM-DD · query- UTC dates, inclusive. Leave both out for the whole history. A date in any other format is refused.
Returns text/csv with the columns id, type, amount, cost_usd, description, created_at and category. An account its agency pays for gets its own usage, one row per day.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | no code | A date isn’t YYYY-MM-DD, or from is after to. |
| 422 | export_range_too_large | Too many rows for one file. Pick a shorter range. |
| 429 | no code | Too many exports in a short time. Wait, then retry. |
| 500 | no code | The file couldn’t be built. Retry. A download that stops partway is not a complete file. |
#Get billing status
Whether the account that pays is in good standing. When a payment failed, lists what’s failing.
Returns
data.billing_statusstringactivewhen all is well;past_dueafter a failed subscription payment;at_riskafter your card is refused for automatic top-ups;fraud_holdorcanceledwhen the account is on hold or closed.data.past_due_sincestring | null- When the account went past due, ISO 8601.
nullwhen it isn’t. data.failing_subscriptions[]object[]- Only when
past_due:type(brand,campaign,phone_numberorblue_line),record_id,label,status(past_due,unpaidorincomplete).
#Get saved cards
The cards on file for the account that pays. Only brand, last 4 and expiry; never the card number. Needs the view_billing permission.
Returns
data.has_cardboolean- Whether a card is on file.
data.cards[]object[]id,brand,last4,exp(M/YYYY) andis_primary.
Errors
| HTTP | Code | When |
|---|---|---|
| 503 | permission_check_unavailable | The permission check couldn’t run. Retry. |
| 500 | cards_not_loaded | The cards couldn’t be loaded. Retry. |
#Get spend history
What you spent each day for the last 30 days, this month and last month, and a projection for this month. In dollars, by UTC day. Needs the view_billing permission.
Returns
data.daily[]object[]- 30 rows of
dateandamount, oldest first. Days with no spend are0. data.this_month_spent, data.last_month_spentnumber- Dollars spent this month so far, and last month.
data.projectionnumber- This month so far, divided by days elapsed, times days in the month.
data.vs_last_month_pctinteger | null- Projection against last month.
nullwhen last month was 0.
Errors
| HTTP | Code | When |
|---|---|---|
| 503 | permission_check_unavailable | The permission check couldn’t run. Retry. |
#How a text is priced
Cost of one text = segments × (sms_rate_usd_per_segment + carrier_fee_usd_per_segment + compliance_usd_per_segment). A text with an image costs mms_usd_per_message + compliance_usd_per_segment, whatever its length. All four come from one call to GET /v1/account. Replies you receive are billed too, per segment, at your send rate plus the carrier fee, unless your account has its own price for received texts; see Your price on Billing and pricing. When someone texts STOP, START or HELP, Ready answers automatically, as carriers require. That answer is billed like a text you send. If your balance can’t cover it, it is sent free.
The rates are your own, so read them from that call instead of hard-coding them. The numbers in the examples on this page are for illustration only. Where to see your prices in the app is on Billing and pricing.
Older paths
GET /v1/balanceandGET /v1/account/balance: the same body asGET /v1/account.GET /billing/balance: the dashboard’s balance read. UseGET /v1/account. It also returns forecast fields (monthly_spendfor this calendar month in UTC,monthly_messagesfor the last 30 days,daily_avg_send,estimated_days_left, andnumber_price_cents, your monthly price per number in cents), some cached for up to 15 minutes. Itsbalanceandestimated_segmentscount 1-segment texts, not money.
See also: the guide to doing this in the app.