> For the complete documentation index, see [llms.txt](https://docs-tron.tronify.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-tron.tronify.io/tron-api/cancel-order.md).

# 取消买单

### 接口调用

<mark style="color:green;">`POST`</mark> `https://open.tronify.io/api/tronRent/cancelOrder`

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

#### Request Body

| Name                                         | Type   | Description              |
| -------------------------------------------- | ------ | ------------------------ |
| orderId<mark style="color:red;">\*</mark>    | String | 买单id                     |
| sourceFlag<mark style="color:red;">\*</mark> | String | 渠道来源（需要双方约定一个名称来代表三方的渠道） |
| flag<mark style="color:red;">\*</mark>       | String | md5值                     |

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

```javascript
{
    "resCode": 100,
    "resMsg": "Success",
    "data": {
        "flag": "098AB187330265CD4EC4126E1F0661C6",
        "orderId": "2ombu8zk_3jet_0mle_g7id_2mi3gnl6fk4y",
        "sourceFlag": "tronLink"
    }
}
```

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

### 调用示例

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

```
// example
const params = {
    orderId: 'mt1wxcl1_dplo_r0qp_5bho_w5an5hev6d70',
    flag: 'the value after md5',
    sourceFlag: 'tronLink'
}
 const res = await axios.post('https://open.tronify.io/api/tronRent/cancelOrder',params)
 console.log(res)
 if(res.resCode === '100'){
   //...  
 }
```

{% endtab %}
{% endtabs %}

### Postman 示例

<figure><img src="/files/vYvS5NVTl4teT28Hb14H" alt=""><figcaption></figcaption></figure>
