# Buyer leas energy records

### Endpoint usage

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

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

#### Headers

| Name                                      | Type   | Description                                                      |
| ----------------------------------------- | ------ | ---------------------------------------------------------------- |
| api-key<mark style="color:red;">\*</mark> | String | Access the buyer management platform of tronify.io to obtain it. |

#### Request Body

| Name                                         | Type   | Description                                                                                       |
| -------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------- |
| address<mark style="color:red;">\*</mark>    | String | User address (Wallet address)                                                                     |
| 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) |
| pledgeAddress                                | String | Search by pledgeAddress                                                                           |
| orderId                                      | String | Search by orderId                                                                                 |
| orderType<mark style="color:red;">\*</mark>  | String | <p>0: Completed. <br>1: In progress. <br>Other values: All</p>                                    |
| type<mark style="color:red;">\*</mark>       | String | Fixed value: user                                                                                 |
| pageSize<mark style="color:red;">\*</mark>   | String | page size                                                                                         |
| page<mark style="color:red;">\*</mark>       | String | page num                                                                                          |
| endTime                                      | String | Search by endTime (YYYY-MM-DD HH:mm:ss)                                                           |
| startTime                                    | String | Search by startTime (YYYY-MM-DD HH:mm:ss)                                                         |

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

```javascript
{
    "resCode": 100,
    "resMsg": "Success",
    "data": {
        "data": [
            {
                "orderId": "kuawcag6_hg5w_jsbe_tg1w_bcrzjl42glb1",
                "fromAddress": "TW7XuicuiQSHCcodUkyjMfdWxnWsbZmiSS",
                "pledgeAddress": "TBuPND7n66qNf3AbYNJA458duuV3ZyWtUk",
                "platformAddress": "",
                "pledgeNum": 32000,
                "trxNum": "3.68",
                "orderPrice": "115",
                "freeAmt": null,
                "orderType": "ENERGY",
                "pledgeDay": "0",
                "pledgeHour": "1",
                "orderStatus": "complete",
                "createTime": "2023-06-20 15:02:49",
                "pledgeTime": "2023-06-20 15:04:01",
                "finishTime": "2023-06-20 16:04:01"
            }
        ],
        "pagination": {
            "page": 1,
            "pageSize": 10,
            "total": 4
        }
    }
}
```

{% endtab %}
{% endtabs %}

### code example

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

```
// example
const params = {
    address: "TW7XuicuiQSHCcodUkyjMfdWxnWsbZmiSS",
    page: 1,
    pageSize: 10,
    code: "g7WNPfO1156",
    type: "user",
    orderType: "2",
    orderId: "",
    pledgeAddress: "",
    startTime: "2023-06-21",
    endTime: "2023-06-22",
    sourceFlag: "path"
}
const headers = {
  'api-key': 'your-api-key'
};
 const res = await axios.post('https://open.tronify.io/api/tronRent/user/userAssetRecord',params, { headers })
 console.log(res)
 if(res.resCode === '100'){
   //...  
 }
```

{% endtab %}
{% endtabs %}

### Postman example

<figure><img src="/files/jaU7pn3YKMK2T75HyEVD" 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-buyer/buyer-leas-energy-records.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.
