Guides
Getting started

Sandbox testing

Test payers, the Pay Out amount table, validation triggers, the homologation switch and controlled chaos.

The GO 2.0 documentation has no test data and no way to simulate payments. Everything on this page is a Mimicr rule, designed so you can reach each outcome Pay4Fun documents.

Opening balances

AccountOpening balance
transactionalR$ 10,000.00
ownerR$ 500.00

Paid deposits go into transactional; payments and refunds come out of it; fees come out of owner. A sandbox reset goes back to the opening balances.

Test payers (Pay In)

Deposits are not paid on their own. The payer pays on the hosted checkout (the intent's url), on the ITP page or through the deposit.pay action with one of these payers:

payerName and CPFBankOutcome
ana (default)Ana Souza, 12345678909Bradesco, CC accountApproved: Success webhook, intent Released
brunoBruno Lima, 52998224725Nubank, IP accountFails screening (FAILED, DEP-114) when the intent asks for postValidations: Screening; without screening, pays normally
carlaCarla Mendes, 11144477735Itaú, CC accountHer bank refuses over a limit: Rejected webhook with error AM02
daviDavi Rocha, 39053344705Inter, POUPANCA accountPays normally, with another CPF: use it to test Payer, rejectDifferentPayer and ITP

The action also takes document and name to pay with any CPF/CNPJ (Bradesco bank, approved outcome). With Pix-ITP, only the holder of data.document pays; without payer or document, that holder pays (the test payer with the same CPF, if there is one).

Pay In triggers

You sendOutcome
Payer pre-validation with CPF 52998224725422 DEP-110 on creation; the intent is DECLINED with DEP-111 in validation-errors
Payer pre-validation and another payerFAILED webhook, DEP-112
rejectDifferentPayer: true on Pix-QrDynamic, a Payer pre-validation and another payerRejected webhook, error DIFFERENT_PAYER
AccountOrigin pre-validation without the payer's bank/accountFAILED webhook, DEP-113
postValidations: [{"type": "Screening"}] and payer brunoFAILED webhook, DEP-114
Pix-QrDynamic not paid before expiration (default 300 s)Expiry webhook, intent Expired
Method turned off in /configurations/api/v1/deposit-methods400 DEP-041
Amount outside minDepositLimit and maxDepositLimit400 DEP-042
A paid deposit that takes the day's total over the transactional account's daily DEPOSIT limit (R$ 100,000.00)FAILED webhook, DEP-115 in validation-errors
Inactive currency (COP, PEN) or one without a quote (ARS)400 DEP-043

Pay Out amount table

Payments move on their own: validation ~1 s after creation, sending to the SPI (PendingPSP) and settlement ~3 s later (Completed, Released webhook). The cents of the BRL amount decide the outcome:

AmountOutcome
R$ x.11Error, Declined webhook with AC03 "Conta do recebedor inexistente ou inválida"
R$ x.12Recoverable failure AB03 (SPI timeout): PendingRetry, a new attempt ~3 s later and Completed
R$ x.13Error, Declined webhook with RR04 "Pagamento recusado por questões regulatórias"
Anything elseCompleted, Released webhook

Pay Out validation triggers

These are asynchronous: creation answers 201 queued and the refusal shows up in Validation errors, with a Declined webhook.

SituationCode
Method turned off in /configurations/api/v1/payment-methodsVAL-020
Amount outside minPaymentLimit and maxPaymentLimitVAL-021
The day's total goes over the transactional account's daily PAYMENT limit (R$ 50,000.00)VAL-022
Pix-Session with no paid session deposit for that documentVAL-023
Receiver pre-validation with another documentVAL-024
AccountDestination pre-validation with the receiver's bankVAL-025
Not enough available balanceAM04 in withdraw-errors; with onFailRetry: true, PendingRetry and up to 3 more attempts, 1 minute apart

Homologation switch

autoProcessPayments (on by default) makes payments settle on their own. Off, they stop at PendingPSP until you run payment.settle or payment.decline. Validation stays automatic.

bash
curl --request PUT \
  --url https://api.mimicr.dev/v1/pay4fun/homolog \
  --header 'Authorization: Bearer mk_...' \
  --header 'Content-Type: application/json' \
  --data '{ "autoProcessPayments": false }'

Controlled chaos

To test resilience, turn on failures per area: deposit, payment or account.

bash
curl --request PUT \
  --url https://api.mimicr.dev/v1/pay4fun/chaos/payment \
  --header 'Authorization: Bearer mk_...' \
  --header 'Content-Type: application/json' \
  --data '{ "enabled": true, "apiErrorRate": 20, "apiErrorStatus": 503, "opsFailRate": 10, "opsFailCode": "AM04", "webhookFailRate": 30 }'
  • API errors answer 500, 503 or 429 with {"title": ..., "status": ...}, before or after processing.
  • opsFailCode in deposit: Rejected or FAILED. In payment: AC03, AM04, AB03 or RR04, with the same semantics as the other sources. AC03 and RR04 decline the payment (Error, Declined webhook). AB03 is recoverable: PendingRetry and a new attempt ~3 s later, up to 3 times. AM04 is recoverable only with onFailRetry: true (a new attempt every minute, up to 3); without it, it declines. Chaos is rolled again on each attempt. account only has API errors and latency.
  • webhookFailRate makes the first attempt fail (and the retry kick in); webhookDuplicateRate delivers the notification twice.
  • /auth is not affected by chaos.

Every field is detailed in Sandbox control.