Guides
Testing in the sandbox
Magic values, triggers and other-side actions to force each compliance and settlement outcome.
By default the simulator follows the happy path: accounts are approved, payment instructions are approved, QR codes are paid and operations settle. To exercise the other paths, use the same magic values as Trace's sandbox or drive the other side through the control API.
Beneficiaries and payment instructions
A new instruction starts in PENDING_REVIEW, fires BENEFICIARY_INSTRUCTION_CREATED and, about 2 seconds later, the review settles. The triggers below apply when the beneficiary is created (the first instruction runs the full entity check; later ones only the instrument check).
| Field | Value | Outcome |
|---|---|---|
entity.address.addressLine2 | contains no-auto | Stays PENDING_REVIEW until you decide |
entity.identificationDocument.value with type: CPF | 12345678909 | REJECTED, "Tax ID owner deceased" |
entity.identificationDocument.value with type: CNPJ | 50676745000143 | REJECTED, "Company deregistered" |
entity.firstName + entity.lastName | John + Doe | REJECTED, "Name match on sanctions list" |
entity.address.country | KP, IR, SY or CU | REJECTED, "Sanctioned country" |
paymentInstruction.dictKey with dictKeyType: EMAIL | reject@sandbox.trace.finance | REJECTED, COMPLIANCE_REJECTED, "An unknown error occurred." |
CRYPTO with an invalid address (not 0x + 40 hex) or a network other than ETHEREUM | any | REJECTED, WALLET_SCREENING_REJECTED |
CRYPTO with a valid address | any | ACTION_REQUIRED, asks for CUSTODY_ATTESTATION |
The COMPLIANCE_REJECTED code on the entity triggers and WALLET_SCREENING_REJECTED are Mimicr's choices; Trace only documents the messages.
Rejected custody attestation
Once the CRYPTO instruction is in ACTION_REQUIRED, upload the attestation with reject in the file name (for example custody-reject.pdf). About 2 seconds later the instruction becomes REJECTED with "Custody attestation rejected". Uploading before compliance asks answers 409 BENEFICIARY_ANALYSIS_NOT_READY. See Beneficiaries.
Decide by hand
With no-auto, or with the autoReviewInstructions toggle off, the instruction waits. Decide from the other side:
npx mimicr action trace instruction.approve instructionId=<instruction-id> npx mimicr action trace instruction.reject instructionId=<instruction-id> message="Key does not belong to the holder" npx mimicr action trace instruction.require_document instructionId=<instruction-id>
Deposits
The deposit amount (sourceAmount) decides what happens to the QR code:
sourceAmount | Outcome |
|---|---|
8.00 | The QR is never paid. The operation stays PROCESSING until the QR expires (24 h of sandbox clock), then FAILED with QR_CODE_EXPIRED |
9.00 | The QR expires right away: FAILED with QR_CODE_EXPIRED, "The PIX dynamic QR code expired before being paid." |
| Anything else | The QR is paid and the operation becomes COMPLETED |
The QR_CODE_EXPIRED code is Mimicr's choice. To avoid waiting 24 hours in the 8.00 case, move the clock (npx mimicr clock trace +1d) or pay by hand (npx mimicr action trace deposit.pay operationId=<id>).
Withdrawals
sourceAmount | Outcome |
|---|---|
.09 cents (for example 500.09 BRL, or 500.090000 USDT) | FAILED with PROCESSING_ERROR, "Transaction processing failed." |
| More than the available balance | FAILED with INSUFFICIENT_BALANCE, "Insufficient balance for the requested operation" |
| Anything else | COMPLETED |
The .09 rule only reads the withdrawal's sourceAmount, so the beneficiary stays approved and reusable. See Withdrawal.
Accounts
Trace documents no triggers for accounts. In Mimicr, an account submitted for review is approved on its own (crypto activates in about 3 s, BRL about 3 s later). For the other paths, turn autoApproveAccounts off and use the actions:
npx mimicr action trace account.reject_requirement accountId=<id> requirement=PROOF_OF_ADDRESS message="Unreadable proof of address" npx mimicr action trace account.fail_asset accountId=<id> asset=BRL npx mimicr action trace account.reject accountId=<id> npx mimicr action trace account.approve accountId=<id>
Operations paused by compliance
To test OPERATION_ACTION_REQUIRED, ask for a document on an operation in PROCESSING. Automatic settlement takes only about 3 seconds, so turn autoSettleOperations off first:
npx mimicr action trace operation.require_document operationId=<id> documentType=FINANCIAL_CAPACITY
The operation moves to ACTION_REQUIRED. Upload the document with Upload an operation document and it goes back to PROCESSING and settles.
Homologation toggles
| Toggle | When off |
|---|---|
autoApproveAccounts | The account stays REVIEWING until account.approve, account.reject_requirement or account.reject |
autoPayDeposits | The QR stays PROCESSING until deposit.pay or deposit.expire |
autoSettleOperations | Withdrawals, swaps, transfers and refunds wait for operation.settle or operation.fail |
autoReviewInstructions | Payment instructions stay PENDING_REVIEW until instruction.approve or instruction.reject |
curl --request PUT \
--url https://api.mimicr.dev/v1/trace/homolog \
--header 'Authorization: Bearer mk_...' \
--header 'Content-Type: application/json' \
--data '{ "autoPayDeposits": false }'Chaos
To test resilience, turn chaos on per area (accounts, operations, beneficiaries): latency, HTTP errors before or after processing, operations failing with PROCESSING_ERROR or INSUFFICIENT_BALANCE, instructions rejected with COMPLIANCE_REJECTED, and webhooks that fail on the first attempt or arrive twice. See Sandbox control.
Related
- Webhooks: how to receive the events these triggers fire.
- Sandbox control: every action and its parameters.