OpenRCS API reference · v1 ← Back to console Swagger UI
Accounts

Wallet balance & recent ledger (euro-cents)

GET /account/balance bearer_auth

Returns the authenticated caller's wallet state in euro-cents: the `balance_cents` integer balance, the currency (EUR), the effective 3-rate card (the account's `pricing.rate_card` deep-merged over the defaults), the account tier, and the ten most recent ledger audit rows (`unit: cents` rows carry cent amounts; rows without `unit` carry message counts). Read-only. Gated to `status: ready`; a half-provisioned account gets `409 account not ready` instead of an empty wallet. This endpoint is always served — only message sending is gated by billing being disabled.

Parameters

NameInTypeRequiredDescription
Authorization header string yes `Bearer <token>` obtained from `POST /login`.

Responses

StatusDescription
200 Wallet balance (cents), currency, rate card, tier, and the recent ledger.
401 Missing or invalid credentials.
404 Account not found.
409 Account is not ready yet (`status` is not `ready`).

200 example

{
  "balance_cents": 1234,
  "currency": "EUR",
  "rate_card": {
    "NON_CONVERSATIONAL": {
      "basic_cpt_eur": 40,
      "rich_card_cpt_eur": 60
    },
    "CONVERSATIONAL": {
      "first_message_24h_cpt_eur": 100
    }
  },
  "tier": "basic",
  "recent_ledger": [
    {
      "id": "01J0ZZZZZZZZZ2",
      "type": "credit",
      "amount": 6000,
      "unit": "cents",
      "date": "2026-07-20T10:00:00Z"
    },
    {
      "id": "01J0ZZZZZZZZZ1",
      "type": "debit",
      "amount": 4,
      "unit": "cents",
      "date": "2026-07-20T09:00:00Z"
    }
  ],
  "auto_topup": {
    "enabled": true,
    "threshold_cents": 500,
    "amount_cents": 2000,
    "monthly_limit_cents": 20000,
    "spent_this_period_cents": 0,
    "has_saved_method": true,
    "card_brand": "Visa",
    "card_last4": "4242",
    "last_error": null
  }
}