Order Notifications
Last updated
Last updated
To receive order notifications, you can either provide a responseUrl per order or define a merchant-level webhook on the βDevelopersβ page within the . You will receive the notification via the provided URL. In the header of the HTTP request, thereβs a signature to validate the data comes from Swapped.com.
The callback destination is determined at the time of order creation and cannot be modified afterwards.
The system follows this priority:
If an order-level responseURL is provided during order creation, it will be used for all callbacks for that order.
If no order-level responseURL exists, the system will use the merchant-level webhook URL configured in the dashboard.
If neither exists at order creation, no callbacks will be sent for that order.
The system follows a clear priority structure for determining where to send callbacks.
If a responseURL is provided in the iframe initialization URL, this will be used as a priority.
If a responseURL is not provided, but a callback URL is configured via the , this will be used.
If neither responseURL nor callback URL is set, callbacks will be disabled for this order.
This configuration is locked in when the order is created and cannot be changed, even if you later update your merchant level webhook settings.
Order notifications can be resent to account for network errors. As such you must validate that a transaction has not been credited before crediting for it.
Indicates that the transaction has been created but the customer hasn't completed payment.
Indicates that the order is cancelled for any reason, such as payment failure, or user cancellation.
Indicates that the order has been processed, and the cryptocurrency purchase was successful.
Indicates that the cryptocurrency transaction has been broadcasted to the blockchain.
order_id
: The order id on Swapped.com.
order_crypto_amount
: The exact cryptocurrency amount you will receive.
order_crypto
: The cryptocurrency you receive.
order_status
: The current status of the order.
order_crypto_address
: The cryptocurrency address where you receive the cryptocurrency.
external_customer_id
: Your customer's ID (If provided in the URL).
order_amount_usd
: The order_crypto_amount
converted to USD (Mid-market rates without spread). This does not include the platform fee.
order_amount_usd_plus_fees
: The order_amount_usd
plus the platform fee.
network
: The network used to send transactions via.
An order can follow one of two possible state flows:
Flow 1, this is applied when an order gets completed successfully and the user receives crypto:
payment_pending
β order_completed
β order_broadcasted
Flow 2, this occurs when an order gets cancelled for any reason and the user does not receive crypto:
payment_pending
β order_cancelled
Both order_broadcasted
and order_cancelled
are final states that correspond to a finalized swapped.com order ID. This means that an order will never go from a completed to a cancelled state.
Compute an HMAC with a SHA-256 hash function. Use your secret API key as the key and use the request body as the message. Compare this to the signature sent in the request header.
For more information on notification resending, see the .