Guides
Errors
Okto's error envelope, the HTTP statuses and the most common codes.
Every Okto error response has the same body: an errors list with a numeric code, the fixed catalog message and a detail.
{
"errors": [
{
"code": 2001,
"message": "The tax id is invalid.",
"detailedMessage": "taxId must be a valid CPF"
}
]
}codeidentifies the error. Use it in your logic.messageis Okto's catalog text for the code.detailedMessageexplains the specific case. Its text may change; don't parse it.
HTTP statuses
| Status | When |
|---|---|
400 | Validation, business rules and also "not found" (Okto answers missing resources with 400 and a code such as 4139 or 1000) |
401 | Unknown access token |
403 | No Authorization header |
404 | A path that doesn't exist in the API; the body is Spring Boot's default (timestamp, status, error, message, path), without errors |
500 | Unexpected error (1000), or controlled chaos |
503, 429 | Only with controlled chaos; 429 carries Retry-After: 1 |
Responses produced by chaos carry the X-Mimicr-Chaos header (api-error when nothing was processed, api-error-after-processing when the operation went through anyway). See Testing in the sandbox.
Errors inside operations
An operation created successfully can fail later, when the player or the bank acts. Then the error doesn't come in an HTTP response: it shows up in errorList (same item shape) in the operation's status and in the notification, and errorMessage in the lists carries the message.
{
"id": "1268321722477579",
"status": "failed",
"errorList": [
{ "code": 2015, "message": "Payment refused due to deceased cpf status", "detailedMessage": "Payment refused due to deceased cpf status" }
]
}Most common codes
| Code | Message | When it shows up in Mimicr |
|---|---|---|
1000 | Generic error. Refer to detailed error message | Invalid body, missing resource, a state that doesn't allow the action |
1001 | Duplicate transaction | externalId repeated on the same day (deposits) or already used (withdrawals); identical withdrawal on the same day |
2000 | The credentials are invalid. | Missing or invalid token |
2001 | The tax id is invalid. | Invalid CPF, or missing taxId in a withdrawal to an e-mail or phone |
2002 | The dict key is invalid. | Malformed key; CNPJ key in a withdrawal |
2003 | The amount is invalid. | Negative or non-integer amount, or zero in a withdrawal |
2004 | The date is invalid. | Date not in yyyy-MM-dd |
2009 | Invalid name. | Missing name |
2010 | Invalid external id. | externalId not URL-safe (or not a UUID in Automatic Pix) |
2014, 2015, 2019, 2020, 2021, 2023 | KYC and closed loop | Test CPFs and accounts |
2018 | Transaction amount limit reached | Amount above R$ 250,000.00 |
2022 | Payment refused due to invalid registered account data | Invalid or incomplete bank account |
2040 | The deposit refund failed. | Refund of a deposit not paid, or not paid today |
2050 | Payment rejected due to insufficient funds | Withdrawal above the available balance |
4101, 4137, 4138 | Enrollment missing or in an invalid status | Biometric Pix and Smart PIX |
4124 | Biometric Pix - Parameter not provided | Incomplete riskSignals or fidoAssertion |
4133 | Error occurred with participant's system | Participant in outage |
4139 | Payment not found | Missing payment or journey |
4140 | Payment status is invalid for this operation | Action out of turn (journey already paid, charge already decided) |
4202 | CPF Rejected on KYC | CPF failing KYC or blocked in Pay and Play |
4412 | Participant not found | Unknown participantId |
4442 | Parameter not provided | Missing required field in the newer products |
4443 | Invalid parameter | Invalid enum or format |
4447, 4448 | Consent expired or refused | Pix Direct and Smart PIX |
4502 | Pix automatic recurrence not found | Missing recurrence |
4505 | Date First Recurrence cannot be before the expiration… | First charge before D+2 |
4507 | pix dict key not found | A key other than the wallet key |
6000 | Kyc validation error occurred | KYC lookup without accepted terms |
Okto publishes the full catalog (over 150 codes) in its Swagger; Mimicr uses the same messages. The detailedMessage texts are Mimicr's.