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
| Scenario | Resolves | HTTP | Final status | Error code | Webhook |
|---|---|---|---|---|---|
APPROVED | by webhook | 200 | APPROVED | — | +5s → APPROVED |
FAILED | synchronously | 200 | FAILED | AMOUNT_INVALID | — |
CANCELLED | by webhook | 200 | CANCELLED | — | +5s → CANCELLED |
PENDING | never resolves | 200 | PENDING | — | — |
IDENTITY_INVALID_AGE | synchronously | 200 | FAILED | CUSTOMER_INVALID_AGE | — |
IDENTITY_NOT_ALIVE | synchronously | 200 | FAILED | CUSTOMER_NOT_ALIVE | — |
IDENTITY_INTL_LIST | synchronously | 200 | FAILED | CUSTOMER_IN_INTL_LIST | — |
IDENTITY_INVALID_ID | synchronously | 200 | FAILED | CUSTOMER_INVALID_ID | — |
IDENTITY_SUSPENDED | synchronously | 200 | FAILED | CUSTOMER_SUSPENDED | — |
IDENTITY_INVALID_STATUS | synchronously | 200 | FAILED | CUSTOMER_INVALID_STATUS | — |
IDENTITY_NOT_FOUND | synchronously | 200 | FAILED | CUSTOMER_NOT_FOUND | — |
THIRD_PARTY_NOT_ALLOWED | by webhook | 200 | CANCELLED | THIRD_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 protected] | |
| Last name | TestApproved |
| Response | 200 with status PENDING |
| Webhook | payment_status → APPROVED, +5s |
| Final status | APPROVED |
| Markets where this reflects production | All 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 protected] | |
| Last name | TestFailed |
| Response | 200 with status FAILED — final, resolved synchronously |
| Reason | AMOUNT_INVALID in message |
| Webhook | none |
| Markets where this reflects production | All 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 protected] | |
| Last name | TestCancelled |
| Response | 200 with status PENDING |
| Webhook | payment_status → CANCELLED, +5s |
| Final status | CANCELLED |
| Reason | CANCELLED |
| Markets where this reflects production | All 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 protected] | |
| Last name | TestPending |
| Response | 200 with status PENDING |
| Webhook | none — the payment stays in its initial state |
| Final status | PENDING |
| Markets where this reflects production | All 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 protected] | |
| Last name | TestInvalidAge |
| Response | 200 with status FAILED — final, resolved synchronously |
| Reason | CUSTOMER_INVALID_AGE in message |
| Webhook | none |
| Markets where this reflects production | BR, 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 protected] | |
| Last name | TestNotAlive |
| Response | 200 with status FAILED — final, resolved synchronously |
| Reason | CUSTOMER_NOT_ALIVE in message |
| Webhook | none |
| Markets where this reflects production | BR, 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 protected] | |
| Last name | TestIntlList |
| Response | 200 with status FAILED — final, resolved synchronously |
| Reason | CUSTOMER_IN_INTL_LIST in message |
| Webhook | none |
| Markets where this reflects production | BR, 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 protected] | |
| Last name | TestInvalidId |
| Response | 200 with status FAILED — final, resolved synchronously |
| Reason | CUSTOMER_INVALID_ID in message |
| Webhook | none |
| Markets where this reflects production | BR, 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 protected] | |
| Last name | TestSuspended |
| Response | 200 with status FAILED — final, resolved synchronously |
| Reason | CUSTOMER_SUSPENDED in message |
| Webhook | none |
| Markets where this reflects production | BR |
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 protected] | |
| Last name | TestInvalidStatus |
| Response | 200 with status FAILED — final, resolved synchronously |
| Reason | CUSTOMER_INVALID_STATUS in message |
| Webhook | none |
| Markets where this reflects production | BR |
What your code should do. Registry status does not permit payments. Not retryable. Handle as for CUSTOMER_SUSPENDED.
IDENTITY_NOT_FOUND
[email protected] | |
| Last name | TestNotFound |
| Response | 200 with status FAILED — final, resolved synchronously |
| Reason | CUSTOMER_NOT_FOUND in message |
| Webhook | none |
| Markets where this reflects production | AR |
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 protected] | |
| Last name | TestThirdParty |
| Response | 200 with status PENDING |
| Webhook | payment_status → CANCELLED, immediate |
| Final status | CANCELLED |
| Reason | THIRD_PARTY_PAYMENT_NOT_ALLOWED |
| Markets where this reflects production | BR (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:
| HTTP | Shape | Meaning | |
|---|---|---|---|
| Scenario outcome | 200 | status + message | The request was valid; this is the payment result |
| Validation error | 400 | errors[] + status: false | The 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
Updated about 8 hours ago