Tài khoản
Lịch sử giao dịch
Mọi lần credit thay đổi trên tài khoản, mới nhất trước: nạp, trừ, hoàn.
https://api.sangtao.ai/v2/account/transactionsXác thực
X-Api-Keystring · headerbắt buộcAPI key của bạn, tạo ở trang API key trong tài khoản.
Tham số query
typestringChỉ lấy giao dịch loại này. Không phân biệt hoa thường.
Giá trị có thể:
TopupConsumeBonusRefundAdjustmentExchangepageintSố trang, từ 1. Mặc định 1.
pageSizeintSố giao dịch mỗi trang. Mặc định 20, tối đa 100. Gửi limit cũng được, cùng nghĩa.
Response
Một mảng giao dịch, mới nhất trước. Tổng số theo bộ lọc nằm ở header X-Total-Count.
idstringMã giao dịch, tx_….
typestringLoại giao dịch.
Giá trị có thể:
TopupConsumeBonusRefundAdjustmentExchangedescriptionstringNội dung giao dịch, dạng câu (tiếng Việt).
descriptionKeystring | nullLoại câu, để tự viết description bằng ngôn ngữ của bạn, ví dụ "bank_topup". null nếu không có.
descriptionParamsobject | nullCác giá trị trong câu đó (số tiền, gói…), dạng chuỗi.
amountnumberSố credit cộng (dương) hoặc trừ (âm).
balanceAfternumberSố dư ngay sau giao dịch.
jobIdstring | nullJob liên quan. null nếu không gắn với job (ví dụ nạp credit).
createdAtstringThời điểm giao dịch, ISO 8601 giờ UTC.
/account/transactionscurl "https://api.sangtao.ai/v2/account/transactions?page=1&pageSize=20" \
-H "X-Api-Key: YOUR_API_KEY"{
"success": true,
"data": [
{
"id": "tx_8hQ2mZr4K",
"type": "Consume",
"description": "Motion render",
"descriptionKey": "motion_render",
"descriptionParams": {},
"amount": -12,
"balanceAfter": 142,
"jobId": "acff47cbfacf4e27bbc08770c9ea246d",
"createdAt": "2026-11-09T10:01:00Z"
},
{
"id": "tx_3kT9qPz0B",
"type": "Topup",
"description": "Nạp 200.000đ — Gói Starter",
"descriptionKey": "bank_topup",
"descriptionParams": {
"vnd": "200000",
"package": "Gói Starter"
},
"amount": 150,
"balanceAfter": 154,
"jobId": null,
"createdAt": "2026-11-08T03:20:00Z"
}
]
}/account/transactionscurl "https://api.sangtao.ai/v2/account/transactions?page=1&pageSize=20" \
-H "X-Api-Key: YOUR_API_KEY"{
"success": true,
"data": [
{
"id": "tx_8hQ2mZr4K",
"type": "Consume",
"description": "Motion render",
"descriptionKey": "motion_render",
"descriptionParams": {},
"amount": -12,
"balanceAfter": 142,
"jobId": "acff47cbfacf4e27bbc08770c9ea246d",
"createdAt": "2026-11-09T10:01:00Z"
},
{
"id": "tx_3kT9qPz0B",
"type": "Topup",
"description": "Nạp 200.000đ — Gói Starter",
"descriptionKey": "bank_topup",
"descriptionParams": {
"vnd": "200000",
"package": "Gói Starter"
},
"amount": 150,
"balanceAfter": 154,
"jobId": null,
"createdAt": "2026-11-08T03:20:00Z"
}
]
}