Order Notifications
To receive order notifications you must set a valid Webhook URL on the βDevelopersβ page within the Swapped.com Dashboard. You will receive the notification on the provided URL. In the header of the HTTP request, thereβs a signature to make sure the data comes from Swapped.
Order notifications are sent to the Webhook URL you specify. These notifications inform you of the status of each order. Below are the types of notifications you can receive.
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.
For more information on notification resending, see Order Notification Retry Policy. In the event of a missed order notification, you can resend the most recent notification directly from the Swapped.com Dashboard transaction page. This functionality is available to users with the roles of Admin, User, or Developer.
Responses
Payment Pending:
Indicates that the transaction has been created but the customer hasn't completed payment.
Order Cancelled:
Indicates that the order is cancelled for any reason, such as payment failure, or user cancellation.
Order Completed:
Indicates that the order has been processed, and the cryptocurrency purchase was successful.
Order Broadcasted:
Indicates that the cryptocurrency transaction has been broadcasted to the blockchain.
Response Definition:
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
: Theorder_crypto_amount
converted to USD (Mid-market rates without spread). This does not include the platform fee.order_amount_usd_plus_fees
: Theorder_amount_usd
plus the platform fee.network
: The network used to send transactions via.
The signature:
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.
Example with NodeJS:
Last updated