curl --location 'https://kf.pikabao.cc/agent/v1/cards/transactions?appid=user123&page=1&pageSize=20×tamp=1640995200000&sign=ABC123...'
const params = {
appid: "user123",
number: "5572710152044****", // 可选
page: 1,
pageSize: 20,
timestamp: Date.now().toString(),
};
const sign = generateSign(params, secretKey);
const response = await fetch(
`https://kf.pikabao.cc/agent/v1/cards/transactions?${new URLSearchParams({...params, sign})}`
);
const orders = await response.json();
import requests
import time
params = {
"appid": "user123",
"page": 1,
"pageSize": 20,
"timestamp": str(int(time.time() * 1000)),
}
sign = generate_sign(params, secret_key)
params["sign"] = sign
response = requests.get(
"https://kf.pikabao.cc/agent/v1/cards/transactions",
params=params
)
orders = response.json()
{
"code": 0,
"msg": "成功",
"total": 136,
"rows": [
{
"id": "UO123456789",
"transactionId": "789-asdas-jalksjdlak",
"cardNum": "5572710152044****",
"clientId": "4546464644",
"type": "Consumption",
"status": "Finish",
"amount": "-25.50",
"merchantName": "Amazon",
"remark": "在线购物",
"recordTime": "2024-08-28T05:13:37.000+00:00"
},
{
"id": "UO123456790",
"transactionId": "790-bsdbs-kblkteklbl",
"cardNum": "5572710152044****",
"clientId": "4546464644",
"type": "Recharge",
"status": "Finish",
"amount": "+100.00",
"merchantName": "",
"remark": "充值",
"recordTime": "2024-08-27T10:30:15.000+00:00"
}
]
}
交易查询
交易订单查询
查询虚拟信用卡的交易记录,支持分页查询
GET
/
agent
/
v1
/
cards
/
transactions
curl --location 'https://kf.pikabao.cc/agent/v1/cards/transactions?appid=user123&page=1&pageSize=20×tamp=1640995200000&sign=ABC123...'
const params = {
appid: "user123",
number: "5572710152044****", // 可选
page: 1,
pageSize: 20,
timestamp: Date.now().toString(),
};
const sign = generateSign(params, secretKey);
const response = await fetch(
`https://kf.pikabao.cc/agent/v1/cards/transactions?${new URLSearchParams({...params, sign})}`
);
const orders = await response.json();
import requests
import time
params = {
"appid": "user123",
"page": 1,
"pageSize": 20,
"timestamp": str(int(time.time() * 1000)),
}
sign = generate_sign(params, secret_key)
params["sign"] = sign
response = requests.get(
"https://kf.pikabao.cc/agent/v1/cards/transactions",
params=params
)
orders = response.json()
{
"code": 0,
"msg": "成功",
"total": 136,
"rows": [
{
"id": "UO123456789",
"transactionId": "789-asdas-jalksjdlak",
"cardNum": "5572710152044****",
"clientId": "4546464644",
"type": "Consumption",
"status": "Finish",
"amount": "-25.50",
"merchantName": "Amazon",
"remark": "在线购物",
"recordTime": "2024-08-28T05:13:37.000+00:00"
},
{
"id": "UO123456790",
"transactionId": "790-bsdbs-kblkteklbl",
"cardNum": "5572710152044****",
"clientId": "4546464644",
"type": "Recharge",
"status": "Finish",
"amount": "+100.00",
"merchantName": "",
"remark": "充值",
"recordTime": "2024-08-27T10:30:15.000+00:00"
}
]
}
请求参数
string
required
用户标识
string
信用卡卡号(可选,不传则查询所有卡的交易)
integer
required
页码,从 1 开始
integer
required
每页显示数量
string
required
当前时间戳(毫秒)
string
required
签名值
响应
integer
响应代码
string
响应消息
integer
总记录数
array
curl --location 'https://kf.pikabao.cc/agent/v1/cards/transactions?appid=user123&page=1&pageSize=20×tamp=1640995200000&sign=ABC123...'
const params = {
appid: "user123",
number: "5572710152044****", // 可选
page: 1,
pageSize: 20,
timestamp: Date.now().toString(),
};
const sign = generateSign(params, secretKey);
const response = await fetch(
`https://kf.pikabao.cc/agent/v1/cards/transactions?${new URLSearchParams({...params, sign})}`
);
const orders = await response.json();
import requests
import time
params = {
"appid": "user123",
"page": 1,
"pageSize": 20,
"timestamp": str(int(time.time() * 1000)),
}
sign = generate_sign(params, secret_key)
params["sign"] = sign
response = requests.get(
"https://kf.pikabao.cc/agent/v1/cards/transactions",
params=params
)
orders = response.json()
{
"code": 0,
"msg": "成功",
"total": 136,
"rows": [
{
"id": "UO123456789",
"transactionId": "789-asdas-jalksjdlak",
"cardNum": "5572710152044****",
"clientId": "4546464644",
"type": "Consumption",
"status": "Finish",
"amount": "-25.50",
"merchantName": "Amazon",
"remark": "在线购物",
"recordTime": "2024-08-28T05:13:37.000+00:00"
},
{
"id": "UO123456790",
"transactionId": "790-bsdbs-kblkteklbl",
"cardNum": "5572710152044****",
"clientId": "4546464644",
"type": "Recharge",
"status": "Finish",
"amount": "+100.00",
"merchantName": "",
"remark": "充值",
"recordTime": "2024-08-27T10:30:15.000+00:00"
}
]
}
交易类型 (type)
| 类型 | 说明 | 金额符号 |
|---|---|---|
| Consumption | 消费支出 | - |
| Recharge | 卡充值 | + |
| CashOut | 卡提现 | - |
| Credit | 退款 | + |
| Reversal | 交易撤销 | + |
| Frozen | 冻结 | - |
| UnFrozen | 解冻 | + |
| Refuse | 拒绝交易 | 0 |
交易状态 (status)
| 状态 | 说明 | 描述 |
|---|---|---|
| Pending | 清算中 | 交易正在处理中 |
| Finish | 已结算 | 交易已完成 |
| Failed | 失败 | 交易失败 |
建议设置合理的 pageSize(如 20-50),避免单次查询数据量过大
使用场景
- 对账:定期查询交易记录进行对账
- 监控:实时监控卡片消费情况
- 分析:分析消费模式和趋势
- 审计:提供交易审计追踪
⌘I
