# Money balance & SMS credits

https://docs.sendsms.to/en/api/balance/

`GET /v1/balance`

Default: money and smsCredits.total only. Exact decimal strings. Prepaid balance is booked funds, not a promise that all funds are spendable; holds and campaign reservations may restrict sending. For postpaid, balance is paid funds; request include=postpaid for available credit. Internal accounts return balance=null. No account ID can be supplied. SMS total spans scoped credits and does not imply eligibility for every destination. Each page is a fresh snapshot. Limited to one request per account per 10 seconds, in addition to general API limits.

Required permission: balance.read

## Parameters

- `include` (query, optional): Optional comma-separated unique values: smsBreakdown,postpaid,account. Unknown, empty and duplicate values are rejected. postpaid is omitted for non-postpaid accounts. account adds snapshot time, account kind, payment mode, suspension status and balance meaning.
- `limit` (query, optional): SMS scope page size; allowed only with include=smsBreakdown.
- `after` (query, optional): nextCursor from the previous page; allowed only with include=smsBreakdown.

## Request example

```bash
curl --max-time 30 --request GET \
  --url 'https://api.sendsms.to/v1/balance' \
  --header "X-API-Key: $SENDSMS_API_KEY"
```

## Responses

### HTTP 200 — Current snapshot; Cache-Control: no-store

```json
{
  "money": {
    "balance": "125.12345",
    "currency": "USD"
  },
  "smsCredits": {
    "total": "1500.00"
  }
}
```

| Field | Type | Description |
| --- | --- | --- |
| `money` | object | required. Monetary account snapshot calculated by SendSMS from its ledger. It is separate from SMS credits. |
| `money.balance` | string | null | required. Booked prepaid balance, or paid funds for postpaid. SendSMS returns a decimal string with 5 fractional digits in money.currency. This is not a spendable-funds promise: reservations and credit restrictions may apply. null for an internal account. |
| `money.currency` | string | required. ISO 4217 currency code saved in the account settings by SendSMS. All monetary values in this money object use this currency; no client-side relabeling or implicit conversion. |
| `money.postpaid` | object | optional. Included only when include=postpaid is requested for a non-internal postpaid account. SendSMS calculates this object from the current billing-period limits and usage. Absence does not mean zero. |
| `money.postpaid.period` | string | required. Billing month YYYY-MM calculated by SendSMS using the platform billing time zone. Not a Unix timestamp or the client device month. |
| `money.postpaid.fixedLimit` | string | required. Configured fixed monthly credit limit. Calculated/read by SendSMS. Decimal string with 5 digits in money.currency. |
| `money.postpaid.fixedUsed` | string | required. Recorded usage of the fixed monthly limit. Calculated/read by SendSMS. Decimal string with 5 digits in money.currency. |
| `money.postpaid.fixedRemaining` | string | required. max(fixedLimit − fixedUsed, 0). Calculated/read by SendSMS. Decimal string with 5 digits in money.currency. |
| `money.postpaid.additionalLimit` | string | required. Additional credit granted for this billing period. Calculated/read by SendSMS. Decimal string with 5 digits in money.currency. |
| `money.postpaid.additionalUsed` | string | required. Recorded usage of the additional credit. Calculated/read by SendSMS. Decimal string with 5 digits in money.currency. |
| `money.postpaid.additionalRemaining` | string | required. max(additionalLimit − additionalUsed, 0). Calculated/read by SendSMS. Decimal string with 5 digits in money.currency. |
| `money.postpaid.available` | string | required. fixedRemaining + additionalRemaining; excludes paid funds. Calculated/read by SendSMS. Decimal string with 5 digits in money.currency. |
| `money.postpaid.totalAvailable` | string | required. money.balance + available; a calculated snapshot, not a reservation. Calculated/read by SendSMS. Decimal string with 5 digits in money.currency. |
| `smsCredits` | object | required. SMS quota snapshot maintained by SendSMS, separate from monetary funds. |
| `smsCredits.total` | string | required. Sum of the account’s SMS credit quantities across scopes, calculated by SendSMS. Decimal string with 2 digits, in SMS credits, not currency or successfully delivered messages. Scope restrictions still apply. |
| `smsCredits.items` | array<object> | optional. Scope breakdown returned only with include=smsBreakdown. SendSMS returns at most limit items; an empty array means no matching rows on this page. |
| `smsCredits.items[].id` | string · uuid | required. UUID generated by the SendSMS database when the credit-balance scope row is created. Identifies that balance row, not a message or operator. |
| `smsCredits.items[].country` | string | null | required. Country restriction stored for the credit scope, usually an ISO alpha-2 code. null means no country restriction on that row, not an unknown recipient country. |
| `smsCredits.items[].operatorId` | string | null · uuid | required. Existing operator/provider UUID recorded in the scope by SendSMS. null means no operator restriction on this row. This ID does not itself identify the recipient’s current network. |
| `smsCredits.items[].operatorName` | string | null | required. Operator/provider display name read from the SendSMS registry for operatorId; null when no name is available. Use operatorId for references, not this editable name. |
| `smsCredits.items[].quantity` | string | required. Stored remaining quota for this exact scope. SendSMS returns a decimal string with 2 fractional digits, in SMS credits. |
| `smsCredits.items[].currency` | string | required. Valuation currency stored with the SMS credit row. quantity remains a number of credits; this field does not turn credits into cash. |
| `smsCredits.nextCursor` | string | null · uuid | optional. SendSMS copies the last returned row ID when another page exists. Pass it unchanged as after with include=smsBreakdown. null means no next page in this snapshot; not a new resource ID. |
| `asOf` | string · date-time | optional. Present with include=account. SendSMS database statement timestamp of this balance snapshot, serialized as ISO 8601 UTC. Not the last top-up or message delivery time. |
| `accountKind` | string | optional. With include=account: financial account classification stored by SendSMS. customer is a customer account; internal has no platform cash balance. |
| `paymentMode` | string | optional. With include=account: configured payment mode, prepaid or postpaid, read from SendSMS account settings. |
| `billingSuspended` | boolean | optional. With include=account: SendSMS billing flag. true blocks new billable traffic; it does not mean this balance read failed. |
| `balanceType` | string | optional. With include=account, computed by SendSMS: booked_prepaid = booked prepaid balance; paid_funds = paid postpaid funds, excluding credit; not_applicable = internal account with null money.balance. |

### HTTP 400 — Invalid parameters, including any account selector

```json
{
  "error": "string"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | required. Error identifier or legacy human-readable text returned by SendSMS. Not every handler exposes a stable machine code here. Check HTTP status and documented identifiers; never parse translated prose as a permanent code. |
| `message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `code` | string | optional. Optional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code. |
| `statusCode` | integer | optional. Optional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative. |

### HTTP 401 — Missing, invalid, expired or revoked API key

```json
{
  "error": "string"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | required. Error identifier or legacy human-readable text returned by SendSMS. Not every handler exposes a stable machine code here. Check HTTP status and documented identifiers; never parse translated prose as a permanent code. |
| `message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `code` | string | optional. Optional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code. |
| `statusCode` | integer | optional. Optional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative. |

### HTTP 403 — Key lacks balance.read; or the request came from an IP address not allowed for this key (ip_not_allowed)

```json
{
  "error": "string"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | required. Error identifier or legacy human-readable text returned by SendSMS. Not every handler exposes a stable machine code here. Check HTTP status and documented identifiers; never parse translated prose as a permanent code. |
| `message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `code` | string | optional. Optional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code. |
| `statusCode` | integer | optional. Optional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative. |

### HTTP 404 — Account missing or archived

```json
{
  "error": "string"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | required. Error identifier or legacy human-readable text returned by SendSMS. Not every handler exposes a stable machine code here. Check HTTP status and documented identifiers; never parse translated prose as a permanent code. |
| `message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `code` | string | optional. Optional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code. |
| `statusCode` | integer | optional. Optional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative. |

### HTTP 429 — Rate limit; respect Retry-After

```json
{
  "error": "string"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | required. Error identifier or legacy human-readable text returned by SendSMS. Not every handler exposes a stable machine code here. Check HTTP status and documented identifiers; never parse translated prose as a permanent code. |
| `message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `code` | string | optional. Optional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code. |
| `statusCode` | integer | optional. Optional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative. |

### HTTP 503 — Balance temporarily unavailable; respect Retry-After, never substitute zero

```json
{
  "error": "string"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | required. Error identifier or legacy human-readable text returned by SendSMS. Not every handler exposes a stable machine code here. Check HTTP status and documented identifiers; never parse translated prose as a permanent code. |
| `message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `code` | string | optional. Optional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code. |
| `statusCode` | integer | optional. Optional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative. |
