Guides
Getting started

Quickstart

Activate the sandbox, get the access token, create a Pix deposit, pay as the player and receive the signed notification.

This guide takes a few minutes: you activate the simulator, set the notification URL, create a deposit, pay the QR Code in the player's place and wait for the Invoice notification with status paid.

Prerequisites

  • A Mimicr organization and a write API key (mk_…), created in the organization settings, "Chaves de API" tab.
  • curl, or any HTTP client, and Node 18+ if you want to use the CLI.
  • A public HTTPS URL to receive notifications (optional, but needed in step 3).

1. Activate the Okto sandbox

In the console, open the organization at https://app.mimicr.dev, go to Okto and activate it. Or through the control API:

bash
curl --request POST \
  --url https://api.mimicr.dev/v1/okto/activate \
  --header 'Authorization: Bearer mk_...'

Each organization has one Okto sandbox, which plays the role of an operator. If it is already active, the call answers 409 okto_already_active.

2. Get the access token

bash
curl --url https://api.mimicr.dev/v1/okto \
  --header 'Authorization: Bearer mk_...'
json
{
  "active": true,
  "host": "https://okto.mimicr.dev",
  "access_token": "okto_sbx_...",
  "notification_token": null,
  "urls": {},
  "public_key": "-----BEGIN PUBLIC KEY-----\n...",
  "balance": { "total": 200000, "pending": 0, "available": 200000, "previous": 200000 },
  "clock": { "now": "2026-10-21T19:08:59.710Z", "offset_ms": 0 }
}

Send access_token as Authorization: Bearer <token> on every call to https://okto.mimicr.dev. There is no token endpoint: see Authentication. The sandbox starts with a balance of R$ 2,000.00. With the CLI: npx mimicr login mk_... once, then npx mimicr status okto.

3. Set the notification URL

bash
curl --request PUT \
  --url https://okto.mimicr.dev/operator \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "depositUrl": "https://sua-app.dev/webhooks/okto/deposit",
    "withdrawUrl": "https://sua-app.dev/webhooks/okto/withdraw",
    "notificationToken": "meu-token-de-notificacao"
  }'

The response returns the operator with the saved URLs. Each product has its own URL; see Notifications and Update notification URLs.

4. Create a 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,
  "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...",
  "externalId": "pedido-1001"
}

Amounts are in cents (2500 = R$ 25.00). Show the player the brcode (copy and paste) or the QR from Get the QR Code.

5. Pay as the player

Open https://okto.mimicr.dev/mimicr/deposit/1268321722477579 and click "Pagar com Pix" (the link page also leads there). Or, in an automated test:

bash
npx mimicr action okto player.step step=deposit:pay id=1268321722477579
json
{
  "ok": true,
  "action": "player.step",
  "message": "Depósito Pix (QR Code): paid",
  "data": { "success": true }
}

The deposit becomes paid and Mimicr sends the notification to depositUrl.

6. Wait for the notification

bash
npx mimicr wait okto delivery transaction_id=1268321722477579 event=paid

The body delivered to your application is:

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",
      "bankInfo": { "displayName": "INTER", "name": "BANCO INTER S.A.", "spiCode": "00416968", "strCode": "077" },
      "branchCode": "1",
      "accountNumber": "6041844371",
      "accountType": "checking"
    }
  }
}

Verify the X-Payload-Signature header before crediting the player: see Verify the signature. To check from the operator side, use Get transaction status with the externalId.

Next steps