# 生成订单信息

<mark style="color:green;">`POST`</mark> `https://api.bridgers.xyz/api/exchangeRecord/updateDataAndStatus`

**以下参数带\*字段为必填，不带\*号为选填**

#### Request Body

| Name                                               | Type   | Description                                                               |
| -------------------------------------------------- | ------ | ------------------------------------------------------------------------- |
| equipmentNo<mark style="color:red;">\*</mark>      | String | 设备号设备号（该字段将作为用户的唯一标识，三方可通过自己的方式获得，如fromAddress的前32位字符，或者32位随机数字与字母结合的字符串） |
| sourceFlag<mark style="color:red;">\*</mark>       | String | 渠道来源（需要双方约定一个名称来代表三方的渠道）                                                  |
| hash<mark style="color:red;">\*</mark>             | String | 交易哈希                                                                      |
| sourceType                                         | String | 设备类型（H5/IOS/Android 该字段为选填，如通过直接通过API调用，可为空)                              |
| fromTokenAddress<mark style="color:red;">\*</mark> | String | 出售币种合约地址（可通过获取币种列表中的address字段获得）                                          |
| toTokenAddress<mark style="color:red;">\*</mark>   | String | 获得币种合约地址（可通过获取币种列表中的address字段获得）                                          |
| fromAddress<mark style="color:red;">\*</mark>      | String | 用户地址                                                                      |
| toAddress<mark style="color:red;">\*</mark>        | String | 接受地址                                                                      |
| fromTokenChain<mark style="color:red;">\*</mark>   | String | 出售币种链（可通过获取币种列表中的chain字段获得，详细支持链的情况可查看【基本说明】）                             |
| toTokenChain<mark style="color:red;">\*</mark>     | String | 获得币种链（可通过获取币种列表中的chain字段获得，详细支持链的情况可查看【基本说明】）                             |
| fromTokenAmount<mark style="color:red;">\*</mark>  | String | 出售币种数量(带精度，可通过询价接口里的fromTokenAmount字段获得)                                  |
| amountOutMin<mark style="color:red;">\*</mark>     | String | 预期得到币种数量(带精度，可通过询价接口里的amountOutMin字段获得)                                   |
| fromCoinCode<mark style="color:red;">\*</mark>     | String | 出售代币名称 (可通过获取币种列表中的symbol字段获得）                                            |
| toCoinCode<mark style="color:red;">\*</mark>       | String | 获得代币名称  (可通过获取币种列表中的symbol字段获得）                                           |
| slippage                                           | String | 滑点，例如：0.1（代表10%）最低接收数量 = amountOutMin \* (1 - slippage)                   |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
 "resCode":100,
 "resMsg":"success",
 "data":{
  "orderId":"..." // 订单号orderId
  }
}
```

{% endtab %}
{% endtabs %}

### 调用示例

{% tabs %}
{% tab title="JavaScript" %}

```
// example
//You can get the order number through the swap interface
const params = {
  hash: '0x05920386bc07d71b58109fab0ab591c5e07d7b15f7a8d77c692fd735048d9dba', //  User sends token hash
  fromTokenAddress: '0x55d398326f99059ff775485246999027b3197955',
  toTokenAddress: '0xa71edc38d189767582c38a3145b5873052c3e47a',
  fromAddress:"0x19...",
  toAddress:"0x19...",
  fromTokenChain:"HECO",
  toTokenChain:"HECO",
  fromTokenAmount: "3293000000000000000",
  amountOutMin:"28891153244504185000",
  fromCoinCode:"HT(HECO)",
  toCoinCode:"USDT(HECO)",
  sourceFlag:"widget",
  sourceType:"H5"
}
const res = await axios.post('https://api.bridgers.xyz/api/exchangeRecord/updateDataAndStatus',params)
console.log(res)
```

{% endtab %}
{% endtabs %}

### Postman 示例

![](/files/LhTlRE7XkAFxJm4tRGm9)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-bridgers.bridgers.xyz/bridgers-api-jie-kou/generate-order-information.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
