v2.ams.get_optimization_suggestion_product
GET/api/v2/ams/get_optimization_suggestion_productGọi qua 360: GET https://partner.quantri360.com/v1/shopee_ams/api/v2/ams/get_optimization_suggestion_product
Mô tả API
Sản phẩm được gợi ý tối ưu Tiếp thị liên kết: sản phẩm tiềm năng nên đưa vào chiến dịch, sản phẩm nên TĂNG tỷ lệ hoa hồng, hoặc nên GIA HẠN thời gian chiến dịch — kèm tỷ lệ hiện tại, khoảng tỷ lệ đề xuất, số bán và số affiliate 90 ngày.
- Thương hiệu mẫu: optimize_increase_commission_rate có 496 sản phẩm (đang 2%, đề xuất 6–12%); product_opportunities và optimize_extend_promotion_period rỗng (item_list [], total 0).
- Muốn số từ display_price phải bỏ "₫" và dấu chấm.
Request
Địa chỉ
GET https://partner.quantri360.com/v1/shopee_ams/api/v2/ams/get_optimization_suggestion_product
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ả |
|---|---|---|---|---|---|
| page_no | query | int | Có | 1 | Trang, từ 1. |
| page_size | query | int | Có | 20 | 1–100. |
| rcmd_reason_filter | query | string | Có | optimize_increase_commission_rate | product_opportunities (sản phẩm tiềm năng) · optimize_increase_commission_rate (nên tăng hoa hồng) · optimize_extend_promotion_period (nên gia hạn). |
Phân trang
Tăng page_no khi response.has_more = true.
Ví dụ request
curl -s "https://partner.quantri360.com/v1/shopee_ams/api/v2/ams/get_optimization_suggestion_product?page_no=1&page_size=20&rcmd_reason_filter=optimize_increase_commission_rate" \ -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_ams/api/v2/ams/get_optimization_suggestion_product",
params={
"page_no": 1,
"page_size": 20,
"rcmd_reason_filter": "optimize_increase_commission_rate"
},
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_ams/api/v2/ams/get_optimization_suggestion_product');
for (const [k, v] of Object.entries({"page_no":1,"page_size":20,"rcmd_reason_filter":"optimize_increase_commission_rate"})) 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_ams/api/v2/ams/get_optimization_suggestion_product' . '?' . http_build_query(['page_no' => 1, 'page_size' => 20, 'rcmd_reason_filter' => 'optimize_increase_commission_rate']); $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 AMS)
| 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 | ||
| total | int | 496 | Tổng sản phẩm được gợi ý (khóa là `total`, không phải total_count). |
| has_more | bool | true | |
| item_list | object[] | ||
| item_id | int | 10000000003 | Mã sản phẩm. |
| item_name | string | Áo 2 Dây Buộc Nơ Lưng Thương hiệu mẫu - SA2DBA01 | Tên. |
| rcmd_reason | string[] | ["optimize_commission_rate"] | Lý do: `severe_shortage` · `high_popularity` · `optimize_commission_rate` · `extend_time_period`. |
| campaign_id | int | 10000000006 | Chiến dịch hiện tại của sản phẩm. |
| campaign_status | string | Ongoing | Upcoming · Ongoing · Terminating. |
| commission_rate | float | 2 | Tỷ lệ hiện tại (%) — 2 = 2%. |
| suggest_min_rate | float | 7 | Đề xuất thấp nhất (%). |
| suggest_max_rate | float | 12 | Đề xuất cao nhất (%). |
| prefill_rate | float | 7 | Tỷ lệ điền sẵn khi áp gợi ý (%). |
| prefill_subsidy_rate | float | 0 | Tỷ lệ Shopee trợ giá tính theo hoa hồng shop (%). |
| has_subsidy_data | bool | false | Có số liệu trợ giá. |
| period_start_time | timestamp | 1790049614 | Bắt đầu. |
| period_end_time | timestamp | 32503651199 | Kết thúc; 32503651199 = không thời hạn. |
| affiliate_count | int | 0 | Số affiliate đã chia sẻ sản phẩm trong 90 ngày. |
| item_sold | int | 3 | Số bán qua Tiếp thị liên kết 90 ngày (với product_opportunities: số bán của sản phẩm). |
| l2_category_order_count | int | null | Số đơn affiliate của ngành cấp 2 trong 30 ngày — chỉ có với product_opportunities, còn lại null. |
| display_price | string | ₫99.000 | Giá hiển thị dạng CHỮ có ký hiệu ₫ và dấu chấm nghìn — khác display_price số thuần ở các API sản phẩm AMS khác. |
Mẫu phản hồi
{
"error": "",
"message": "",
"request_id": "e3e3e7f35ef7b4f7…",
"response": {
"item_list": [
{
"item_id": 10000000003,
"item_name": "Áo 2 Dây Buộc Nơ Lưng Thương hiệu mẫu - SA2DBA01",
"rcmd_reason": [
"optimize_commission_rate"
],
"campaign_id": 10000000006,
"commission_rate": 2,
"period_start_time": 1790049614,
"period_end_time": 32503651199,
"affiliate_count": 0,
"item_sold": 3,
"campaign_status": "Ongoing",
"l2_category_order_count": null,
"suggest_min_rate": 7,
"suggest_max_rate": 12,
"prefill_rate": 7,
"prefill_subsidy_rate": 0,
"display_price": "₫99.000",
"has_subsidy_data": false
}
],
"total": 496,
"has_more": true
}
}
Mã lỗi của Shopee AMS (8)
Bấm để xem
| Mã | Ý nghĩa |
|---|---|
| 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_business | Không thể thực hiện nghiệp vụ Affiliate; kiểm message để biết điều kiện hoặc cài đặt cần xử lý. |
| 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 Affiliate ở trang nền tảng
- Tạo API key (tick kênh Shopee AMS)
- Gọi theo ví dụ ở trên