Guides
Beneficiaries
Register a beneficiary with a payment instruction, track the review to APPROVED and upload the custody attestation when asked.
Beneficiaries are the destinations of your withdrawals. You register the entity (person or company) together with a payment instruction: Pix key, bank account or crypto wallet. The beneficiary itself has no status; each instruction is reviewed on its own and only APPROVED instructions can receive a withdrawal.
1. Register the beneficiary and its first instruction
curl --request POST \
--url https://trace.mimicr.dev/v1/beneficiaries \
--header 'Authorization: Bearer <token>' \
--header 'X-Idempotency-Key: <uuid>' \
--header 'Content-Type: application/json' \
--data '{
"entity": {
"type": "INDIVIDUAL",
"firstName": "Maria",
"lastName": "Souza",
"identificationDocument": { "value": "52998224725", "type": "CPF" },
"birthDate": "1985-03-15",
"address": {
"addressLine1": "Av. Paulista, 1000",
"addressLine2": "Apto 42",
"city": "São Paulo",
"state": "SP",
"postalCode": "01310-100",
"country": "BR"
}
},
"relationshipType": "THIRD_PARTY",
"paymentInstruction": {
"rail": "PIX_KEY",
"asset": "BRL",
"dictKeyType": "EMAIL",
"dictKey": "maria@example.com"
}
}'The response is 201 with the beneficiary and the instruction in PENDING_REVIEW:
{
"id": "e28a6582-8286-4b62-9eab-7f53c071dc35",
"relationshipType": "THIRD_PARTY",
"paymentInstructions": [
{
"id": "c716fbcb-92ce-417c-8e8a-f0b309f79a71",
"asset": "BRL",
"currentState": { "status": "PENDING_REVIEW", "createdAt": "2026-11-05T20:11:44Z" },
"address": { "rail": "PIX_KEY", "dictKey": "maria@example.com", "dictKeyType": "EMAIL" },
"custodyDetail": null,
"documents": [],
"requirements": { "currentlyDue": [], "pendingVerification": [], "errors": [], "satisfied": [] }
}
]
}BENEFICIARY_INSTRUCTION_CREATED fires right away.
| Field | Notes |
|---|---|
entity.type | INDIVIDUAL (with firstName, lastName, birthDate) or COMPANY (with legalName and optional tradeName) |
entity.identificationDocument | CPF or CNPJ for Brazilians; PASSPORT requires country |
relationshipType | SELF_OWNED or THIRD_PARTY |
paymentInstruction with PIX_KEY | dictKeyType, dictKey, asset |
paymentInstruction with PIX_BANK_INSTRUCTION | bankCode, branch, accountNumber, asset; the response shows bank{code, name, ispbCode} |
paymentInstruction with CRYPTO | network, address, asset and optional custodyDetail |
Validation errors on this endpoint answer 422 INVALID_DATA (not 400). Missing rail keys answer 422 MISSING_PAYMENT_INSTRUCTION_DETAILS with details.missingKeys. Reference: Create a beneficiary.
2. Track the review
About 2 seconds later the review settles with BENEFICIARY_INSTRUCTION_APPROVED or BENEFICIARY_INSTRUCTION_REJECTED. The webhook payload is the beneficiary plus an instruction field with the affected instruction. Without webhooks, poll:
curl --url https://trace.mimicr.dev/v1/beneficiaries/<beneficiary-id> \ --header 'Authorization: Bearer <token>'
REJECTED is terminal, with the reason in currentState.reason. To retry, register another instruction, or another beneficiary if the entity was wrong. The rejection triggers are in Testing in the sandbox.
3. Upload the custody attestation (crypto instructions)
A CRYPTO instruction with a valid address (0x + 40 hex on the ETHEREUM network) moves to ACTION_REQUIRED and fires BENEFICIARY_INSTRUCTION_ACTION_REQUIRED, with:
"requirements": {
"currentlyDue": [
{ "type": "BENEFICIARY_DOCUMENT", "documentType": "CUSTODY_ATTESTATION", "anyOf": ["CUSTODY_ATTESTATION"] }
]
}The DOCUMENT_REQUIRED reason and the moment of the request are Mimicr's choices. Wait to be asked, then upload the document with the instruction as holder:
curl --request POST \
--url https://trace.mimicr.dev/v1/beneficiaries/<beneficiary-id>/documents \
--header 'Authorization: Bearer <token>' \
--header 'X-Idempotency-Key: <uuid>' \
--form 'body={"documentType":"CUSTODY_ATTESTATION","holder":{"type":"PAYMENT_INSTRUCTION","referenceId":"<payment-instruction-id>"}};type=application/json' \
--form 'file=@custody-attestation.pdf'The response is 204. The requirement moves to pendingVerification, the document shows up in documents[] with a version, the instruction returns to PENDING_REVIEW and, about 2 seconds later, becomes APPROVED. Uploading the same type again keeps the referenceId and bumps version.
| Error | When |
|---|---|
409 BENEFICIARY_ANALYSIS_NOT_READY | Upload before compliance asks |
422 DOCUMENT_NOT_APPLICABLE | The instruction is not CRYPTO |
A file with reject in its name rejects the instruction. Reference: Upload a beneficiary document.
In Mimicr, withdrawals only accept PIX_KEY and PIX_BANK_INSTRUCTION instructions. An approved CRYPTO instruction answers 422 INVALID_RAIL on a withdrawal, as in the API slice Trace publishes.
4. Add more instructions
curl --request POST \
--url https://trace.mimicr.dev/v1/beneficiaries/<beneficiary-id>/payment-instructions \
--header 'Authorization: Bearer <token>' \
--header 'X-Idempotency-Key: <uuid>' \
--header 'Content-Type: application/json' \
--data '{
"rail": "PIX_KEY",
"asset": "BRL",
"dictKeyType": "CPF",
"dictKey": "52998224725"
}'The response is 201 with the full beneficiary. Later instructions only go through the instrument check, so the entity triggers (CPF, name, country) do not apply to them.
References: Add a payment instruction, Remove a payment instruction, List beneficiaries (with instructionCount), Delete a beneficiary (also removes its instructions).
Test the other side
Put no-auto in entity.address.addressLine2, or turn autoReviewInstructions off, and decide:
curl --request POST \
--url https://api.mimicr.dev/v1/trace/actions/instruction.approve \
--header 'Authorization: Bearer mk_...' \
--header 'Content-Type: application/json' \
--data '{ "instructionId": "<payment-instruction-id>" }'| Action | Effect |
|---|---|
instruction.approve | APPROVED, BENEFICIARY_INSTRUCTION_APPROVED |
instruction.reject | REJECTED with COMPLIANCE_REJECTED (optional message) |
instruction.require_document | Asks (again) for the attestation of a CRYPTO instruction |
To wait for the outcome: npx mimicr wait trace delivery event=BENEFICIARY_INSTRUCTION_APPROVED ref=<beneficiary-id> (the ref of beneficiary deliveries is the beneficiary id).