订单
提前回收订单
在租期结束前收回订单的带宽
POST
/
v1
/
orders
/
{order_id}
/
reclaim
提前回收订单
curl --request POST \
--url https://api.tronrental.com/v1/orders/{order_id}/reclaimimport requests
url = "https://api.tronrental.com/v1/orders/{order_id}/reclaim"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.tronrental.com/v1/orders/{order_id}/reclaim', 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/orders/{order_id}/reclaim",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tronrental.com/v1/orders/{order_id}/reclaim"
req, _ := http.NewRequest("POST", url, nil)
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/orders/{order_id}/reclaim")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tronrental.com/v1/orders/{order_id}/reclaim")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body提前回收订单
立即取消您订单的带宽委托——例如地址已经完成了租用资源所需的转账——无需等待租期结束。未使用的时间不予退款。 仅带宽订单可以提前回收。路径参数
响应
返回订单对象,与 Get Order 相同。status 表示处理结果:
| 状态 | 含义 |
|---|---|
reclaimed | 带宽已在请求等待期间取消委托(请求最多等待约 10 秒);undelegate_txid 为链上交易 |
filled | 取消委托未在请求期间完成,将由下一个回收周期完成,通常在 30 秒内。结果通过 order.updated webhook 通知,或轮询 Get Order |
reclaiming | 该订单的回收正在进行中 |
reclaim_failed | 多次重试后,我们这边未能完成取消委托。您无需做任何事 |
reclaiming、reclaimed 或 reclaim_failed 状态的订单再次调用,会原样返回订单,因此重试是安全的。API 密钥需要 buy_bandwidth 权限。
错误
| 代码 | 状态 | 情况 |
|---|---|---|
ORDER_NOT_FOUND | 404 | 您的账户下没有该订单 |
ORDER_NOT_RECLAIMABLE | 409 | 订单尚未交付(filled)或已失败 |
BAD_REQUEST | 400 | 不是带宽订单 |
FORBIDDEN | 403 | API 密钥缺少 buy_bandwidth 权限 |
示例
curl -X POST https://api.tronrental.com/v1/orders/12345/reclaim \
-H "X-API-Key: your_api_key"
Response
{
"id": 12345,
"type": "bandwidth",
"target_address": "TRecipientAddress...",
"volume": 350,
"duration": "1h",
"price_trx": "0.42",
"fixed_fee_trx": "0.2",
"status": "reclaimed",
"delegate_txid": "a1b2c3d4e5f6...",
"undelegate_txid": "f6e5d4c3b2a1...",
"reclaim_at": "2026-11-11T11:00:00Z",
"source": "api",
"activation_id": null,
"activation_cost_trx": null,
"fail_reason": null,
"refunded_trx": null,
"created_at": "2026-11-11T10:00:00Z"
}
⌘I
提前回收订单
curl --request POST \
--url https://api.tronrental.com/v1/orders/{order_id}/reclaimimport requests
url = "https://api.tronrental.com/v1/orders/{order_id}/reclaim"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.tronrental.com/v1/orders/{order_id}/reclaim', 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/orders/{order_id}/reclaim",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tronrental.com/v1/orders/{order_id}/reclaim"
req, _ := http.NewRequest("POST", url, nil)
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/orders/{order_id}/reclaim")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tronrental.com/v1/orders/{order_id}/reclaim")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body