Skip to main content

5. Create order

Place order

此接口用於創建訂單。您可以創建一個最多包含 5 個接收地址的訂單。

POST
/openapi/order/place
請求头
NameTypeRequiredDescription
Ref-Codestringno聯盟計劃的推薦碼;填寫此欄位即可獲得部分利潤。

請求头


{
Ref-Code: "UtZ***P9"
}

請求
NameTypeRequiredDescription
exchange_modestringyes兌換模式(浮動比例 | 固定比例)
from_abbrstringyesCoin name
from_chainstringyesChain name
from_quantityfloatyes數量
calc_idstringnoThe calc_id is valid for 30 seconds
to_addressarrayyesReceiving Address list
to_abbrstringyesReceive coin name
to_addressstringyesReceiving Address
to_chainstringyesReceiving chain name
to_ratiofloatyesThe percentage of received assets out of source assets (0-1) represents 0% - 100%.
If it's a 1-for-1 exchange, this parameter can be left blank and defaults to 1.

請求

{
"exchange_mode": "fixed",
"from_abbr": "ARB",
"from_chain": "Arbitrum",
"from_quantity": 100,
"calc_id": "c294e5e1-7fea-46d4-945f-b2e4aa695e4f"
"to_address": [
{
"to_abbr": "ETH",
"to_address": "************",
"to_chain": "Arbitrum",
"to_ratio": 1
}
]
}
響應
NameTypeDescription
codeint業務狀態碼
dataobject數據對象
addressstring地址
order_nostring訂單編號
query_codestring查詢代碼
msgstring業務消息

示例響應

{
"code": 0,
"msg": "success",
"data": {
"order_no": "XUcQdnSg",
"address": "TXf94kgP9HuVHr1bRLmHaL1hVPbUYipDGh",
"query_code": "3XXNCL8PXZX6",
}
}