> 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-buyer/buyer-sale-energy-records.md).

# 租赁记录

### 接口调用

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

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

#### Headers

| Name                                      | Type   | Description          |
| ----------------------------------------- | ------ | -------------------- |
| api-key<mark style="color:red;">\*</mark> | String | 访问tronify.io买家管理平台获取 |

#### Request Body

| Name                                         | Type   | Description                      |
| -------------------------------------------- | ------ | -------------------------------- |
| address<mark style="color:red;">\*</mark>    | String | 用户地址（钱包地址）                       |
| sourceFlag<mark style="color:red;">\*</mark> | String | 渠道来源（需要双方约定一个名称来代表三方的渠道）         |
| pledgeAddress                                | String | 根据租赁地址查询                         |
| orderId                                      | String | 根据订单号查询                          |
| orderType<mark style="color:red;">\*</mark>  | String | <p>0 完成；<br>1 进行中；<br>其它值：全部</p> |
| type<mark style="color:red;">\*</mark>       | String | 固定值：user                         |
| pageSize<mark style="color:red;">\*</mark>   | String | 条数                               |
| page<mark style="color:red;">\*</mark>       | String | 页码                               |
| endTime                                      | String | 根据结束时间查询 (YYYY-MM-DD HH:mm:ss)   |
| startTime                                    | String | 根据开始时间查询 (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 %}

### 调用示例

{% 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 示例

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