# 查询交易详情

### 接口调用

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

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

#### Request Body

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| orderId<mark style="color:red;">\*</mark> | String | 订单号         |

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

```javascript
{
    "resCode":100,
    "resMsg":"success",
    "data":{
        "id":283,
        "orderId":"kydjhyt5_rec8_tfdi_s67b_td5kpu8qezy0",  // 订单号
        "fromTokenAddress":"0xa71edc38d189767582c38a3145b5873052c3e47a", // 出售币种的合约地址
        "toTokenAddress":"0x382bb369d343125bfb2117af9c149795c6c65c50",  //  目标币种的合约地址
        "fromTokenAmount":"5",   // 出售币种数量
        "toTokenAmount":"3.99",  // 目标币种预计得到数量
        "fromAddress":"0x19...",  // 用户出售币种的地址
        "slippage":"",  // 滑点
        "fromChain":"HECO",  // 出售币种的链
        "toChain":"OKEXCHAIN",  // 目标币种的链
        "hash":"0x505c3b4ebecb3f9......f171f6f00daa1a",   // 存币hash
        "depositHashExplore":"https://hecoinfo.com/tx/0x505c3b4ebecb3f95e2d51d140c732be7ac6b57119ff2a08908f171f6f00daa1a", // 存币区块浏览器地址
        "dexName":"",
        "status":"receive_complete",  // 订单状态
        "createTime":"2022-01-25 14:24:35", // 订单创建时间 
        "source":"Bridgers1",  // 渠道
        "toAddress":"0x19...",   // 目标地址
        "toHash":"0xf4575d8e99......200a5bb",    // 发币hash
        "receiveHashExplore":"https://www.oklink.com/oec/tx/0xf4575d8e99474319bbc8f5a849ac8821ace868bc3d4ca93723f2c5ead200a5bb", // 发币区块浏览器地址
        "equipmentNo":"0x19b......", // 设备号
        "refundCoinAmt":"",  // 退币数量
        "refundHash":"",   // 退币hash
        "refundHashExplore":"",   //  退币区块浏览器地址
        "refundReason": "1", //（1-流动性不足、2-误差超过阈值、3-原币维护、4-黑名单、5-目标币维护、6-兑换数量不在范围内、7-存币超时、8-与风险地址交互）
        "fromCoinCode":"USDT(HECO)",  // 出售币种
        "toCoinCode":"USDT(OKExChain)"   // 目标币种
    }
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

### 调用示例

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

```
// example
const params = {
 orderId: '', //order number
}
 const res = await axios.post('https://api.bridgers.xyz/api/exchangeRecord/getTransDataById',params)
 console.log(res)
```

{% endtab %}
{% endtabs %}

### Postman 示例

![](https://2788010628-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbvHxRlkSqGfe4qMOuqzl%2Fuploads%2FZu9pWMixxG8KGF6tCPTp%2F6.jpg?alt=media\&token=eaf47963-e368-4405-b523-5f3be23eeec5)

#### 字段status订单状态解析

wait\_deposit\_send: '等待存币',

wait\_deposit\_send\_fail: '存币失败',

wait\_exchange\_push: '正在兑换中...',&#x20;

wait\_exchange\_return: '正在兑换中...',

wait\_exchange\_return\_success: '正在兑换中...',

wait\_receive\_send: '兑换完成，等待发币',&#x20;

wait\_enough\_send:'正在发币中...'

wait\_receive\_confirm: '发币确认中...',&#x20;

receive\_complete: '发币完成',

wait\_refund\_send: '等待退币',&#x20;

wait\_refund\_confirm: '退币确认中...',&#x20;

refund\_complete: '退币完成',

timeout: '兑换超时',

ERROR: '正在兑换中...',

wait\_for\_information:'请联系客服'
