Guides
API principles

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.

json
{
  "errors": [
    {
      "code": 2001,
      "message": "The tax id is invalid.",
      "detailedMessage": "taxId must be a valid CPF"
    }
  ]
}
  • code identifies the error. Use it in your logic.
  • message is Okto's catalog text for the code.
  • detailedMessage explains the specific case. Its text may change; don't parse it.

HTTP statuses

StatusWhen
400Validation, business rules and also "not found" (Okto answers missing resources with 400 and a code such as 4139 or 1000)
401Unknown access token
403No Authorization header
404A path that doesn't exist in the API; the body is Spring Boot's default (timestamp, status, error, message, path), without errors
500Unexpected error (1000), or controlled chaos
503, 429Only 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.

json
{
  "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

CodeMessageWhen it shows up in Mimicr
1000Generic error. Refer to detailed error messageInvalid body, missing resource, a state that doesn't allow the action
1001Duplicate transactionexternalId repeated on the same day (deposits) or already used (withdrawals); identical withdrawal on the same day
2000The credentials are invalid.Missing or invalid token
2001The tax id is invalid.Invalid CPF, or missing taxId in a withdrawal to an e-mail or phone
2002The dict key is invalid.Malformed key; CNPJ key in a withdrawal
2003The amount is invalid.Negative or non-integer amount, or zero in a withdrawal
2004The date is invalid.Date not in yyyy-MM-dd
2009Invalid name.Missing name
2010Invalid external id.externalId not URL-safe (or not a UUID in Automatic Pix)
2014, 2015, 2019, 2020, 2021, 2023KYC and closed loopTest CPFs and accounts
2018Transaction amount limit reachedAmount above R$ 250,000.00
2022Payment refused due to invalid registered account dataInvalid or incomplete bank account
2040The deposit refund failed.Refund of a deposit not paid, or not paid today
2050Payment rejected due to insufficient fundsWithdrawal above the available balance
4101, 4137, 4138Enrollment missing or in an invalid statusBiometric Pix and Smart PIX
4124Biometric Pix - Parameter not providedIncomplete riskSignals or fidoAssertion
4133Error occurred with participant's systemParticipant in outage
4139Payment not foundMissing payment or journey
4140Payment status is invalid for this operationAction out of turn (journey already paid, charge already decided)
4202CPF Rejected on KYCCPF failing KYC or blocked in Pay and Play
4412Participant not foundUnknown participantId
4442Parameter not providedMissing required field in the newer products
4443Invalid parameterInvalid enum or format
4447, 4448Consent expired or refusedPix Direct and Smart PIX
4502Pix automatic recurrence not foundMissing recurrence
4505Date First Recurrence cannot be before the expiration…First charge before D+2
4507pix dict key not foundA key other than the wallet key
6000Kyc validation error occurredKYC 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.