# cancel order

### Endpoint usage

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

The fields with \* are required, and the fields without \* are optional

#### Request Body

| Name                                         | Type   | Description                                                                                       |
| -------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------- |
| orderId<mark style="color:red;">\*</mark>    | String | purchase order Id                                                                                 |
| sourceFlag<mark style="color:red;">\*</mark> | String | Source channel (Both sides need to agree on a name to represent the channel of the third parties) |
| flag<mark style="color:red;">\*</mark>       | String | md5 value                                                                                         |

{% 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 %}

### code example

{% 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 example

<figure><img src="/files/3XBhBpQkorFDdw35BTbU" alt=""><figcaption></figcaption></figure>


---

# 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-tron.en.tronify.io/tron-api/cancel-order.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.
