Trade Webhooks

Stay in sync with the status of all executed trades.

Bitnob emits webhook events when a trade completes or fails. These events allow your system to respond to state changes in real time — updating user balances, marking orders as settled, or triggering downstream workflows.

Events

Event TypeDescription
trade.completedA USDTBTC trade has been executed and settled successfully.
trade.failedA trade request failed due to quote expiry, insufficient balance, or system error.

Webhook: trade.completed

Sample Payload
trade.completed Payload
Payload Fields
FieldDescription
eventAlways trade.completed
tradeIdUnique ID of the executed trade.
referenceYour internal reference ID for the trade.
fromSource asset (usdt or bitcoin).
toDestination asset.
inputAmountAmount that was converted (in cents or sats).
outputAmountAmount received (in sats or cents).
rateExecuted exchange rate.
walletIdBitnob wallet that received the output.
statusAlways completed.
timestampISO 8601 timestamp when the trade completed.

Webhook: trade.failed

Sample Payload
trade.failed Payload
Payload Fields
FieldDescription
eventAlways trade.failed.
referenceYour original reference ID.
fromSource asset of attempted trade.
toTarget asset.
inputAmountRequested trade amount.
reasonReason for failure (e.g., Quote expired, Insufficient balance).
statusAlways failed.
timestampTime of failure in ISO format.

Security & Verification

All webhook events:

Are delivered via HTTPS POST requests

Include an X-Bitnob-Signature header (HMAC SHA-256)

Can be verified using your webhook secret (see Tooling > HMAC Generator)

Best Practices

Match reference in the payload with your internal ledger or transaction object

Log all webhook events in a dedicated table or log stream

Make webhook handlers idempotent — you may receive duplicates

Use status, timestamp, and rate to reconcile trade outcomes precisely

Alert internally on trade.failed events above a certain volume threshold

Did you find this page useful?