充值记录
curl --request GET \
--url https://www.chenyu.cn/api/open/v2/recharge/list \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.chenyu.cn/api/open/v2/recharge/list"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.chenyu.cn/api/open/v2/recharge/list', 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://www.chenyu.cn/api/open/v2/recharge/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://www.chenyu.cn/api/open/v2/recharge/list"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.chenyu.cn/api/open/v2/recharge/list")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.chenyu.cn/api/open/v2/recharge/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": 123,
"msg": "<string>",
"data": {
"recharge_list": [
{
"amount": 123,
"trade_time": 123,
"pay_time": 123,
"trade_number": "<string>"
}
],
"total": 123
}
}财务接口
充值记录
查询充值记录列表
GET
/
api
/
open
/
v2
/
recharge
/
list
充值记录
curl --request GET \
--url https://www.chenyu.cn/api/open/v2/recharge/list \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.chenyu.cn/api/open/v2/recharge/list"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.chenyu.cn/api/open/v2/recharge/list', 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://www.chenyu.cn/api/open/v2/recharge/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://www.chenyu.cn/api/open/v2/recharge/list"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.chenyu.cn/api/open/v2/recharge/list")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.chenyu.cn/api/open/v2/recharge/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": 123,
"msg": "<string>",
"data": {
"recharge_list": [
{
"amount": 123,
"trade_time": 123,
"pay_time": 123,
"trade_number": "<string>"
}
],
"total": 123
}
}充值记录
查询账户的充值记录,支持分页查询。请求参数
string
页码,从1开始
string
每页数量
string
订单号,支持模糊搜索
响应参数
integer
响应码
string
响应信息
object
代码示例
import requests
url = "https://www.chenyu.cn/api/open/v2/recharge/list"
headers = {
"Authorization": "Bearer your_api_key"
}
params = {
"page": "1",
"page_size": "10",
"trade_number": "TXN123456789" # 可选,按订单号筛选
}
response = requests.get(url, headers=headers, params=params)
result = response.json()
if result['code'] == 0:
recharge_data = result['data']
print(f"总记录数: {recharge_data['total']}")
for record in recharge_data['recharge_list']:
print(f"充值金额: {record['amount']}")
print(f"交易编号: {record['trade_number']}")
print(f"订单时间: {record['trade_time']}")
print(f"支付时间: {record['pay_time']}")
print("---")
else:
print(f"查询失败: {result['msg']}")
const axios = require('axios');
const url = 'https://www.chenyu.cn/api/open/v2/recharge/list';
const headers = {
'Authorization': 'Bearer your_api_key'
};
const params = {
page: "1",
page_size: "10",
trade_number: "TXN123456789" // 可选,按订单号筛选
};
axios.get(url, { headers, params })
.then(response => {
const result = response.data;
if (result.code === 0) {
const rechargeData = result.data;
console.log(`总记录数: ${rechargeData.total}`);
rechargeData.recharge_list.forEach(record => {
console.log(`充值金额: ${record.amount}`);
console.log(`交易编号: ${record.trade_number}`);
console.log(`订单时间: ${record.trade_time}`);
console.log(`支付时间: ${record.pay_time}`);
console.log('---');
});
} else {
console.log(`查询失败: ${result.msg}`);
}
})
.catch(error => {
console.error('Error:', error.response.data);
});
curl -X GET "https://www.chenyu.cn/api/open/v2/recharge/list?page=1&page_size=10&trade_number=TXN123456789" \
-H "Authorization: Bearer your_api_key"
响应示例
{
"code": 0,
"msg": "查询成功",
"data": {
"recharge_list": [
{
"amount": 500.00,
"trade_time": 1705294225,
"pay_time": 1705294270,
"trade_number": "TXN20240115103025001"
},
{
"amount": 1000.00,
"trade_time": 1704870015,
"pay_time": 1704870065,
"trade_number": "TXN20240110152015002"
}
],
"total": 25
}
}
{
"code": -1,
"msg": "查询失败"
}
⌘I