Payin scenarios

Twelve outcomes. Set customer.email and customer.lastName to the pair listed for the scenario you want; leave the rest of your request as it would be in production.

New here? Start with the Quickstart for a complete request, and How scenarios are selected for the mechanism.

All payin scenarios

ScenarioResolvesHTTPFinal statusError codeWebhook
APPROVEDby webhook200APPROVED—+5s → APPROVED
FAILEDsynchronously200FAILEDAMOUNT_INVALID—
CANCELLEDby webhook200CANCELLED—+5s → CANCELLED
PENDINGnever resolves200PENDING——
IDENTITY_INVALID_AGEsynchronously200FAILEDCUSTOMER_INVALID_AGE—
IDENTITY_NOT_ALIVEsynchronously200FAILEDCUSTOMER_NOT_ALIVE—
IDENTITY_INTL_LISTsynchronously200FAILEDCUSTOMER_IN_INTL_LIST—
IDENTITY_INVALID_IDsynchronously200FAILEDCUSTOMER_INVALID_ID—
IDENTITY_SUSPENDEDsynchronously200FAILEDCUSTOMER_SUSPENDED—
IDENTITY_INVALID_STATUSsynchronously200FAILEDCUSTOMER_INVALID_STATUS—
IDENTITY_NOT_FOUNDsynchronously200FAILEDCUSTOMER_NOT_FOUND—
THIRD_PARTY_NOT_ALLOWEDby webhook200CANCELLEDTHIRD_PARTY_PAYMENT_NOT_ALLOWED+0s → CANCELLED

Every scenario returns HTTP 200. The HTTP status is not the outcome — read status on the response body, and message when status is FAILED. See Reading the response.

Synchronous scenarios are final in the response and never send a webhook. Polling them afterwards is not supported: the outcome you already have is the outcome.

Lifecycle scenarios

The four states every payin integration has to handle, in every market.

APPROVED

Email[email protected]
Last nameTestApproved
Response200 with status PENDING
Webhookpayment_status → APPROVED, +5s
Final statusAPPROVED
Markets where this reflects productionAll markets

What your code should do. Release the goods or service on the webhook, not on the synchronous 200. The PENDING response only means the payment was accepted for processing.

FAILED

Email[email protected]
Last nameTestFailed
Response200 with status FAILED — final, resolved synchronously
ReasonAMOUNT_INVALID in message
Webhooknone
Markets where this reflects productionAll markets

What your code should do. The payment is final and rejected. Read message and surface it to the customer; the condition is retryable, so let them correct and try again. Do not fulfil on the 200, and record the attempt: no transaction is persisted, so it cannot be retrieved later.

CANCELLED

Email[email protected]
Last nameTestCancelled
Response200 with status PENDING
Webhookpayment_status → CANCELLED, +5s
Final statusCANCELLED
ReasonCANCELLED
Markets where this reflects productionAll markets

What your code should do. The payment will not complete. Release reserved stock and allow a new attempt. Arrives by webhook, after a PENDING was already returned.

PENDING

Email[email protected]
Last nameTestPending
Response200 with status PENDING
Webhooknone — the payment stays in its initial state
Final statusPENDING
Markets where this reflects productionAll markets

What your code should do. Neither success nor failure. Do not fulfil and do not cancel. The integration needs its own expiry policy for payments that never resolve.

Identity validation scenarios

Rejections produced by national identity registries before the payment is attempted. All resolve synchronously and none sends a webhook. Which of these exist depends on the market — see the Markets line on each.

IDENTITY_INVALID_AGE

Email[email protected]
Last nameTestInvalidAge
Response200 with status FAILED — final, resolved synchronously
ReasonCUSTOMER_INVALID_AGE in message
Webhooknone
Markets where this reflects productionBR, AR, MX

What your code should do. Customer is below the permitted age for the method. Not retryable with the same customer. Show a specific message rather than a generic error.

IDENTITY_NOT_ALIVE

Email[email protected]
Last nameTestNotAlive
Response200 with status FAILED — final, resolved synchronously
ReasonCUSTOMER_NOT_ALIVE in message
Webhooknone
Markets where this reflects productionBR, AR, MX

What your code should do. The registry reports the document holder as deceased. Not retryable. Route to support or compliance rather than inviting a retry.

IDENTITY_INTL_LIST

Email[email protected]
Last nameTestIntlList
Response200 with status FAILED — final, resolved synchronously
ReasonCUSTOMER_IN_INTL_LIST in message
Webhooknone
Markets where this reflects productionBR, AR, MX

What your code should do. Matched an international watchlist. Not retryable. Compliance outcome: do not expose the reason to the customer; follow internal escalation.

IDENTITY_INVALID_ID

Email[email protected]
Last nameTestInvalidId
Response200 with status FAILED — final, resolved synchronously
ReasonCUSTOMER_INVALID_ID in message
Webhooknone
Markets where this reflects productionBR, AR

What your code should do. Document does not match the registry, usually a typo. Ask the customer to re-enter the document, then retry.

IDENTITY_SUSPENDED

Email[email protected]
Last nameTestSuspended
Response200 with status FAILED — final, resolved synchronously
ReasonCUSTOMER_SUSPENDED in message
Webhooknone
Markets where this reflects productionBR

What your code should do. Document is suspended in the registry. Not retryable until the customer resolves it with the registry. Offer an alternative payment method.

IDENTITY_INVALID_STATUS

Email[email protected]
Last nameTestInvalidStatus
Response200 with status FAILED — final, resolved synchronously
ReasonCUSTOMER_INVALID_STATUS in message
Webhooknone
Markets where this reflects productionBR

What your code should do. Registry status does not permit payments. Not retryable. Handle as for CUSTOMER_SUSPENDED.

IDENTITY_NOT_FOUND

Email[email protected]
Last nameTestNotFound
Response200 with status FAILED — final, resolved synchronously
ReasonCUSTOMER_NOT_FOUND in message
Webhooknone
Markets where this reflects productionAR

What your code should do. Document not found in the registry. Ask the customer to verify their data; retryable once corrected.

Third-party payment scenarios

A payment attempted by someone other than the registered customer.

THIRD_PARTY_NOT_ALLOWED

Email[email protected]
Last nameTestThirdParty
Response200 with status PENDING
Webhookpayment_status → CANCELLED, immediate
Final statusCANCELLED
ReasonTHIRD_PARTY_PAYMENT_NOT_ALLOWED
Markets where this reflects productionBR (PIX), MX (SPEI), AR (Mercado Pago, MODO, Otros Bancos)

What your code should do. Payer is not the registered customer. Rejection arrives by webhook with no delay, so it can land before the merchant's own record is committed. Handle asynchronously and make the handler tolerant of arriving early.

Reading the response

Every scenario in this catalog returns HTTP 200. The HTTP status tells you the request was well-formed and reached the payments engine — it does not tell you the payment succeeded. Read status, and when it is FAILED, read message:

{
  "uid": "a1b2c3d4-...",
  "status": "FAILED",
  "message": "AMOUNT_INVALID"
}

This is the single most common integration mistake we see: treating any 2xx as a successful payment. In the sandbox and in production, a rejected payment is a 200 with status set to FAILED.

The same shape carries every synchronous outcome. message holds AMOUNT_INVALID for FAILED, the CUSTOMER_* code for each identity scenario, and SCENARIO_NOT_MATCHED when the email and last name match no scenario at all.

Two fields that are not what they look like

There are two amounts, and they mean different things. billing is what you charged the customer. The root amount and currency are the settlement figure — what PayRetailers settles to you, in your settlement currency:

{
  "amount": 17689,
  "currency": "USD",
  "billing": { "currency": "BRL", "amount": 100000 }
}

BRL 1,000.00 charged, USD 176.89 settled. Reconcile customer-facing records against billing, and your own receivables against the root. Reading the root as the transaction amount is the mistake to avoid — it will not match what the customer paid.

form is only populated on the create response. For methods that redirect the customer, form.action and form.method come back on the POST and are null on any later GET. Capture them when you get them — polling will not give them back.

Synchronous rejections are not stored

A synchronously-rejected payment creates no transaction. The uid in the response exists for correlation — use it in your own logs and when you talk to our support team — but there is nothing to retrieve later: no record to fetch, nothing to reconcile against, and no webhook.

So persist the attempt on your side at the moment you receive the response. If your reconciliation process expects to re-read failed attempts from us, it will find nothing. This matches production: a payment rejected before it is created is not a payment.

This is not the same as a validation error

A malformed request never reaches scenario resolution. It fails schema validation first and returns 400 with a different envelope:

{
  "errors": [
    {
      "errorCode": "...",
      "errorMessage": "...",
      "reference": null,
      "externalReference": null
    }
  ],
  "status": false
}

Two different shapes for two different situations, and your code needs to handle both:

HTTPShapeMeaning
Scenario outcome200status + messageThe request was valid; this is the payment result
Validation error400errors[] + status: falseThe request itself was rejected — a missing field, an invalid amount, a method not enabled for your shop

If you get 400 with errors[] while testing a scenario, the problem is in your request, not in the scenario. Fix the request and send it again.

And a third case: 503

A 503 is neither of the above. It means the sandbox itself is temporarily unavailable — nothing to do with your request, your credentials or the payment method you sent. Retry.

Worth handling explicitly in an automated suite: treat 503 as an infrastructure failure to retry, not as a test failure. Otherwise a maintenance window looks like a regression in your integration.

Before you build handling for these

The Markets line on each scenario is the authoritative list of where that outcome reflects real production behaviour.

The sandbox does not enforce it. Send IDENTITY_SUSPENDED with a Kenyan payment method and you will get CUSTOMER_SUSPENDED — an outcome production cannot produce in Kenya, because the registry status it represents does not exist there. Build handling for the scenarios listed for your markets; treat the rest as sandbox artefacts.

Full breakdown in Production realism by country.

Next


Did this page help you?