Guides
Classic Pix (QR Code deposit)
Create the charge, show the QR Code to the player, receive the Invoice notification and handle refunds and closed loop 2.0.
A classic deposit is a Pix charge with a dynamic QR Code: your app creates the deposit, shows the QR (or the copy-and-paste code) to the player, the player pays at their bank and Okto notifies the operator's depositUrl. Classic deposit ids have 16 digits.
1. Create the deposit
curl --request POST \
--url https://okto.mimicr.dev/transactions/deposit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Ana Ribeiro",
"taxId": "604.184.437-34",
"amount": 2500,
"externalId": "pedido-1001",
"tags": ["Operator-3005376515"]
}'{
"id": "1268321722477579",
"name": "Ana Ribeiro",
"taxId": "604.184.437-34",
"amount": 2500,
"status": "created",
"expiration": 10800,
"created": "2026-10-21T19:08:59.710000+00:00",
"due": "2026-10-21T19:13:59.710000+00:00",
"link": "https://okto.mimicr.dev/invoicelink/1268321722477579",
"brcode": "00020101021226640014br.gov.bcb.pix2542qrcode.okto.mimicr.dev/v2/1268321722477579...",
"tags": ["Operator-3005376515"],
"externalId": "pedido-1001"
}Validation rules:
| Field | Rule | Error |
|---|---|---|
name | Required | 2009 |
taxId | Valid CPF (masked or not) | 2001 |
amount | Integer in cents, up to 25000000 (R$ 250,000.00) | 2003, 2018 |
externalId | Optional, URL-safe, up to 100 characters, unique among the day's deposits | 2010, 1001 |
expiration | Seconds, default 10800 | 1000 |
tags | List of strings (at most 5 are kept) | 1000 |
See Create a deposit.
2. Show the QR Code
brcode is the copy-and-paste code. link (and pdf) opens a page with the QR and the code. For the image, use Get the QR Code:
format | Response |
|---|---|
base64 (default) | Base64 PNG, text/plain |
png | image/png image |
payload | The BR Code as text |
size (1 to 250, default 8) sets the image scale.
curl --url 'https://okto.mimicr.dev/transactions/qrcode/1268321722477579?format=payload' \ --header 'Authorization: Bearer <token>'
3. The player pays
Nobody pays on their own in the sandbox. Play the player on the simulated bank page (the "Pagar no banco simulado" link on the link page), in the console or through the control API:
npx mimicr action okto player.step step=deposit:pay id=1268321722477579 npx mimicr wait okto delivery transaction_id=1268321722477579 event=paid
To leave it unpaid, use step=deposit:expire. The payment outcome follows the test CPFs: a rejected CPF ends failed with the matching code (for example 2014 for a minor).
Statuses
| Status | When |
|---|---|
created | Just created, awaiting payment |
overdue | 5 minutes after creation (due), still payable |
expired | expiration seconds after due, unpaid |
paid | Paid |
failed | Payment refused by validation (KYC, mismatching account) |
reviewing | Closed loop 2.0: money received, awaiting your decision |
reversing, reversed | Refund in progress and done |
Every change to paid, failed, expired, reviewing or reversed sends a notification to the depositUrl:
{
"Invoice": {
"id": "1268321722477579",
"externalId": "pedido-1001",
"amount": 2500,
"originalAmount": 2500,
"status": "paid",
"tags": ["Operator-3005376515"],
"errorList": [],
"transactionInfo": { "name": "Ana Ribeiro", "taxId": "604.184.437-34", "endToEndId": "E00416968202610211909LPudyxudL08" }
}
}See Notifications. To check without waiting, use Get transaction status with type: "deposit" and id or externalId.
In Mimicr, the 5-minute window before overdue is the simulator's own choice. Move the clock to test expiry without waiting: npx mimicr clock okto +4h.
Refund
Only paid deposits paid today (Brasília date) can be refunded with Refund a deposit. The response comes back with status: "reversing"; the deposit becomes reversed, gains transactionInfo.refundEndToEndId and the reversed notification is sent. Otherwise the answer is 400 with 2040.
curl --request PUT \ --url https://okto.mimicr.dev/transactions/deposit/1268321722477579/refund \ --header 'Authorization: Bearer <token>'
Closed loop 2.0
With "isClosedLoop": true on the deposit, the payment isn't credited right away: the deposit goes to reviewing (closedLoopStatus: "WAITING") and waits for your decision.
- Accept a deposit:
paid,closedLoopStatus: "ACCEPTED", response{"id": "…", "message": "Closed loop accepted successfully"}. - Reject a deposit:
reversed,closedLoopStatus: "REFUNDED", the money goes back to the payer.
Outside reviewing, both answer 400 with 1000.
Next steps
- Withdrawals: spend the balance that came in.
- Queries and pagination:
GET /transactionswith filters. - Errors: every code.