πŸ’¬Order Notifications

To receive order notifications. Configure a callback URL either per-order through responseUrl or at the merchant level via the Swapped Dashboardarrow-up-right.

Callback URL Priority

  1. responseUrl in the iframe URL (if provided)

  2. Merchant-level webhook in Dashboard (if configured)

  3. No callback (if neither is set)

Important: The callback destination is locked at order creation and cannot be changed afterwards.

circle-exclamation

Verifying Signatures

Validate callbacks using the signature header. Compute an HMAC-SHA256 using your secret key and the raw request body, then compare.

Example with NodeJS:

import crypto from 'crypto';

const secretKey = 'sk_test_key'; // Replace with your secret key
const requestBody = '{ "order_id": "9fcc45a5-4def-4953-9bd8-9ff75d9aaa9c"}'

const signature =
  crypto
    .createHmac('sha256', secretKey)
    .update(requestBody)
    .digest('base64'); 

Both order_broadcasted and order_cancelled are final states. An order cannot transition from completed to cancelled.

Callback Payloads

payment_pending

Order created, awaiting customer payment.

order_completed

Payment successful, crypto purchase processed.

order_broadcasted

Transaction broadcast to blockchain.

order_cancelled

Order cancelled (payment failure, user cancellation, etc.).

Response Fields

Field
Description

order_id

Swapped order ID

order_status

Current order state

order_crypto

Cryptocurrency code

order_crypto_amount

Crypto amount received

order_crypto_address

Destination wallet address

order_crypto_tag

Destination tag/memo (XRP, TON, etc.)

network

Blockchain network used

order_amount_usd

Crypto value in USD (mid-market rate, excludes fees)

order_amount_usd_plus_fees

USD amount including platform fee

order_amount_eur

Crypto value in EUR

order_amount_eur_plus_fees

EUR amount including platform fee

transaction_id

Blockchain transaction hash (broadcasted orders only)

external_customer_id

Your customer ID (if provided in URL)

Last updated