v2.payment.get_escrow_detail
GET/api/v2/payment/get_escrow_detailGọi qua 360: GET https://partner.quantri360.com/v1/shopee/api/v2/payment/get_escrow_detail
Mô tả API
Chi tiết tiền của MỘT đơn: khách trả bao nhiêu, giảm giá của shop / Shopee, từng khoản phí sàn (cố định, dịch vụ, thanh toán, affiliate…), phí vận chuyển và số tiền người bán thực nhận (escrow_amount). Cùng nội dung với get_escrow_detail_batch nhưng một đơn mỗi lần — dùng khi tra lẻ (màn hình chi tiết đơn, đối soát một đơn khiếu nại).
- Mã đơn sai hoặc không thuộc gian hàng →
error: "order_not_found", message "Order SN provided is invalid or does not belong to you…". - Tra nhiều đơn: dùng get_escrow_detail_batch (≤ 50 đơn / lần) thay vì gọi lặp API này.
- Đối chiếu (ví dụ thật): 275.600 − 48.506 − 18.158 − 16.536 − 2.436 − 2.700 = 187.264 = escrow_amount. Nhiều trường chỉ có ở thị trường khác (BR, ID, MY…) và luôn bằng 0 với gian hàng VN.
- Mọi số tiền là VND, số nguyên dạng float.
Request
Địa chỉ
GET https://partner.quantri360.com/v1/shopee/api/v2/payment/get_escrow_detail
Xác thực & gian hàng
| Tên | Vị trí | Kiểu | Mẫu | Mô tả |
|---|---|---|---|---|
| Authorization | header | header | Bearer q360_live_ab12cd34_… | Khóa API của brand (tạo ở mục API key). Bắt buộc với mọi request. Brand suy từ key — không truyền mã brand. |
| platform_shop_id | query | string | 100001 | Gian hàng (lấy ở GET /v1/platforms → shops[].platform_shop_id). BẮT BUỘC khi brand có > 1 gian hàng trên nền tảng; 360 bỏ tham số này trước khi chuyển tiếp. |
Tham số request
| Tên | Vị trí | Kiểu | Bắt buộc | Mẫu | Mô tả |
|---|---|---|---|---|---|
| order_sn | query | string | Có | 2610230ABCDE15 | Mã đơn Shopee (một mã). |
Ví dụ request
curl -s "https://partner.quantri360.com/v1/shopee/api/v2/payment/get_escrow_detail?order_sn=2610230ABCDE15" \ -H "Authorization: Bearer $KEY"
Python
import requests
KEY = "q360_live_..." # khóa API của brand
r = requests.get(
"https://partner.quantri360.com/v1/shopee/api/v2/payment/get_escrow_detail",
params={
"order_sn": "2610230ABCDE15"
},
headers={"Authorization": f"Bearer {KEY}"},
timeout=60,
)
print(r.status_code)
print(r.json())Node.js
const KEY = 'q360_live_...'; // khóa API của brand
const url = new URL('https://partner.quantri360.com/v1/shopee/api/v2/payment/get_escrow_detail');
for (const [k, v] of Object.entries({"order_sn":"2610230ABCDE15"})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
method: 'GET',
headers: { Authorization: `Bearer ${KEY}` },
});
console.log(r.status, await r.json());PHP
<?php $key = 'q360_live_...'; // khóa API của brand $url = 'https://partner.quantri360.com/v1/shopee/api/v2/payment/get_escrow_detail' . '?' . http_build_query(['order_sn' => '2610230ABCDE15']); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key]); $res = curl_exec($ch); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo $status, "\n", $res;
Response
Tham số phản hồi (nguyên của Shopee)
| Tên | Kiểu | Mẫu | Mô tả |
|---|---|---|---|
| request_id | string | d52ca43b277a4f9292fb8be658bfd33d | Mã request của Shopee để tra lỗi. |
| error | string | Mã lỗi Shopee; rỗng = thành công. | |
| message | string | Mô tả lỗi. | |
| response | object | Một đơn (không phải mảng như bản batch). | |
| order_sn | string | 2610230ABCDE15 | Mã đơn. |
| buyer_user_name | string | nguoimua123 | Tên tài khoản người mua. |
| return_order_sn_list | string[] | [] | Mã yêu cầu trả hàng của đơn (nếu có). |
| order_income | object | Dòng tiền của đơn (khoảng 90 trường; dưới đây là các trường dùng với gian hàng VN — ý nghĩa như get_escrow_detail_batch). | |
| escrow_amount | float | 187264 | Người bán THỰC NHẬN. Có thể đổi tới khi đơn hoàn tất (trả hàng, điều chỉnh phí). |
| escrow_amount_after_adjustment | float | 187264 | Tiền thực nhận sau các điều chỉnh của Shopee. Khớp `released_amount` của get_income_detail. |
| total_adjustment_amount | float | 0 | Tổng điều chỉnh sau quyết toán (âm = Shopee trừ thêm). |
| order_original_price | float | 689000 | Giá gốc (trước mọi giảm giá). |
| order_seller_discount | float | 413400 | Shop giảm giá. |
| cost_of_goods_sold | float | 275600 | Tiền hàng sau giảm giá của shop. |
| voucher_from_seller | float | 0 | Voucher của shop. |
| voucher_from_shopee | float | 50000 | Voucher Shopee tài trợ (không trừ vào người bán). |
| seller_voucher_code | string[] | ["SVIPDDV0109M50C100"] | Mã voucher áp cho đơn. |
| buyer_total_amount | float | 225600 | Khách thực trả. |
| commission_fee | float | 48506 | Phí cố định. |
| service_fee | float | 18158 | Phí dịch vụ. |
| seller_transaction_fee | float | 16536 | Phí thanh toán. |
| credit_card_transaction_fee | float | 16536 | Phí giao dịch thẻ — cùng giá trị với seller_transaction_fee, KHÔNG cộng hai lần. |
| order_ams_commission_fee | float | 2436 | Hoa hồng affiliate. |
| shipping_seller_protection_fee_amount | float | 2700 | Phí bảo hiểm / dịch vụ vận chuyển người bán đăng ký. |
| actual_shipping_fee | float | 41000 | Phí vận chuyển thực. |
| estimated_shipping_fee | float | 41000 | Phí vận chuyển ước tính lúc đặt. |
| shopee_shipping_rebate | float | 41000 | Shopee trợ giá vận chuyển. |
| buyer_paid_shipping_fee | float | 0 | Khách trả phí ship. |
| reverse_shipping_fee | float | 0 | Phí vận chuyển chiều hoàn. |
| seller_return_refund | float | 0 | Tiền hoàn cho khách khi trả hàng (âm). |
| withholding_vat_tax | float | 0 | Thuế GTGT Shopee khấu trừ. |
| withholding_pit_tax | float | 0 | Thuế TNCN Shopee khấu trừ. |
| items | object[] | Từng dòng hàng: item_id, item_name, item_sku, model_id, model_name, model_sku, quantity_purchased, original_price, discounted_price, selling_price, seller_discount, discount_from_voucher_shopee / _seller, ams_commission_fee, line_item_id, promotion_list… | |
| buyer_payment_info | object | Ảnh chụp lúc đặt hàng: buyer_payment_method, buyer_total_amount, merchant_subtotal, shopee_voucher (âm), seller_voucher, shipping_fee… |
Mẫu phản hồi
{
"error": "",
"message": "",
"request_id": "08ba69875ef6cd6f…",
"response": {
"order_sn": "2610230ABCDE15",
"buyer_user_name": "nguoimua123",
"return_order_sn_list": [],
"order_income": {
"escrow_amount": 187264,
"escrow_amount_after_adjustment": 187264,
"total_adjustment_amount": 0,
"order_original_price": 689000,
"order_seller_discount": 413400,
"cost_of_goods_sold": 275600,
"voucher_from_seller": 0,
"voucher_from_shopee": 50000,
"seller_voucher_code": [
"SVIPDDV0109M50C100"
],
"buyer_total_amount": 225600,
"commission_fee": 48506,
"service_fee": 18158,
"seller_transaction_fee": 16536,
"credit_card_transaction_fee": 16536,
"order_ams_commission_fee": 2436,
"shipping_seller_protection_fee_amount": 2700,
"actual_shipping_fee": 41000,
"estimated_shipping_fee": 41000,
"shopee_shipping_rebate": 41000,
"buyer_paid_shipping_fee": 0,
"reverse_shipping_fee": 0,
"seller_return_refund": 0,
"withholding_vat_tax": 0,
"withholding_pit_tax": 0,
"items": [
{
"item_id": 10000000077,
"item_name": "Áo sơ mi nữ công sở cổ nơ",
"item_sku": "WAKBD1016-WAKBE2040",
"model_id": 10000000078,
"model_name": "Trắng,L",
"model_sku": "WAKBD1016-Màu 1-L",
"quantity_purchased": 1,
"original_price": 689000,
"discounted_price": 275600,
"selling_price": 275600,
"seller_discount": 413400,
"discount_from_voucher_shopee": 50000,
"ams_commission_fee": 2436,
"promotion_list": [
{
"promotion_id": 10000000079,
"promotion_type": "platform_sale"
}
]
}
]
},
"buyer_payment_info": {
"buyer_payment_method": "ShopeePay Linked Bank Account",
"buyer_total_amount": 225600,
"merchant_subtotal": 275600,
"shopee_voucher": -50000,
"seller_voucher": 0,
"shipping_fee": 0
}
}
}
Mã lỗi của Shopee (11)
Bấm để xem
| Mã | Ý nghĩa |
|---|---|
| error_data | Dữ liệu không tồn tại hoặc không hợp lệ cho thao tác (vd mã không có, loại yêu cầu không cho phép). |
| error_param | Tham số sai / thiếu / sai kiểu — xem `message` để biết tham số nào. |
| error_server | Lỗi hệ thống Shopee — thử lại sau ít phút. |
| error_shop | Gian hàng không hợp lệ — kiểm tra platform_shop_id. |
| order_not_found | Order SN provided is invalid or does not belong to you. Please enter a valid Order SN. |
| common.error_not_found | Không tìm thấy thông tin. |
| error_auth | Ủy quyền gian hàng cho 360 đã hết hạn hoặc bị thu hồi (360 đã tự làm mới token một lần) — chủ gian hàng kết nối lại Shopee trong Partner. |
| error_limit | Chạm hạn mức gọi Shopee trong ngày của kết nối — 360 trả kèm thời điểm thử lại; giảm tần suất gọi. |
| error_rate_limit | Gọi quá nhanh — chờ vài giây rồi gọi lại (360 cũng giới hạn theo key: 429 + Retry-After). |
| shop_banned | Gian hàng đang bị Shopee khóa — mọi API tạm ngưng tới khi gỡ khóa. |
| error_kyc_auth | Gian hàng chưa hoàn tất đăng ký người bán trên Kênh Người Bán. |
Bắt đầu dùng
- Đăng ký tài khoản Partner
- Mở loại dữ liệu thuộc nhóm Tài chính / đối soát ở trang nền tảng
- Tạo API key (tick kênh Shopee)
- Gọi theo ví dụ ở trên