Guides
Journeys

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

bash
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"]
  }'
json
{
  "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:

FieldRuleError
nameRequired2009
taxIdValid CPF (masked or not)2001
amountInteger in cents, up to 25000000 (R$ 250,000.00)2003, 2018
externalIdOptional, URL-safe, up to 100 characters, unique among the day's deposits2010, 1001
expirationSeconds, default 108001000
tagsList 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:

formatResponse
base64 (default)Base64 PNG, text/plain
pngimage/png image
payloadThe BR Code as text

size (1 to 250, default 8) sets the image scale.

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

bash
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

StatusWhen
createdJust created, awaiting payment
overdue5 minutes after creation (due), still payable
expiredexpiration seconds after due, unpaid
paidPaid
failedPayment refused by validation (KYC, mismatching account)
reviewingClosed loop 2.0: money received, awaiting your decision
reversing, reversedRefund in progress and done

Every change to paid, failed, expired, reviewing or reversed sends a notification to the depositUrl:

json
{
  "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.

bash
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