> For the complete documentation index, see [llms.txt](https://docs-tron.en.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.en.tronify.io/tron-api/query-purchase-order-records-by-user-address.md).

# query purchase order records by user address

### &#x20;Endpoint usage

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

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                                                                                                                                                                    |
| orderType<mark style="color:red;">\*</mark>   | String  | <p>1：Query active buy orders with the status of wait\_deposit\_send and wait\_sale<br>0：Query buy orders with the status of complete<br>Other values: Query all buy orders</p> |
| fromAddress<mark style="color:red;">\*</mark> | String  | User address (Wallet address)                                                                                                                                                  |

{% 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,
                "leftPledgeNum": 555,
                "orderPrice": "110",
                "orderType": "ENERGY",
                "pledgeDay": "3",
                "orderStatus": "wait_sale",
                "createTime": "2023-04-11 16:29:55"
            },
            {
                "orderId": "gzbh4w53_k0qb_9x7d_elwm_dw8aoas7olbt",
                "fromAddress": "TW7XuicuiQSHCcodUkyjMfdWxnWsbZmiSS",
                "pledgeAddress": "TW7XuicuiQSHCcodUkyjMfdWxnWsbZmiSS",
                "pledgeNum": 555,
                "salePledgeNum": 0,
                "freezePledgeNum": 0,
                "leftPledgeNum": 555,
                "orderPrice": "110",
                "orderType": "ENERGY",
                "pledgeDay": "3",
                "orderStatus": "timeout",
                "createTime": "2023-04-11 16:17:14"
            }
        ],
        "pagination": {
            "page": 1,
            "pageSize": 10,
            "total": 2
        }
    }
}
```

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

### code example

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

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

{% endtab %}
{% endtabs %}

### Postman example

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