Guides
Webhooks
Register URLs per event type and understand payloads, retries and resends.
Bloquo notifies your app with a POST on every relevant change of deposits, withdrawals, refunds, trades, FX payments and counterparty compliance. Each delivery is RSA-signed (X-Bloquo-Signature header) and recorded as a notification order you can query and resend.
Register the URLs
Create one preference per orderType: Deposit, Withdrawal, Refund, Trade, FxPayment or Compliance. Only the Webhook channel delivers orders.
curl -X POST https://bloquo.mimicr.dev/api/v1/customer/1001/notification/preference \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"notificationType": "Webhook", "orderType": "Withdrawal", "webhookUrl": "https://your-service.com/webhooks/bloquo"}'{
"status": true,
"result": {
"id": 1038,
"customerId": 1001,
"webhookUrl": "https://your-service.com/webhooks/bloquo",
"email": null,
"notificationType": "Webhook",
"orderType": "Withdrawal",
"isEnabled": true
},
"message": null
}GET .../notification/preferencelists the preferences (paginated withpageNumber).PUT .../notification/preferencewith{"webhookUrl": "…"}replaces the URL of every enabled preference.PUT .../notification/preference/enabled/falsepauses them all;/enabled/trueresumes.
An orderType outside the list answers 400 OrderType 'Pix' is not valid..
Which URL receives
| orderType | URL used |
|---|---|
Deposit, Withdrawal, Refund | the webhookUrl sent on the order; otherwise the preference |
Trade, FxPayment | the preference only |
Compliance | the customer's Compliance preference |
With no URL, or with the preference disabled, the event is dropped and no notification order is created.
Bloquo says the Compliance URL comes from the compliance service. In Mimicr it is the Compliance preference.
When each event fires
| orderType | Statuses notified |
|---|---|
Deposit | COMPLETED, EXPIRED |
Refund | PROCESSING_REFUND, RETURNED |
Withdrawal | every change: SENT_TO_CONNECTOR or PENDING_TREASURY on creation, PENDING_IN_BANK, COMPLETED, FAILED |
Trade | every change: PROCESSING, WaitingTreasury, COMPLETED, FAILED, REVERTED |
FxPayment | every change: WAITING_FUNDS, PENDING_APPROVAL, WAITING_WITHDRAWAL, COMPLETED, FAILED, REJECTED |
Compliance | the decision on the counterparty relation: Approved or Rejected |
Bloquo doesn't list the statuses that fire trade and FX payment webhooks. In Mimicr, every status change fires one.
Payloads
The body is JSON and varies by orderType. The webhookUrl field holds the URL that received the delivery. Deposit (and refund, with orderType: "REFUND"):
{
"orderId": 1113,
"orderType": "DEPOSIT",
"accountId": 1004,
"customerId": 1001,
"amount": 200,
"requestedAmount": 200,
"feeAmount": 0,
"totalAmount": 200,
"currency": "BRL",
"status": "COMPLETED",
"requestedCounterparty": { "name": null, "taxId": null, "accountKey": null, "bankCode": null, "bankName": null, "bankBranch": null, "accountNumber": null, "bankId": null },
"confirmedCounterparty": { "name": null, "taxId": null, "accountKey": null, "bankCode": null, "bankName": null, "bankBranch": null, "accountNumber": null, "bankId": null },
"bankReference": "E1823612020261105201326CA2A49060",
"finalizedAt": "2026-11-05T20:13:31.277Z",
"failureReason": null,
"e2eId": "E1823612020261105201326CA2A49060",
"webhookUrl": "https://your-service.com/webhooks/bloquo"
}Withdrawal: the same amount fields, plus failureReason, e2eId, walletAddress, blockchain, requestedCounterparty (the receiver) and confirmedCounterparty (filled on COMPLETED), with orderType: "WITHDRAWAL".
Trade:
{
"reason": "Notification",
"entityName": "Trade",
"entityId": "1074",
"operation": "StatusUpdate",
"customerId": 1001,
"orderId": 1074,
"orderType": "Trade",
"accountId": 1007,
"status": "COMPLETED",
"currency": "USD",
"requestedAmount": 100,
"quoteCurrency": "BRL",
"quoteAmount": 522.6,
"price": 5.226,
"side": "Buy",
"expireAt": null,
"webhookUrl": "https://your-service.com/webhooks/bloquo"
}FX payment:
{
"orderId": 1112,
"customerId": 1001,
"counterpartyId": null,
"fundingType": "DepositOrder",
"fundingOwnerType": "Customer",
"fundingOwnerId": 1001,
"fundingCurrency": "BRL",
"fundingAmount": 200,
"depositOrderId": 1113,
"status": "COMPLETED",
"webhookUrl": "https://your-service.com/webhooks/bloquo"
}Compliance:
{
"customerId": 1001,
"entityId": 1084,
"baseChannel": "Webhook",
"toEmail": null,
"notifyTeams": false,
"notifyTelegram": false,
"notifyWebsocket": false,
"status": "Approved",
"counterparty": { "name": "Maria Santos", "taxId": "987.654.321-00", "accountKey": "987.654.321-00", "bankCode": null, "bankName": null, "bankBranch": null, "accountNumber": null, "bankId": null },
"webhookUrl": "https://your-service.com/webhooks/bloquo"
}The payload is fixed: it reflects the order at the moment the notification was created, even on a retry.
Delivery and retries
POSTwithContent-Type: application/jsonandX-Bloquo-Signature: t=<unix>,v1=<signature>. Verify it before processing: Verify the signature.- Any
2xxis a success. Any other status, a connection error or more than 10 seconds without a response is a failure. - After failed attempt n, the next one comes 2 min × 2^(n−1) later: 2, 4, 8, 16, 32, 64, 128, 256, 512 and 1024 minutes.
- There are 11 automatic attempts: the first, immediate one and 10 retries. If none succeeds, the notification becomes
Failed(about 34 hours after the first).
Notification order status: Pending → Processing → Completed, or WaitingForRetry between failures, until Failed.
Bloquo's documentation contradicts itself: the text says "after 10 failed attempts", but the table lists 10 retries (2 to 1024 min) and the Failed status is described as "All 10 retry attempts exhausted". Mimicr follows the table: 1 attempt + 10 retries. The 10-second timeout is Mimicr's.
Query and resend
GET /api/v1/customer/{customerId}/notification/order lists the notification orders with the payload sent and each attempt (success, response, source Automatic or Manual). Filters: accountId, type, orderId, orderType, status; sorting with sortBy (CustomerId, OrderId, AccountId, CreatedAt) and sortOrder. With no results, the response is 204.
curl -X POST https://bloquo.mimicr.dev/api/v1/customer/1001/notification/order/1121/resend \ -H "Authorization: Bearer <token>"
{ "status": true, "result": "Completed", "message": null }The resend makes a manual attempt right away and returns Completed or Failed. A manual attempt that fails leaves the notification Failed, with no further automatic retries.
Good practices
- Answer
2xxfast and process later, from a queue. - Use
orderId+orderType+statusas the idempotency key: the same delivery may arrive more than once. - Monitor
GET .../notification/order?status=Failedand resend whatever was left behind.
Test
npx mimicr wait bloquo delivery order_type=Withdrawal order_id=1057 event=FAILED curl "https://api.mimicr.dev/v1/bloquo/deliveries?order_type=Deposit&status=WaitingForRetry" -H "Authorization: Bearer mk_..." npx mimicr action bloquo notification.resend notificationId=1121 npx mimicr clock bloquo +2h
Advance the clock so due retries run without waiting. To simulate a flaky URL, turn chaos on with webhookFailRate (first attempt fails) and webhookDuplicateRate (duplicate delivery). See Sandbox control.
Reference: Create notification preference, List notification preferences, Update notification webhook URL, Enable or disable notifications, List notification orders, Resend notification, Export notification report.