带宽租赁(自动续费)
启动自动续费租赁
启动持续的带宽租赁,每日扣费直到取消
POST
/
v1
/
bandwidth
/
rentals
启动自动续费租赁
curl --request POST \
--url https://api.tronrental.com/v1/bandwidth/rentals \
--header 'Content-Type: application/json' \
--data '
{
"target_address": "<string>",
"volume": 123
}
'import requests
url = "https://api.tronrental.com/v1/bandwidth/rentals"
payload = {
"target_address": "<string>",
"volume": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({target_address: '<string>', volume: 123})
};
fetch('https://api.tronrental.com/v1/bandwidth/rentals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tronrental.com/v1/bandwidth/rentals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'target_address' => '<string>',
'volume' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tronrental.com/v1/bandwidth/rentals"
payload := strings.NewReader("{\n \"target_address\": \"<string>\",\n \"volume\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tronrental.com/v1/bandwidth/rentals")
.header("Content-Type", "application/json")
.body("{\n \"target_address\": \"<string>\",\n \"volume\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tronrental.com/v1/bandwidth/rentals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_address\": \"<string>\",\n \"volume\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"status": "<string>",
"txid": "<string>",
"daily_trx": "<string>",
"amount_sun": 123,
"next_billing_at": "<string>"
}启动自动续费租赁
将带宽委托给 TRON 地址并保持委托,按日(1d)费率每 24 小时从余额扣费一次,直到您取消或余额不足以支付下一天。
请求体
响应
扣费方式
首日立即扣费。之后每 24 小时再次扣除每日金额。若余额不足以支付下一天,租赁结束并自动取消委托——充值后会自动恢复。可随时通过取消接口取消。示例
curl -X POST https://api.tronrental.com/v1/bandwidth/rentals \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"target_address": "TYourRecipientAddress1234567890abc",
"volume": 350
}'
import requests
resp = requests.post(
"https://api.tronrental.com/v1/bandwidth/rentals",
headers={"X-API-Key": "your_api_key"},
json={"target_address": "TYourRecipientAddress1234567890abc", "volume": 350},
)
print(resp.json())
const resp = await fetch("https://api.tronrental.com/v1/bandwidth/rentals", {
method: "POST",
headers: { "X-API-Key": "your_api_key", "Content-Type": "application/json" },
body: JSON.stringify({ target_address: "TYourRecipientAddress1234567890abc", volume: 350 }),
});
console.log(await resp.json());
Response
{
"id": 4321,
"status": "active",
"txid": "abc123...",
"daily_trx": "0.4205",
"amount_sun": 1000000,
"next_billing_at": "2026-06-11T04:30:00+00:00"
}
⌘I
启动自动续费租赁
curl --request POST \
--url https://api.tronrental.com/v1/bandwidth/rentals \
--header 'Content-Type: application/json' \
--data '
{
"target_address": "<string>",
"volume": 123
}
'import requests
url = "https://api.tronrental.com/v1/bandwidth/rentals"
payload = {
"target_address": "<string>",
"volume": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({target_address: '<string>', volume: 123})
};
fetch('https://api.tronrental.com/v1/bandwidth/rentals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tronrental.com/v1/bandwidth/rentals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'target_address' => '<string>',
'volume' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tronrental.com/v1/bandwidth/rentals"
payload := strings.NewReader("{\n \"target_address\": \"<string>\",\n \"volume\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tronrental.com/v1/bandwidth/rentals")
.header("Content-Type", "application/json")
.body("{\n \"target_address\": \"<string>\",\n \"volume\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tronrental.com/v1/bandwidth/rentals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_address\": \"<string>\",\n \"volume\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"status": "<string>",
"txid": "<string>",
"daily_trx": "<string>",
"amount_sun": 123,
"next_billing_at": "<string>"
}