账户
余额历史
您账户余额的所有变动
GET
/
api
/
v1
/
account
/
history
余额历史
curl --request GET \
--url https://api.example.com/api/v1/account/historyimport requests
url = "https://api.example.com/api/v1/account/history"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/account/history', 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.example.com/api/v1/account/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/v1/account/history"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/account/history")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/account/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"items": [
{
"id": 123,
"delta_trx": "<string>",
"balance_after": "<string>",
"reason": "<string>",
"ref_type": {},
"ref_id": {},
"ref_address": {},
"created_at": "<string>"
}
],
"total": 123,
"page": 123,
"page_size": 123
}余额历史
返回账户余额的所有变动,最新在前——购买、充值、退款和手续费都在一个列表中。订单、发票和激活各自只显示自己的部分,因此这是唯一算术闭合的接口:某段时间内delta_trx 的总和等于该时间段内余额的变化。
关于权限范围。
view 范围返回购买、退款和手续费。充值变动还需要 deposit_view 范围,提现需要 withdraw;没有这些范围时,相应记录不会出现在列表和 total 中,按此类原因筛选将返回空页面而非错误。查询参数
number
默认值:"1"
页码,从 1 开始。
number
默认值:"50"
每页条数(最多 100)。
string
仅返回此原因的变动,例如
energy_order。响应
array
显示 item
显示 item
number
符合筛选条件的变动总数。
number
页码,从 1 开始。
number
每页条数(最多 100)。
常见原因
| 原因 | 含义 |
|---|---|
energy_order | 购买能量 |
bw_order | 购买带宽 |
energy_order_refund | 能量订单退款 |
bw_order_refund | 带宽订单退款 |
activation | 在链上创建接收方账户 |
activation_refund | 未发生的激活退款 |
deposit | 入账充值 |
示例
curl "https://api.tronrental.com/v1/account/history?page=1&page_size=50" \
-H "X-API-Key: your_api_key"
Response
{
"items": [
{
"id": 97213,
"delta_trx": "-1.79",
"balance_after": "154.71",
"reason": "energy_order",
"ref_type": "order",
"ref_id": "12345",
"ref_address": "TYourRecipientAddress...",
"created_at": "2026-06-10T04:30:00Z"
},
{
"id": 97212,
"delta_trx": "-1.20",
"balance_after": "156.50",
"reason": "activation",
"ref_type": "activation",
"ref_id": "8891",
"ref_address": "TYourRecipientAddress...",
"created_at": "2026-06-10T04:29:53Z"
}
],
"total": 2,
"page": 1,
"page_size": 50
}
⌘I
余额历史
curl --request GET \
--url https://api.example.com/api/v1/account/historyimport requests
url = "https://api.example.com/api/v1/account/history"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/account/history', 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.example.com/api/v1/account/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/v1/account/history"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/account/history")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/account/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"items": [
{
"id": 123,
"delta_trx": "<string>",
"balance_after": "<string>",
"reason": "<string>",
"ref_type": {},
"ref_id": {},
"ref_address": {},
"created_at": "<string>"
}
],
"total": 123,
"page": 123,
"page_size": 123
}