Guides
Getting started

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

FieldValueOutcome
entity.address.addressLine2contains no-autoStays PENDING_REVIEW until you decide
entity.identificationDocument.value with type: CPF12345678909REJECTED, "Tax ID owner deceased"
entity.identificationDocument.value with type: CNPJ50676745000143REJECTED, "Company deregistered"
entity.firstName + entity.lastNameJohn + DoeREJECTED, "Name match on sanctions list"
entity.address.countryKP, IR, SY or CUREJECTED, "Sanctioned country"
paymentInstruction.dictKey with dictKeyType: EMAILreject@sandbox.trace.financeREJECTED, COMPLIANCE_REJECTED, "An unknown error occurred."
CRYPTO with an invalid address (not 0x + 40 hex) or a network other than ETHEREUManyREJECTED, WALLET_SCREENING_REJECTED
CRYPTO with a valid addressanyACTION_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:

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

sourceAmountOutcome
8.00The QR is never paid. The operation stays PROCESSING until the QR expires (24 h of sandbox clock), then FAILED with QR_CODE_EXPIRED
9.00The QR expires right away: FAILED with QR_CODE_EXPIRED, "The PIX dynamic QR code expired before being paid."
Anything elseThe 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

sourceAmountOutcome
.09 cents (for example 500.09 BRL, or 500.090000 USDT)FAILED with PROCESSING_ERROR, "Transaction processing failed."
More than the available balanceFAILED with INSUFFICIENT_BALANCE, "Insufficient balance for the requested operation"
Anything elseCOMPLETED

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:

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

bash
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

ToggleWhen off
autoApproveAccountsThe account stays REVIEWING until account.approve, account.reject_requirement or account.reject
autoPayDepositsThe QR stays PROCESSING until deposit.pay or deposit.expire
autoSettleOperationsWithdrawals, swaps, transfers and refunds wait for operation.settle or operation.fail
autoReviewInstructionsPayment instructions stay PENDING_REVIEW until instruction.approve or instruction.reject
bash
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.