Guides
Errors
The three GO 2.0 error shapes, the VAL and DEP codes, the ApiResponse envelope and the gateway errors.
GO 2.0 uses three error shapes, depending on the kind of call. Always capture the response's X-Trace-ID header: errors carry it too.
1. Transactional writes: problem+json
Payment creation and deposit creation, update, cancellation and refund answer application/problem+json:
{
"type": "https://www.rfc-editor.org/rfc/rfc9110#section-15.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": [
{ "code": "VAL-001", "message": "Invalid Pix key", "field": "payment.data.pixKeyValue" }
]
}For deposits, type uses another domain and there is an intentId (or null when the intent doesn't exist):
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"intentId": null,
"errors": [
{ "code": "DEP-041", "message": "Payment method deve ser válido", "field": "Deposits[0].Method" }
]
}VAL codes (Pay Out)
Pay4Fun documents VAL-001 and VAL-031; the rest are Mimicr's.
| Code | HTTP | When |
|---|---|---|
VAL-001 | 400 | Pix key invalid for its pixKeyType |
VAL-002 to VAL-013 | 400 | In Mimicr: invalid externalId, webhook URL, amount, method, pixKeyType, bank, branch/account, accountType, document, copy-and-paste code, currency or preValidations |
VAL-014 | 422 | In Mimicr: currency without a quote (conversion failure) |
VAL-031 | 409 | externalId already processed |
VAL-020 to VAL-025 | asynchronous | In Mimicr: validation refusals, in validation-errors with a Declined webhook (method off, per-transaction limit, daily limit, no session, Receiver, AccountDestination) |
DEP codes (Pay In)
| Code | HTTP | When |
|---|---|---|
DEP-041 | 400 | Invalid or disabled method |
DEP-105 | 400 | PUT outside Draft |
DEP-106 | 400 | The status doesn't allow the operation (cancel, refund outside Released, PATCH) |
DEP-107 | 400 | Cancelling an intent that is already cancelled |
DEP-108 | 400 | Cancelling an intent that is already declined |
DEP-110 | 422 | Intent declined by the validation pipeline |
DEP-123 | 409 | Duplicate externalId |
DEP-001 to DEP-003, DEP-042 to DEP-049 | 400 | In Mimicr: invalid externalId, webhookUrl, deposits, amount, currency, ITP without document or redirectUrl, expiration, matchingStrategy, validations or data |
DEP-130 | 403 | In Mimicr: write on another merchant's intent |
DEP-404 | 404 | In Mimicr: write on an intent that doesn't exist |
Failures that happen after creation show up in the intent's errors, not in the response: DEP-111 to DEP-114 (pre-validations and screening) and DEP-115 (the account's daily deposit limit) in Validation errors and bank refusals in Deposit errors.
2. Lookups and management: ApiResponse
Lookups, account, configurations, profile, billings, currencies and Pix utilities use the envelope:
{ "success": false, "code": 5001, "message": "Deposit intent not found." }code | HTTP | Meaning |
|---|---|---|
5001 | 404 | Resource not found (Deposit intent not found., Payment intent not found., Merchant not found., Currency 'XXX' not found., Pix participants are not available.) |
2001 | 400 | Unprocessable input: Unable to decode the provided Pix QR Code. |
1001 | 400 | In Mimicr: validation error (statement over 30 days, limits, profile, contact, Pix key) |
4009 | 409 | In Mimicr: Pix key already registered |
Receipts return the file on success; only errors use this envelope. A route that doesn't exist answers 404 with code: 5001.
3. Gateway
These happen before the call reaches the service:
| Status | When | Body |
|---|---|---|
401 | Missing, expired or invalid token, or wrong credentials on /auth | Empty |
403 | Valid token without permission | — |
405 | In Mimicr: an HTTP method the route doesn't accept | Empty |
502 | Service unavailable (on /auth: {"title": "Authentication service unavailable", "status": 502}) | — |
504 | Service didn't answer in time | — |
In Mimicr, controlled chaos also injects 500, 503 and 429 with {"title": "...", "status": ...}; see Sandbox testing.
What to do
400: fix the body. Don't resend it unchanged.409: theexternalIdalready exists. Look it up byexternalIdinstead of creating it again.401: get a new token and retry once.5xxand timeouts: retry with the sameexternalId. If the retry answers409, the first call had already been accepted: look it up byexternalId.