Guides
Notifications

Notifications

Where each notification goes, the shape of the bodies, the headers and the retries.

When an operation changes status because of something your application doesn't control (the player paid, the bank refused, a deadline passed), Mimicr makes a POST with JSON to the URL the operator set for that product, as Okto does.

Set the URLs

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",
    "automaticDepositUrl": "https://sua-app.dev/webhooks/okto/automatic",
    "biometricDepositUrl": "https://sua-app.dev/webhooks/okto/biometric",
    "pixDirectPaymentUrl": "https://sua-app.dev/webhooks/okto/direct",
    "faceMatchUrl": "https://sua-app.dev/webhooks/okto/face-match",
    "kycUrl": "https://sua-app.dev/webhooks/okto/kyc",
    "payAndPlayV2DepositUrl": "https://sua-app.dev/webhooks/okto/pay-and-play",
    "notificationToken": "meu-token-de-notificacao"
  }'

Only the fields you send change; null or "" clears a URL. pixDirectPaymentUrl is saved and returned as directDepositUrl. Remove notification URLs clears every URL and the notificationToken.

Which URL receives what

URLBody rootStatuses announced
depositUrlInvoice (classic Pix)paid, failed, expired, reviewing, reversed
depositUrlpixByKeyDeposit (Pix by Key)paid, failed, reviewing, reversed
withdrawUrlTransfersuccess, failed
automaticDepositUrlAutomaticRecurrenceAuthorizationAUTHORIZED, REJECTED, CANCELLED, FAILED, EXPIRED
automaticDepositUrlAutomaticPixDepositPaymentpaid, failed
biometricDepositUrlBiometricEnrollmentenrolled, revoked
biometricDepositUrlBiometricDepositPaymentpaid, failed
biometricDepositUrlBiometricDepositJourneypaid, failed, expired
directDepositUrlDirectDepositPaymentpaid, failed
payAndPlayV2DepositUrlPayAndPlayDepositJourneypaid, failed, expired
faceMatchUrlFaceMatchJourneysuccess, rejected, failed, expired
kycUrlthe lookup result, no rootAPPROVED, REPROVED

Smart PIX sends no notifications: poll Get journey status. Each journey guide describes its bodies in detail.

Example

json
{
  "Transfer": {
    "id": "1486334408408923",
    "externalId": "saque-2001",
    "amount": 1500,
    "originalAmount": 1500,
    "status": "success",
    "tags": [],
    "errorList": [],
    "transactionInfo": {
      "name": "Bruno Matos",
      "taxId": "617.750.603-81",
      "bankInfo": { "name": "ITAÚ UNIBANCO S.A.", "spiCode": "60701190", "strCode": "341", "displayName": "ITAÚ" },
      "branchCode": "1",
      "endToEndId": "E60701190202610211909RAUd8SQphH8",
      "accountType": "checking",
      "accountNumber": "6177506031"
    }
  }
}

A KYC lookup arrives at kycUrl like this:

json
{
  "id": "dc4e6e65-4dc1-48bd-a50e-177e04f195ff",
  "cpf": "60418443734",
  "status": "APPROVED",
  "addresses": {
    "statusCode": "01",
    "data": {
      "addresses": [
        {
          "street": "Rua Haddock Lobo",
          "number": "55",
          "complement": "",
          "neighborhood": "Cerqueira César",
          "city": "São Paulo",
          "state": "SP",
          "zipCode": "01414-001",
          "country": "BR",
          "completeAddress": "Rua Haddock Lobo, 55, Cerqueira César, São Paulo - SP, 01414-001"
        }
      ]
    }
  },
  "errorList": []
}

Headers

HeaderValue
Content-Typeapplication/json
Gaming-Operator-TokenThe operator's notificationToken or, if there is none, the access token
X-Payload-SignatureRSA signature of the body, base64. See Verify the signature

Response and retries

Answer 2xx within 10 seconds. Any other status, a network error or a timeout counts as a failure, and Mimicr tries again with the same body and the same signature:

AttemptWhen
1Right away
21 minute later
35 minutes later
415 minutes later
51 hour later
63 hours later

Okto doesn't publish its interval; this table is Mimicr's. Redirects are not followed. If the product's URL isn't set, the notification is recorded as skipped and not sent; setting the URL later doesn't resend old ones, but you can resend any of them through the control API.

The same notification can arrive more than once (retries, manual resend or the webhookDuplicateRate chaos). Use id and status to process each change only once.

Inspect and resend

bash
curl --url 'https://api.mimicr.dev/v1/okto/deliveries?transaction_id=1268321722477579' \
  --header 'Authorization: Bearer mk_...'

Each delivery carries kind, event, url, status (pending, success, failed or skipped), attempts, your application's last response, signature and body. POST /v1/okto/deliveries/{id}/resend makes a new attempt right away. To get a sample notification without touching the balance:

bash
npx mimicr action okto notification.test kind=deposit

See Sandbox control.