Fundamentals
Errors and limits
Error format, HTTP codes, rate limits and API versioning.
Format
Every error has the same shape:
JSON
{ "error": { "type": "invalid_request_error", "code": "amount_invalid", "message": "`amount` must have at most 2 decimals", "param": "amount", "requestId": "req_5f1a2b3c4d5e6f708192a3b4" }}- Code against
typeandcode.messageis for humans and may change. parampoints to the field that failed, when it applies.- Keep the
requestId. It also comes in theX-Request-Idheader. Include it when you contact support.
Codes
| HTTP | type | code |
|---|---|---|
| 400 | invalid_request_error | invalid_json, body_required, amount_required, amount_invalid, currency_not_supported, description_too_long, reference_too_long, allowed_methods_invalid, metadata_invalid, metadata_too_large, expires_at_invalid, idempotency_key_too_long, cursor_invalid, limit_invalid, status_invalid, charge_invalid |
| 401 | authentication_error | missing_api_key, invalid_api_key, api_key_expired, publishable_key_not_allowed, sandbox_not_supported |
| 403 | permission_error | insufficient_scope, merchant_not_active |
| 404 | invalid_request_error | charge_not_found, order_not_found, balance_not_found, statement_not_found, unknown_route |
| 405 | invalid_request_error | method_not_allowed |
| 409 | invalid_request_error | reference_exists, idempotency_key_reused, idempotency_in_flight |
| 413 | invalid_request_error | payload_too_large |
| 429 | rate_limit_error | rate_limited |
| 500 | api_error | internal_error |
Note
Another merchant's resource returns
404, just like one that doesn't exist. A malformed id also returns 404.What to retry
| Response | What to do |
|---|---|
4xx (except 429) | Don't retry as is. Fix the request. |
429 | Wait the Retry-After seconds and retry. |
500 or network error | Retry with the same Idempotency-Key. |
Limits
- 300 reads and 60 writes per minute, per key.
- Above that, you get
429 rate_limitedwithRetry-After. - Ten failed authentication attempts per minute with the same key also return
429.
Versioning and scope
- Every response has the
TuCapi-Api-Version: 2026-09-15header. - Objects only gain fields. They're never renamed or removed. A breaking change would be a
/v2. - USD only.
- There's no cancellation or refund through the API. Those are handled in the dashboard.