Guides
Account and management

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:

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):

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

CodeHTTPWhen
VAL-001400Pix key invalid for its pixKeyType
VAL-002 to VAL-013400In Mimicr: invalid externalId, webhook URL, amount, method, pixKeyType, bank, branch/account, accountType, document, copy-and-paste code, currency or preValidations
VAL-014422In Mimicr: currency without a quote (conversion failure)
VAL-031409externalId already processed
VAL-020 to VAL-025asynchronousIn 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)

CodeHTTPWhen
DEP-041400Invalid or disabled method
DEP-105400PUT outside Draft
DEP-106400The status doesn't allow the operation (cancel, refund outside Released, PATCH)
DEP-107400Cancelling an intent that is already cancelled
DEP-108400Cancelling an intent that is already declined
DEP-110422Intent declined by the validation pipeline
DEP-123409Duplicate externalId
DEP-001 to DEP-003, DEP-042 to DEP-049400In Mimicr: invalid externalId, webhookUrl, deposits, amount, currency, ITP without document or redirectUrl, expiration, matchingStrategy, validations or data
DEP-130403In Mimicr: write on another merchant's intent
DEP-404404In 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:

json
{ "success": false, "code": 5001, "message": "Deposit intent not found." }
codeHTTPMeaning
5001404Resource not found (Deposit intent not found., Payment intent not found., Merchant not found., Currency 'XXX' not found., Pix participants are not available.)
2001400Unprocessable input: Unable to decode the provided Pix QR Code.
1001400In Mimicr: validation error (statement over 30 days, limits, profile, contact, Pix key)
4009409In 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:

StatusWhenBody
401Missing, expired or invalid token, or wrong credentials on /authEmpty
403Valid token without permission—
405In Mimicr: an HTTP method the route doesn't acceptEmpty
502Service unavailable (on /auth: {"title": "Authentication service unavailable", "status": 502})—
504Service 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: the externalId already exists. Look it up by externalId instead of creating it again.
  • 401: get a new token and retry once.
  • 5xx and timeouts: retry with the same externalId. If the retry answers 409, the first call had already been accepted: look it up by externalId.