Guides
Journeys

Pix Direct (Open Finance)

The player picks their bank, approves the payment through Open Finance and comes back to your app; you receive the DirectDepositPayment notification.

In Pix Direct (Pix by approximation, through Open Finance) the player picks their bank on your screen, is taken to the bank to approve the payment and comes back to your app. There's no QR Code or copy-and-paste code. Notifications go to the directDepositUrl (on PUT /operator, the pixDirectPaymentUrl field is accepted too).

1. List the participants

List participants returns the sandbox banks with id, name, logo, bankCode and outage. They are the same as in Biometric Pix: Banco Mimicr, Nubank, Itaú Unibanco, Banco Inter and Banco Fora do Ar (5439f937-165c-4213-ac50-b10ebe6cb9f9, which answers 4133).

2. Create the payment

bash
curl --request POST \
  --url https://okto.mimicr.dev/direct/deposit/payment \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "taxId": "604.184.437-34",
    "name": "Ana Ribeiro",
    "amount": 5000,
    "participantId": "126bfc62-9c16-4688-ad7d-efff52e96f3a",
    "callbackUrl": "https://sua-app.dev/pix-direct/ok",
    "onErrorCallbackUrl": "https://sua-app.dev/pix-direct/erro"
  }'
json
{
  "id": "5b88109a-d95d-46d5-8b17-52f77afffdba",
  "name": "Ana Ribeiro",
  "taxId": "604.184.437-34",
  "amount": 5000,
  "url": "https://okto.mimicr.dev/mimicr/direct/5b88109a-d95d-46d5-8b17-52f77afffdba",
  "status": "created",
  "externalId": "209586b3-146f-4cd6-a70e-49b57ff9caea",
  "participantId": "126bfc62-9c16-4688-ad7d-efff52e96f3a"
}

taxId (2001), name (2009), amount (2003) and participantId (4442, 4412, 4133) are required. externalId is optional (generated when omitted). See Create a payment.

3. The player approves at the bank

Redirect the player to the url. In the sandbox it's a hosted page with "Aprovar pagamento no banco" (approve) and "Recusar" (refuse). After the decision the player comes back:

  • Approved: callbackUrl?state=<id>&ticket=<…>.
  • Refused: onErrorCallbackUrl?state=<id>&error=access_denied.

Without return URLs, the page shows the outcome. Through the control API:

bash
npx mimicr action okto player.step step=direct:approve id=5b88109a-d95d-46d5-8b17-52f77afffdba
npx mimicr wait okto delivery transaction_id=5b88109a-d95d-46d5-8b17-52f77afffdba event=paid
OutcomeStatusCode
Approvedpaid—
Refused (direct:reject)failed4448
No decision within 5 minutesfailed4447
Payer rejected by the test CPFs or by chaosfailedthe CPF's or chaos code

When paid, transactionInfo.bankInfo carries the chosen bank.

In Mimicr, the consent window is 5 minutes. Move the clock to test the expiry: npx mimicr clock okto +6m.

4. Confirm with the status or the notification

json
{
  "DirectDepositPayment": {
    "id": "5b88109a-d95d-46d5-8b17-52f77afffdba",
    "externalId": "209586b3-146f-4cd6-a70e-49b57ff9caea",
    "participantId": "126bfc62-9c16-4688-ad7d-efff52e96f3a",
    "amount": 5000,
    "status": "paid",
    "tags": [],
    "errorList": [],
    "transactionInfo": { "name": "Ana Ribeiro", "taxId": "604.184.437-34", "bankInfo": { "name": "Nubank", "spiCode": "18236120" } }
  }
}

Don't rely on the redirect alone: confirm with Get payment status or the notification. List payments returns a page with directParticipantId on each item; see Queries and pagination.