#Balance and billing
For your balance and rates in code, use GET /v1/account.
Details
The /billing endpoints power the dashboard: they aren't versioned, and fields not listed here can change.
How a text is priced
Cost of one text = segments × (sms_rate_usd_per_segment + carrier_fee_usd_per_segment + compliance_per_segment).
Details
sms_rate_usd_per_segmentandcarrier_fee_usd_per_segmentcome from GET /v1/account. Typical rates are0.05before your campaign is submitted and0.02after, or your negotiated rate.compliance_per_segmentis $0.005 for number validation (on by default), plus $0.005 if TCPA scrubbing is on. Read it fromGET /billing/balance.- A text with an image is one flat MMS charge, whatever its length: $0.0625 by default, or your negotiated rate, plus the compliance charge once.
GET /billing/balancereturns it asmms_cost_per_message. - Replies you receive are billed too, the same way as texts you send:
segments × (sms_rate + carrier_fee).
Example: a 2-segment text at $0.02 with validation on costs 2 × (0.02 + 0.0045 + 0.005) = $0.059.
#Get balance and rates
/v1/accountYour balance and the exact rates you're billed at, including any negotiated rate.
Returns
data.balance_usdnumber- Your balance, rounded to cents. Use
balance_centsfor exact math. data.balance_centsinteger- Your balance in cents.
data.sms_rate_usd_per_segmentnumber- Your per-segment rate.
data.carrier_fee_usd_per_segmentnumber- The carrier fee per segment.
data.plannull- A legacy field. Don't rely on it: pricing is pay as you go from your balance.
Errors
| HTTP | Code | When |
|---|---|---|
| 500 | internal_error | Read failed. Retry. |
Billing
#Get balance details
/billing/balanceYour balance, prices and usage, as the dashboard shows them.
balance and estimated_segments are a count of 1-segment texts your balance buys, not money. Your money balance is balance_usd.Returns
data.balance_usd, balance_centsnumber, integer- Your balance. Read live.
data.rate, carrier_fee_per_segment, compliance_per_segmentnumber- Your per-segment prices in USD.
data.mms_cost_per_messagenumber- Your price for a text with an image.
data.number_price_centsinteger- Monthly price per number.
data.monthly_spendnumber- USD spent this calendar month.
data.monthly_messagesinteger- Texts sent in the last 30 days (not this calendar month).
data.daily_avg_send, estimated_days_leftnumber- Forecast. Usage and forecast fields can lag by up to a minute.
Errors
| HTTP | Code | When |
|---|---|---|
| 500 | no code | The balance couldn't be loaded. Retry. |
#List billing history
/billing/transactionsTop-ups, credits, refunds and card charges one by one, and usage summed per day.
Query parameters
from, toYYYY-MM-DDOptional- UTC dates, inclusive.
Details
Withoutfromyou get the last 90 days. Any other format is ignored, not rejected: checksummary.fromandsummary.toto confirm your filter applied. limitintegerOptionalDefault20Max200- Page size.
Details
Negative or non-numeric values fall back to 20, but0returns an empty page. offsetintegerOptionalDefault0- Rows to skip.
Returns
data[]object[]- Rows:
row_type,id,type,cost_usd,description,created_at.Details
row_typeistransaction,daily_usageorstripe_charge.idis a string or an integer: treat it as an opaque string. Usage rows carry the end of their day increated_at. data[].cost_usdnumber- Always positive, whether money came in or went out. Use
typefor the direction (table below).Details
Ignoreamount: it's a legacy count, not money. totalinteger- Rows in the range.
summaryobjectspend_usd(money charged to your card in the range),count,from,to.
Details
| Direction | type |
|---|---|
| Into your balance | purchase, auto_rebill, carrier_auto_rebill, carrier_deposit, bonus, credit, survey_completion_credit, onboarding_welcome_credit, admin_grant, card_verification_credit, refund |
| Out of your balance | daily_sms, daily_inbound, daily_other and other daily_*, campaign_hold, tcpa_scrub_fee, data_purchase, fine, admin_deduction |
| Card charge that doesn't touch the balance | stripe_charge (for example a brand registration) |
Usage isn't itemized per text: it's one row per day per category.
Details
For per-message cost, use cost_usd on GET /v1/messages. At most the 200 newest top-up and credit rows are returned per range, so narrow from and to to see older ones. Results can lag up to 30 seconds.
Errors
| HTTP | Code | When |
|---|---|---|
| 403 | permission_denied | The key's user lacks view_billing. |
| 503 | permission_check_unavailable | The permission check couldn't run. Retry. |
| 500 | no code | Transactions couldn't be loaded. Retry. |