Create a swap order
create_swapCreate a real swap order and return the deposit address the user has to send funds to. This call moves no money by itself, but the order is real: it exists in support, it can expire, and a fixed rate is locked against it. Quote the swap first, validate the recipient address, and confirm the amount and the address with the user before calling this. If the user has not explicitly approved both, use swap_link instead and let them confirm on the page. The answer names who executes the order, and that has to be relayed: some orders are routed to a partner aggregator rather than ChangeNOW.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Asset the user receives, canonical id, for example "usdt.trx". | |
| from | Yes | Asset the user sends, canonical id, for example "eth.eth". | |
| memo | No | Memo or destination tag for the recipient address, when the asset needs one. | |
| address | Yes | Address that receives the swapped asset. Check it with validate_address first; a wrong network here loses the funds. | |
| rate_id | No | The rate_id from quote_swap with rate_type "fixed". Required for a fixed rate order, and it expires after about ten minutes. | |
| amount_to | No | Amount the user wants to receive. Requires rate_id from quote_swap. | |
| promo_code | No | Promo code to apply, if the user has one. | |
| amount_from | No | Amount the user sends. Pass this or amount_to, never both. | |
| refund_memo | No | Memo for the refund address. | |
| contact_email | No | Optional email for status notifications about this order. | |
| refund_address | No | Where the deposit returns if the swap cannot complete. Strongly recommended: without it a failed swap needs support. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| to | Yes | ||
| from | Yes | ||
| status | Yes | ||
| provider | Yes | ||
| warnings | Yes | ||
| amount_to | Yes | ||
| rate_type | Yes | ||
| track_url | Yes | ||
| created_at | Yes | ||
| amount_from | Yes | ||
| refund_memo | Yes | ||
| valid_until | Yes | ||
| payin_address | Yes | ||
| payin_extra_id | Yes | ||
| payout_address | Yes | ||
| refund_address | Yes | ||
| payout_extra_id | Yes |