> 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/query-purchase-order.md).

# 查询买单

### &#x20;接口调用

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

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

#### Request Body

| Name                                         | Type    | Description                                |
| -------------------------------------------- | ------- | ------------------------------------------ |
| sort<mark style="color:red;">\*</mark>       | String  | 0：根据订单时间倒序 1：根据能量和带宽价格倒序 2：根据金额倒序 3：根据能量倒序 |
| sourceFlag<mark style="color:red;">\*</mark> | String  | 渠道来源（需要双方约定一个名称来代表三方的渠道）                   |
| page<mark style="color:red;">\*</mark>       | Integer | 页码                                         |
| pageSize<mark style="color:red;">\*</mark>   | Integer | 条数                                         |

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

```javascript
{
    "resCode": 100,
    "resMsg": "Success",
    "data": {
        "data": [
            {
                "orderId": "2ombu8zk_3jet_0mle_g7id_2mi3gnl6fk4y",
                "fromAddress": "TW7XuicuiQSHCcodUkyjMfdWxnWsbZmiSS",
                "pledgeAddress": "TW7XuicuiQSHCcodUkyjMfdWxnWsbZmiSS",
                "pledgeNum": 555,
                "salePledgeNum": 0,
                "freezePledgeNum": 0,
                "canSaleTrxNum": 0.128205,
                "leftPledgeTrxNum": 30.67,
                "leftPledgeNum": 555,
                "orderPrice": "110",
                "orderType": "ENERGY",
                "pledgeDay": "3",
                "createTime": "2023-04-11 16:29:55",
                "lowSaleTrxNum": 0.11549999999999999,
                "lowTRXCanBuy": 27.63,
                "lowCanBuy": 500,
                "AnnualizedRate": 50
            }
        ],
        "pagination": {
            "page": 1,
            "pageSize": 10,
            "total": 1
        }
    }
}
```

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

### 调用示例

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

```
// example
const params = {
    sort: '1',
    page: 1,
    pageSize: 10,
    sourceFlag: 'tronLink'
}
 const res = await axios.post('https://open.tronify.io/api/tronRent/trades',params)
 console.log(res)
 if(res.resCode === '100'){
   //...  
 }
```

{% endtab %}
{% endtabs %}

### Postman 示例

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