Errors
Error response format and list of codes.
Errors use HTTP status codes and always have the same format. Build your logic on code, which is stable. message is text for people, comes in Portuguese and may change.
code: error identifier.message: readable description.details: optional. On validation errors, a list of{ field, message }.
422 invalid_request
{
"error": {
"code": "invalid_request",
"message": "Parâmetros inválidos.",
"details": [
{
"field": "amount",
"message": "Invalid input: expected number, received undefined"
}
]
}
}Codes
| HTTP | code | When it happens |
|---|---|---|
| 400 | invalid_json | The body is not valid JSON. |
| 401 | unauthorized | Missing, invalid or revoked API key. |
| 402 | insufficient_funds | Available balance lower than amount plus fee. |
| 403 | account_not_active | Account not yet approved to operate in live mode. |
| 403 | account_blocked | Account blocked. Contact support. |
| 403 | charges_blocked | Only incoming payments are blocked on the account: new charges are refused; payouts continue. |
| 403 | payouts_blocked | Only outgoing payments are blocked on the account: new payouts are refused; charges continue. |
| 403 | negative_balance_limit | Account with a negative balance beyond the allowed limit: new charges and payouts are blocked until it is settled. Repeating a creation with the same Idempotency-Key still returns the original record. |
| 403 | ip_not_allowed | The call came from an IP that is not in the allowed IPs of the account. |
| 403 | key_not_allowed | The live key does not have permission to make payouts. |
| 403 | forbidden | Action not allowed in the current state of the resource or in this environment. |
| 404 | not_found | Resource does not exist, or belongs to another account or environment. |
| 404 | receipt_unavailable | Receipt only for Pix payouts that are paid, have an E2E and were not returned. |
| 409 | idempotency_conflict | Idempotency-Key already used with other parameters. |
| 409 | idempotency_in_progress | The original request is still in progress. |
| 409 | conflict | Conflict while creating the charge. Repeat the request. |
| 422 | invalid_request | Invalid parameters. See details. |
| 422 | amount_limit_exceeded | Amount above the limit allowed per transaction. |
| 429 | rate_limited | Request limit reached. |
| 500 | internal_error | Unexpected error on our side. |
| 502 | provider_error | The operation could not be processed. |
| 503 | provider_unavailable | Payment service currently unavailable. |
What to retry
- 4xx: do not retry without fixing the request. The exceptions are
429, which can be retried after waiting, andidempotency_in_progress. - 5xx on payouts, or timeout: retry with the same
Idempotency-Key. Never create a new payout without knowing what happened to the previous one. - 503 on charges: try again. You can reuse the same key: a charge that failed on creation releases the key.