> 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-seller/update-seller-configuration.md).

# 更新卖家出售相关配置

### 接口调用

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

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

#### Headers

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

#### Request Body

| Name                                                       | Type   | Description                                     |
| ---------------------------------------------------------- | ------ | ----------------------------------------------- |
| fromAddress<mark style="color:red;">\*</mark>              | String | 用户地址（钱包地址）                                      |
| sourceFlag<mark style="color:red;">\*</mark>               | String | 渠道来源（需要双方约定一个名称来代表三方的渠道）                        |
| energy\_price\_customize<mark style="color:red;">\*</mark> | String | <p>自定义出售能量最低价（0：默认 </p><p>1：自定义)</p>            |
| energy\_min\_sun                                           | String | 设置出售能量最低价                                       |
| flag<mark style="color:red;">\*</mark>                     | String | "{api-key}SWFTstakeapprove{timeStamp}"的md5值(大写) |
| timeStamp<mark style="color:red;">\*</mark>                | String | 时间戳                                             |

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

```javascript
{
    "resCode": 100,
    "resMsg": "Success",
    "data": {
        "from_address": "TKghVbeEzvrV8GLK3YE1gRrjVHSf8rGB6k",
        "approve_address": "TGVEVDZZHJGZAHEPfou57u8F89i5nNNRxX",//授权地址
        "approve_id": 3, //授权id
        "approve_type": "1,2,3,4,5",
        "auto_sale": 1,
        "auto_vote": 1,
        "energy_price_customize": 1,//自定义出售能量最低价，默认0
        "energy_price_low": 60, //设置出售能量最低价，不设置默认60
        "bandwidth_price_customize": 0,
        "bandwidth_price_low": 0,
        "auto_withdraw": 1,
        "withdraw_left": 0,
        "auto_staking": 1,
        "stake_left": 0,
        "staking_trx": "178260 //质押trx数量
        "staking_available_trx": "5114.939104" //可租赁trx数量
    }
}
```

{% endtab %}
{% endtabs %}

### 调用示例

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

```javascript
// example
const params = {
    "fromAddress": "TKghVbeEzvrV8GLK3YE1gRrjVHSf8rGB6k",
    "sourceFlag": "path",
    "energy_price_customize": 1,
    "energy_min_sun": 57,
    "flag": "md5-xxxxx",
    "timeStamp": 1684941701
}
const headers = {
  'api-key': 'your-api-key'
};
const res = await axios.post('https://open.tronify.io/api/tronRent/updateApproveInfo',params, { headers })
console.log(res)
if(res.resCode === '100'){
   //...  
}
```

{% endtab %}
{% endtabs %}

### Postman 示例

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