# 创建订单

### **1. 接口调用：（限速规则：10次/2s）**

&#x20;`https://{host}/open/api/simpleExchange`

### **2. 请求参数**

| 字段名称   | 字段              | 数据类型   | 数据长度 | 必输项 | 备注                                                                                                 |
| ------ | --------------- | ------ | ---- | --- | -------------------------------------------------------------------------------------------------- |
| 存币币种   | depositCoinCode | String | 30   | Y   | eg：ETH                                                                                             |
| 接收币币种  | receiveCoinCode | String | 30   | Y   | eg：BTC                                                                                             |
| 存币数量   | depositCoinAmt  | String | 50   | Y   | eg：0.01                                                                                            |
| 项目方订单号 | developerId     | String | 50   | N   | 用于记录项目方的订单关联数据，项目方可用该字段来表示该订单归属于自己的某个用户或用于记录自己系统内的订单编号，或其他编号；在订单创建完成后，会回传该字段值（SWFT不支持通过该字段查询寻订单信息） |

### 3.请求参数示例

```yaml
{
	"channelId":"zml-test",
	"depositCoinAmt":"0.01",
	"depositCoinCode":"ETH",
	"developerId":"zml-11111",
	"receiveCoinCOde":"SWFTC",
	"sign":"1A87D09169495065A4DDDB794510C4C0B6AA7C39FACB62406BA5703FC207831F",
	"timestamp":1557661583167
}
```

### 4.Postman示例

![](https://content.gitbook.com/content/CZbt3X4wpzSYqsOt0CQF/blobs/u7Dqfthgdpzi41U9H89Y/cex_createorder.png)

### 5.返回结果示例

```yaml
 {
    "data": {
        "changeType": "simple",
        "choiseFeeType": "4",
        "depositCoinAmt": "0.01",
        "depositCoinCode": "ETH",
        "depositCoinFeeAmt": "",
        "depositCoinFeeRate": "",
        "depositCoinState": "",
        "destinationAddr": "",
        "detailState": "wait_exchange_push",
        "orderId": "e61e20c9-7548-4c81-bdd2-35921510c1b2",
        "orderState": "wait_deposits",
        "platformAddr": "",
        "receiveCoinAmt": "647.854966",
        "receiveCoinCode": "SWFTC",
        "receiveSwftAmt": "0.63",
        "refundAddr": "",
        "refundCoinAmt": "",
        "refundCoinMinerFee": "",
        "refundSwftAmt": "",
        "swftCoinFeeRate": "0.001",
        "swftCoinState": "",
        "swftReceiveAddr": "",
        "developerId": "zml-11111",
        "swftRefundAddr": ""
    },
    "resCode": "800",
    "resMsg": "成功"
}
```

### 6.返回参数说明

| 字段名称     | 字段                 | 数据类型   | 数据长度 | bixu 项 | 备注                                                                                                                                                                                                                                                                                                                                  |
| -------- | ------------------ | ------ | ---- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 订单号      | orderId            | String | 30   | Y      | eg：d47e8b9b-c17f-432b-9285-a46c0a3ceb9a                                                                                                                                                                                                                                                                                             |
| 存币币种     | depositCoinCode    | String | 30   | Y      | eg：ETH                                                                                                                                                                                                                                                                                                                              |
| 接收币币种    | receiveCoinCode    | String | 30   | Y      | eg：BTC                                                                                                                                                                                                                                                                                                                              |
| 存币数量     | depositCoinAmt     | String | 50   | Y      | eg：1                                                                                                                                                                                                                                                                                                                                |
| 接收币数量    | receiveCoinAmt     | String | 50   | Y      | eg：0.1                                                                                                                                                                                                                                                                                                                              |
| 速币数量     | receiveSwftAmt     | String | 50   | Y      | eg：100                                                                                                                                                                                                                                                                                                                              |
| 存币的存放状态  | depositCoinState   | String | 30   | Y      | eg：wait\_send                                                                                                                                                                                                                                                                                                                       |
| 存币地址     | platformAddr       | String | 50   | Y      | eg：123123123-232-1231232                                                                                                                                                                                                                                                                                                            |
| 存币的手续费率  | depositCoinFeeRate | String | 30   | Y      | eg：0.001                                                                                                                                                                                                                                                                                                                            |
| 存币的手续费金额 | depositCoinFeeAmt  | String | 50   | Y      | eg：1                                                                                                                                                                                                                                                                                                                                |
| 速币的手续费率  | swftCoinFeeRate    | String | 30   | Y      | eg：0.0005                                                                                                                                                                                                                                                                                                                           |
| 订单状态     | orderState         | String | 30   | Y      | eg：wait\_deposits                                                                                                                                                                                                                                                                                                                   |
| 速币接收地址   | swftReceiveAddr    | String | 50   | Y      | eg：d47e8b9b-c17f-432b-9285-a46c0a3ceb9a                                                                                                                                                                                                                                                                                             |
| 速币存放状态   | swftCoinState      | String | 30   | Y      | eg：wait\_send                                                                                                                                                                                                                                                                                                                       |
| 退币时的矿工费  | refundCoinMinerFee | String | 50   | Y      | eg: 10                                                                                                                                                                                                                                                                                                                              |
| 退币金额     | refundCoinAmt      | String | 50   | Y      | eg: 0.98                                                                                                                                                                                                                                                                                                                            |
| 退速币金额    | refundSwftAmt      | String | 50   | Y      | eg: 10                                                                                                                                                                                                                                                                                                                              |
| 目标币接收地址  | destinationAddr    | String | 50   | Y      | eg: 18orDLFMp3fGoy5Uk93LDGTGbxWEm7b7FY                                                                                                                                                                                                                                                                                              |
| 退原币的地址   | refundAddr         | String | 50   | Y      | eg: 18orDLFMp3fGoy5Uk93LDGTGbxWEm7b7FY                                                                                                                                                                                                                                                                                              |
| 退手续费的地址  | swftRefundAddr     | String | 50   | Y      | eg: 18orDLFMp3fGoy5Uk93LDGTGbxWEm7b7FY                                                                                                                                                                                                                                                                                              |
| 手续费类型    | choiseFeeType      | String | 50   | Y      | 3-原币模式，4-速币模式                                                                                                                                                                                                                                                                                                                       |
| 详情状态     | detailState        | String | 30   | Y      | <p>(1)wait\_account\_deduct:等待从账户扣款； (2)timeout:超时；</p><p>(3)wait\_exchange\_push:等待交换信息推送； (4)wait\_exchange\_return:等待交换信息返回； (5.1)wait\_receive\_send:等待接收币种发送, wait\_receive\_confirm:等待接收币种确认, receive\_complete:接收币种确认完成. (5.2)wait\_refund\_send:等待退原币币种发送, wait\_refund\_confirm:等待退原币币种确认, refund\_complete:退原币币种确认完成；</p> |
| 兑换方式     | changeType         | String | 20   | Y      | simple：简单兑换、advanced：高级兑换                                                                                                                                                                                                                                                                                                           |
