# Create Order

### Call frequency limit <a href="#id-1-call-frequency-limit" id="id-1-call-frequency-limit"></a>

> **Rate Limit: 10 requests per 2 seconds**​

1. Url:

```
https://{host}/api/v2/accountExchange
```

2\. Request parameter instance

<table><thead><tr><th width="159.6666259765625">parameter</th><th width="202.666748046875">whether </th><th> explain</th></tr></thead><tbody><tr><td>depositCoinCode</td><td>Yes</td><td>eg：ETH<br>When this field has values, fromChainId and fromTokenAddress do not need to be filled in</td></tr><tr><td>fromChainId</td><td>When there are values for 'fromChainId' and 'fromTokenAddress', there is no need to fill in 'depositCoinCode'</td><td>eg：1<br>Fill in the chain ID here。</td></tr><tr><td>fromTokenAddress</td><td>When there are values for 'fromChainId' and 'fromTokenAddress', there is no need to fill in 'depositCoinCode'</td><td><p>eg：0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee。<br></p><p>Please fill in the currency contract address here. If it is the main currency of the chain, please fill in '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'</p></td></tr><tr><td>receiveCoinCode</td><td>Yes</td><td>eg：BTC<br>When this field has values,'toChainId' and 'toTokenAddress' do not need to be filled in</td></tr><tr><td>toChainId</td><td>When there are values for 'toChainId' and 'toTokenAddress', there is no need to fill in 'receiveCoinCode'</td><td>eg: 56<br>Fill in the chain ID here。</td></tr><tr><td>toTokenAddress</td><td>When there are values for 'toChainId' and 'toTokenAddress', there is no need to fill in 'receiveCoinCode'</td><td>eg: 0x55d398326f99059ff775485246999027b3197955<br><br>Please fill in the currency contract address here. If it is the main currency of the chain, please fill in '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'</td></tr><tr><td>depositCoinAmt</td><td>Yes</td><td>eg：0.01</td></tr><tr><td>receiveCoinAmr</td><td>Yes</td><td>Expected acceptance</td></tr><tr><td>destinationAddr</td><td>Yes</td><td>"Eg: 18orDLFMp3fGoy5Uk93LDGTGbxWEm7b7FY If there are memos, please separate them with # after placing them in the address, for example: 18orDLFMp3fGoy5Uk93LDGTGbxWEm7b7FY # 1927632"</td></tr><tr><td>refundAddr</td><td>Yes</td><td>"Eg: 18orDLFMp3fGoy5Uk93LDGTGbxWEm7b7FY If there are memos, please tell them to put them in the address and separate them with #, for example: 18orDLFMp3fGoy5Uk93LDGTGbxWEm7b7FY # 1927632"</td></tr><tr><td>equipmentNo</td><td>Yes</td><td>Device Unique ID (Serial Number). If unavailable, please fill in the coin refund address. This field is required when querying order status or order history, and must correspond to the current query.</td></tr><tr><td>sourceType</td><td>Yes</td><td>Enter only ANDROID, IOS, or H5, depending on your application. This field is utilized in the query order status and query order records interfaces.</td></tr><tr><td>sourceFlag</td><td>Yes</td><td>It is used to identify which platform created the order. It needs to be set through negotiation with us</td></tr><tr><td>slippage</td><td>No</td><td>slippage (System default is 0.05)<br>Decimal number<br>0.01 = 1%</td></tr><tr><td>fixedRate</td><td>No</td><td>Place order using fixed exchange rate (the received quantity will not change after placing the order) (Y/N)</td></tr></tbody></table>

3\. Example of request parameters

```
{
    "depositCoinCode": "ETHF",
    "receiveCoinCode": "USDT(BSC)",
    "depositCoinAmt": "42.207403",
    "receiveCoinAmt": "46.367529",
    "destinationAddr": "0x19b9918f...f85ad08ba0",
    "refundAddr": "0x19b9918f...f85ad08ba0",
    "equipmentNo":"zfgryh918f93a19fdg6918a68cf5",
    "sourceType": "H5",
    "sourceFlag":"widget",
    "slippage": "0.02",
    "fixedRate": "N"
}
or
{
    "fromChainId": 513100,
    "fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
    "toChainId": 56,
    "toTokenAddress": "0x55d398326f99059ff775485246999027b3197955",
    "depositCoinAmt": "42.207403",
    "receiveCoinAmt": "46.367529",
    "destinationAddr": "0x19b9918f...f85ad08ba0",
    "refundAddr": "0x19b9918f...f85ad08ba0",
    "equipmentNo":"zfgryh918f93a19fdg6918a68cf5",
    "sourceType": "H5",
    "sourceFlag":"widget",
    "slippage": "0.02",
    "fixedRate": "N"
}
```

4.Example of returned results

```
{
    "data": {
        "chainFee": "0.001",
        "createTime": "2022-03-10 18:44:21",
        "dealFinishTime": null,
        "depositCoinAmt": "2",
        "depositCoinCode": "ETH",
        "depositCoinFeeAmt": "0.004",
        "depositCoinFeeRate": "0.002",
        "depositCoinState": "wait_send",
        "depositFeeRate": "0.002",
        "depositTxid": "",
        "destinationAddr": "0xAE93FA34f728855cE663cf9FcF8e32148F079071",
        "detailState": "wait_deposit_send",
        "instantRate": "6.856554564172",
        "kycUrl": "",
        "orderId": "f94e631b-d99b-4dd5-98f7-09bf99d16d94",
        "orderState": "wait_deposits",
        "platformAddr": "0x3181af4f7cc7251a6a4eda75526c8abe10106db8",
        "receiveCoinAmt": "13.713109",
        "receiveCoinCode": "BNB(BSC)",
        "receiveSwftAmt": "2416.89",
        "refundAddr": "0xAE93FA34f728855cE663cf9FcF8e32148F079071",
        "refundCoinAmt": "",
        "refundDepositTxid": "",
        "refundSwftAmt": "",
        "swftCoinFeeRate": "0.001",
        "swftCoinState": "",
        "swftReceiveAddr": "",
        "swftRefundAddr": "",
        "transactionId": "",
    },
    "resCode": "800",
    "resMsg": "success",
    "resMsgEn": ""
}
```

5.Return Parameter Description

| Field Name         | field              | data type | remarks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------ | ------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| cinsorderId        | orderId            | String    | eg：d47e8b9b-c17f-432b-9285-a46c0a3ceb9a                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| depositCoinCode    | depositCoinCode    | String    | eg: ETH                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| receiveCoinCode    | receiveCoinCode    | String    | Biteg：BTC                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| depositCoinAmt     | depositCoinAmt     | String    | eg：1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| receiveCoinAmt     | receiveCoinAmt     | String    | eg：0.1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| platformAddr       | platformAddr       | String    | eg：123123123-232-1231232                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| destinationAddr    | destinationAddr    | String    | "Eg: 18orDLFMp3fGoy5Uk93LDGTGbxWEm7b7FY. If there are memos, please put them in the address and separate them with #, for example: 18orDLFMp3fGoy5Uk93LDGTGbxWEm7b7FY # 1927632"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| refundAddr         | refundAddr         | String    | "Eg: 18orDLFMp3fGoy5Uk93LDGTGbxWEm7b7FY If there are memos, please separate them with # after placing them in the address, for example: 18orDLFMp3fGoy5Uk93LDGTGbxWEm7b7FY # 1927632"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| depositCoinFeeRate | depositCoinFeeRate | String    | Eg: Handling rate                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| depositCoinFeeAmt  | depositCoinFeeAmt  | String    | Eg: The amount of original currency charged for handling charges                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| refundCoinAmt      | refundCoinAmt      | String    | eg:0.98                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| transactionId      | transactionId      | String    | On chain transaction ID, this field will have a value only after the exchange is completed and the currency has been issued                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| refundDepositTxid  | refundDepositTxid  | String    | On chain transaction ID, this field will have a value only after the currency has been returned in case of exchange failure                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| detailState        | detailState        | String    | (1)wait\_ deposit\_ Send: waiting for the deposit to be sent (2) timeout: timeout; (3)wait\_ exchange\_ Push: wait for the exchange information to be pushed; (4)wait\_ exchange\_ Return: Wait for the exchange information to return; (5.1)wait\_ receive\_ Send: Wait for sending the received currency, wait\_ receive\_ Confirm: wait for confirmation of the received currency, receive\_ Complete: Confirm receipt currency (5.2)wait\_ refund\_ Send: Wait for sending the returned original currency, wait\_ refund\_ Confirm: wait for confirmation of returning original currency, refresh\_ Complete: Confirm the return of original currency; (6) ERROR/error: Processing order (7) WAIT\_ KYC: Wait for KYC or contact customer service to provide a link“ |
| kycUrl             | kycUrl             | String    | <p>The reply time is 311 hours. Please leave a message.</p><p><https://swap.swftcoin.com/swft-v3/swft-v3-m/kyc/kyc.html?lang=cn&#x26;equipmentNo=pls_input_your_real_equipmentno_ok></p><p>New equipment manual number (reference), Lang language: CN, EN</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

### **Request Parameter Precautions** <a href="#id-3-request-parameter-precautions" id="id-3-request-parameter-precautions"></a>

| Parameter      | Explanation                                                                                                                                                                                                                                                                                                                                                                       |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| depositCoinAmt | After users create an order, must send depositCoinAmt to the order address.                                                                                                                                                                                                                                                                                                       |
| receiveCoinAmt | `receiveCoinAmt = depositCoinAmt * instantRate` the rate is obtained through the getBaseInfo port, this value is used to record the market price when the order is submitted, precision is maintained to 6 decimal places                                                                                                                                                         |
| equipmentNo    | Environment number, this can be used to check numbers associted with all of the order's information, please do not disclose                                                                                                                                                                                                                                                       |
| sourceFlag     | Used to indicate which platform's order, the paramater isn't necesary the same sources originally indicated after the project's product comes online                                                                                                                                                                                                                              |
| developerId    | Used to record the project's related order data, the project can use this paramater to express what the order is part of a particular user or is used to record its own system's order number, or another record number serial number; after the order is created, the parameter value will be returned (SWFT does not support checking order information through this paramater) |

​

#### 6.​Postman example

![](https://2491477457-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LUhiTwwiqGj9wzsGZ49%2Fuploads%2F3hmAmWnVP9GHOTi4ZDgL%2FcreateOrder.png?alt=media\&token=d01e6279-950b-4720-9e96-57b4fa1c9d0f)
