# query recent finished order

### &#x20;Endpoint usage

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

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

#### Request Body

| Name                                         | Type    | Description                                                                                       |
| -------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------- |
| 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) |
| page<mark style="color:red;">\*</mark>       | Integer | page num                                                                                          |
| pageSize<mark style="color:red;">\*</mark>   | Integer | record size                                                                                       |

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

```javascript
{
    "resCode": 100,
    "resMsg": "Success",
    "data": [
        {
            "orderId": "c490cwg0_8ad1_d81n_h9mk_qyt3x50jj4er",
            "relateOrderId": "qzld7n3q_5jfd_sx2l_k611_sf14yriioaux",
            "orderType": "ENERGY",
            "orderPrice": "112",
            "pledgeNum": "500",
            "payTrxNum": "0.117599",
            "createTime": "2023-04-06 11:22:57",
            "pledgeHash": "99da5697d4f03e41e7db000729cdb7b2c34310bb0dd5f1ebae859aacbe715a17"
        },
        {
            "orderId": "0glfxyv5_auu1_5a3z_kg9q_xts9ss7bw077",
            "relateOrderId": "sp8nrdgt_1ivg_1p8y_v9np_591c5lxjj2h2",
            "orderType": "ENERGY",
            "orderPrice": "110",
            "pledgeNum": "1000",
            "payTrxNum": "0.230999",
            "createTime": "2023-04-06 11:10:51",
            "pledgeHash": "431c18ef4aeaac4f7d5a90bf4d1fc83518e74425815593205593de506451b0a6"
        }
    ]
}
```

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

### code example

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

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

{% endtab %}
{% endtabs %}

### Postman example

<figure><img src="https://3188465811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fnv0Qbx2yTtH3TKQFd528%2Fuploads%2FIinuGNLBTJ20SRrPOr00%2F8.jpg?alt=media&#x26;token=191775d4-2f2b-4692-90c3-eed95f119177" alt=""><figcaption></figcaption></figure>
