Guides
Journeys

Withdrawals (DICT key and manual)

Pay the player by Pix key or bank details, follow the duplicate and balance rules and receive the Transfer notification.

There are two ways to pay a player: by Pix key (Create a withdrawal by key) or with the bank account (Create a manual withdrawal). Both come out of the operator balance, answer only {externalId, status, created} and report the outcome to the withdrawUrl.

Withdrawal by key

bash
curl --request POST \
  --url https://okto.mimicr.dev/transactions/withdraw \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "dictKey": "617.750.603-81",
    "externalId": "saque-2001",
    "amount": 1500
  }'
json
{
  "externalId": "saque-2001",
  "status": "created",
  "created": "2026-10-21T19:09:05.467000+00:00"
}

Keep the externalId: it's how you look the withdrawal up with Get transaction status (type: "withdraw").

Key types

dictKeyExampletaxId
CPF617.750.603-81Optional; the key itself is the CPF
E-mailana@exemplo.com.brRequired (2001 without it)
E.164 phone+5511988887777Required (2001 without it)
Random (EVP)8695ed70-4a64-4eeb-8787-d0badafdc7d5Optional
CNPJ44.783.669/0001-72Accepted on creation, but the withdrawal ends failed with 2002

A key in any other format answers 400 with 2002.

Manual withdrawal

bash
curl --request POST \
  --url https://okto.mimicr.dev/transactions/withdraw/manual \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Ana Ribeiro",
    "taxId": "604.184.437-34",
    "externalId": "saque-3001",
    "amount": 1000,
    "bankAccount": {
      "bankCode": "18236120",
      "branchCode": "1",
      "accountType": "checking",
      "accountNumber": "12345678"
    }
  }'

bankAccount follows these rules, all with error 2022:

FieldRule
bankCodeBank ISPB, up to 8 digits
accountNumberUp to 20 digits
accountTypeRequired: checking, salary, savings or payment
branchCodeUp to 4 digits; required except for payment accounts

name (2009) and a taxId with a valid CPF (2001) are required too.

Common rules

RuleError
externalId required, URL-safe, up to 100 characters2010
externalId already used by another withdrawal (any date)1001
Same amount to the same receiver today, with another withdrawal not failed1001
amount integer in cents, above zero, up to 250000002003, 2018
amount above the available balance2050

Undecided withdrawals are reserved: they leave the availableBalance of Get balance (v2) until they finish.

The receiving bank decides

The withdrawal is processed without the player: in the sandbox it stays created for 15 seconds and then settles on its own, success or failed according to the test CPFs, CNPJ keys (2002), the mismatching account 6349462035540000 (2021) and chaos. To force an outcome before that, play the receiving bank in the console or through the control API:

bash
npx mimicr action okto player.step step=withdraw:credit id=<id>
npx mimicr action okto player.step step=withdraw:fail id=<id>
npx mimicr wait okto delivery transaction_id=<id> event=success

The id is the withdrawal's 16-digit id; find it with List transactions filtering by externalId. withdraw:fail ends with 2006 (receiving bank error). withdraw:credit settles right away, with the same rules as the automatic processing.

StatusWhen
createdAccepted, awaiting the receiving bank (up to 15 seconds)
successCredited; transactionInfo carries the endToEndId
failedRefused; errorList carries the code

The notification goes to the withdrawUrl:

json
{
  "Transfer": {
    "id": "1486334408408923",
    "externalId": "saque-2001",
    "amount": 1500,
    "originalAmount": 1500,
    "status": "success",
    "tags": [],
    "errorList": []
  }
}

In Mimicr, the 15-second delay is the simulator's. To test a failure with a regular CPF, use withdraw:fail before the withdrawal settles.

See also Notifications and Errors.