API Reference
Transactions and notifications

Create notification preference

POST/api/v1/customer/{customerId}/notification/preference
Base URL: https://bloquo.mimicr.dev · provider: https://api.bloquo.io

Registers a webhook URL to receive notifications for a specific combination of notificationType and orderType.

Supported orderType values and coverage: - Deposit, deposit order status changes (including Refund events share the same schema). - Withdrawal, withdrawal order status changes. - Trade, trade order status changes (automatic and manual trades). - Refund, deposit refund events (same payload schema as Deposit). - FxPayment, FX payment order status changes. - Compliance, counterparty KYT compliance check results.

A customer must have an active preference for each orderType they want to receive. Events without a matching preference are silently dropped: no error is returned and no retry is scheduled.

URL precedence per orderType: - Deposit / Withdrawal: the webhookUrl field in the original order request takes priority. If absent, this preference URL is used. If neither is present, the notification is rejected.

  • FxPayment, only this preference URL is used. No webhookUrl is accepted in the FxPayment request.
  • Trade, no URL check is enforced: the service proceeds regardless. - Compliance, the URL is set directly by the compliance service, not from this preference.

Delivery policy: any 2xx response from your endpoint = success. Any other response (non-2xx, timeout, connection error) is treated as failure and triggers retry with exponential backoff, base ~2 min, doubling each attempt, up to 10 attempts (~13h total). After 10 failures the notification reaches Failed status. Manual resend is available via POST /api/v1/customer/{customerId}/notification/order/{id}/resend.

Notification lifecycle: Pending → Processing → Completed or Processing → WaitingForRetry (loops up to 10 times) → Failed.

Signature verification: every outgoing webhook includes the header X-Bloquo-Signature: t=<unix_ts>,v1=<base64 RSA-SHA256>. The signed string is "{t}.{raw_json_body}" (timestamp concatenated with the raw request body). To verify: 1. Fetch the public key once from GET /api/v1/notification/webhook/public-key. 2. Rebuild the signed string: "{t}.{raw_json_body}". 3. Verify the RSA-PKCS1v15 signature (SHA-256) against the public key. 4. Reject the event if t is more than 5 minutes in the past (replay protection).

Best practices: - Respond 2xx immediately and process the payload asynchronously to avoid timeouts. - Deduplicate events using orderId + orderType + status as a composite key - retries may deliver the same event more than once.

  • Always verify the X-Bloquo-Signature header before processing. - Monitor stalled notifications via GET /notification/order?status=Failed.

Authorization

Bearer token in the Authorization: Bearer <token> header. See Authentication.

Path parameters

customerIdinteger<int64>required

Body

application/json
notificationTypestringrequired

Must be Webhook for order notifications. Only Webhook delivery is currently supported for Deposit, Withdrawal, Trade, and FxPayment events.

WebhookEmailWhatsappTelegram
orderTypestringrequired

Type of order that triggered the notification.

TradeWithdrawalDepositRefundComplianceFxPayment
webhookUrlstringrequired

URL that will receive the notification payload.

Example: "https://api.acme.com/webhooks/bloquo"

Responses

200Notification preference created.
statusboolean
Example: true
resultobject

A notification preference defines the webhook URL (and optionally email) where notifications of a specific type and order type should be delivered.

Show child attributes
idinteger<int64>
Example: 1
customerIdinteger<int64>
Example: 42
webhookUrlstring
Example: "https://api.acme.com/webhooks/bloquo"
emailstring | null

Optional email address for email-type notifications.

notificationTypestring

Channel through which the notification is sent. For order notifications (Deposit, Withdrawal, Trade, FxPayment), only Webhook is supported, delivery always posts the payload to the configured webhook URL. Email is supported for Compliance notifications only. Whatsapp and Telegram are internal operational channels, not available for customer preferences.

WebhookEmailWhatsappTelegram
orderTypestring

Type of order that triggered the notification.

TradeWithdrawalDepositRefundComplianceFxPayment
isEnabledboolean
Example: true
createdBystring
Example: "admin"
lastUpdatedBystring
Example: "admin"
createdAtstring<date-time>
Example: "2024-01-15T10:30:00Z"
lastUpdatedAtstring<date-time>
Example: "2024-01-15T10:30:00Z"
messageany | null
400Failed to create notification preference.
statusboolean
resultany | null
messagestring