API behavior
Idempotency
POST /api/invoices is not idempotent — each call creates a new invoice. Cassia does not honor an Idempotency-Key header; deduplicate on your side using your own request key before calling. Webhook receivers should be idempotent — see Edge cases.
Rate limits
Two limits are currently enforced — be defensive with 429:
- 1000 req/min per IP across all endpoints.
- 10 invoice creates/sec per merchant on
POST /api/invoices.
These ceilings are well above normal usage and exist to prevent runaway clients. We may add tighter per-key application limits later; treat 429 as “back off and retry with jitter”.
Pagination
List endpoints accept limit (default 50, hard cap varies per endpoint) and offset. GET /api/billing/transactions caps at 200. CSV exports paginate server-side and stream the full filtered result.
Error envelope
Every error response uses the same JSON shape:
{
"error": "CONFLICT",
"message": "Wallet for this chain is already registered."
}Error code catalog
error | HTTP | Meaning |
|---|---|---|
UNAUTHORIZED | 401 | Missing/invalid API key or session cookie. |
FORBIDDEN | 403 | Account suspended (read-only mode), or TOTP missing on a 2FA-gated route. |
NOT_FOUND | 404 | Resource not visible to your merchant_id. |
CONFLICT | 409 | E.g. duplicate xpub. |
RATE_LIMITED | 429 | Per-IP or per-merchant ceiling hit. Back off + retry. |
VALIDATION_ERROR | 400 | Request body failed schema validation. The message field names the offending property. |
ERROR | 400 | Generic 400 — usually a wallet or invoice domain rule (wrong xpub depth, wrong chain family, uncancellable status). Read message for the human-readable reason. |
INTERNAL_ERROR | 500 | Unhandled server error. Cassia records it on our side; safe to retry idempotent requests after a delay. |
payment_network_unavailable | 503 | The payment network could not register the invoice, even after Cassia retried automatically. Transient — retry in a few seconds. The invoice was not created and nothing was reserved, so a retry is not a duplicate. |
solana_network_unavailablesolana_monitoring_unavailable | 503 | Solana only. A chain provider Cassia depends on is failing, so no deposit address could be prepared (first code) or registered for monitoring (second). Transient — retry. The invoice was not created and nothing was reserved, so a retry is safe and is not a duplicate. Not a problem with your request. |
Soft-suspend (read-only mode)
If your account is suspended (after an emergency-lock or admin action), all writes return 403 Forbidden with message Account suspended — read-only mode. Contact support. GET requests and POST /api/auth/logout still succeed so you can finish ongoing reconciliation and sign out cleanly.
Updated . For integration help, email [email protected]