VI | EN
Message us on Messenger
Developer resources

update bundle deal — Shopee API

v2.bundle_deal.update_bundle_deal · call it through Quantri360 with one API key for your own accounts / assets that you connected and authorized — 360 handles request signing and refreshing the authorization you granted.

v2.bundle_deal.update_bundle_deal

POST/api/v2/bundle_deal/update_bundle_dealVia 360: POST https://partner.quantri360.com/v1/shopee/api/v2/bundle_deal/update_bundle_deal
Write endpoint — changes data on Shopee. The key must be created with "Allow write API calls" ticked, otherwise you get 403 write_not_allowed. Every call is logged.
Description

Sửa cấu hình và các mức ưu đãi của chương trình mua theo bộ hiện có.

  • Gọi qua /v1/shopee/api/v2/bundle_deal/update_bundle_deal với Authorization: Bearer <key>; dùng platform_shop_id khi có nhiều shop. 360 tự gắn partner_id, shop_id, sign và access_token.
  • API GHI: thay đổi dữ liệu thật trên Shopee; cần key có quyền ghi (can_write) và gói mở module Khuyến mãi. Thay đổi cấu hình ưu đãi hoặc giá khuyến mãi người mua thấy.
  • HTTP 200 vẫn có thể có lỗi nghiệp vụ; kiểm error trước khi dùng kết quả. Kiểm từng phần tử trong danh sách kết quả, gồm mã lỗi và thông báo của phần tử.
  • Đọc trạng thái hiện tại bằng get_bundle_deal trước khi gọi.
  • Tối đa 1000 chương trình; tên dài 1–25 ký tự; min_amount >1 và <=3000; tối đa 3 mức, mức sau cần số lượng lớn hơn mức trước. discount_percentage từ 1 đến 99; mức đầu giảm dưới 90%. Thời gian trên 1 giờ và không quá 6 tháng.
  • Chương trình đang diễn ra không đổi rule_type, fix_price, discount_percentage, discount_value hoặc số mức; không đổi min_amount nếu có sản phẩm đang bật. Chỉ lùi thời điểm bắt đầu và rút ngắn thời điểm kết thúc; chương trình hết hạn không sửa được.

Request

Endpoint

POST https://partner.quantri360.com/v1/shopee/api/v2/bundle_deal/update_bundle_deal

Authentication & shop

NameInTypeSampleDescription
AuthorizationheaderheaderBearer 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_idquerystring100001Gian 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.

Request parameters

NameInTypeRequiredSampleDescription
rule_typebodyint32No1Loại mua theo bộ: 1 = FIX_PRICE (giá cố định), 2 = DISCOUNT_PERCENTAGE (giảm phần trăm), 3 = DISCOUNT_VALUE (giảm số tiền).
discount_valuebodyfloatNo0Số tiền được giảm khi mua bộ; dùng khi rule_type=3.
fix_pricebodyfloatNo90000Giá người mua trả cho bộ; dùng khi rule_type=1.
discount_percentagebodyint32No0Phần trăm giảm giá khi mua bộ; dùng khi rule_type=2.
min_amountbodyint32No2Số lượng sản phẩm người mua phải mua cùng nhau để đạt mức ưu đãi.
start_timebodytimestampNo1794009600Thời điểm bắt đầu, Unix giây; phải sau thời điểm hiện tại.
end_timebodytimestampNo1794182400Thời điểm kết thúc, Unix giây; phải sau thời điểm hiện tại.
namebodystringNoƯu đãi minh họaTên chương trình.
purchase_limitbodyint32No1Số bộ tối đa một người mua có thể mua.
bundle_deal_idbodyint64Yes100002Mã chương trình mua theo bộ.
additional_tiersbodyobjectNo{"min_amount":2,"fix_price":90000,"discount_value":0,"discount_percentage":0}Các mức ưu đãi bổ sung, tối đa 2 mức; fix_price, discount_percentage, discount_value phải nhất quán với mức đầu theo cùng loại quy tắc.
additional_tiers.min_amountbodyint32Yes2Số lượng sản phẩm người mua phải mua cùng nhau để đạt mức ưu đãi.
additional_tiers.fix_pricebodyfloatNo90000Giá người mua trả cho bộ; dùng khi rule_type=1.
additional_tiers.discount_valuebodyfloatNo0Số tiền được giảm khi mua bộ; dùng khi rule_type=3.
additional_tiers.discount_percentagebodyint32No0Phần trăm giảm giá khi mua bộ; dùng khi rule_type=2.

Request examples

curl -s -X POST "https://partner.quantri360.com/v1/shopee/api/v2/bundle_deal/update_bundle_deal" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"bundle_deal_id":100002,"name":"Mua bộ minh họa"}'
Python
import requests

KEY = "q360_live_..."  # khóa API của brand
r = requests.post(
    "https://partner.quantri360.com/v1/shopee/api/v2/bundle_deal/update_bundle_deal",
    params={},
    json={
        "bundle_deal_id": 100002,
        "name": "Mua bộ minh họa"
    },
    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/bundle_deal/update_bundle_deal');
for (const [k, v] of Object.entries({})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
  method: 'POST',
  headers: { Authorization: `Bearer ${KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({"bundle_deal_id":100002,"name":"Mua bộ minh họa"}),
});
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/bundle_deal/update_bundle_deal' . '?' . http_build_query([]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key, 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"bundle_deal_id":100002,"name":"Mua bộ minh họa"}');
$res = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status, "\n", $res;

Response

Response fields (as returned by Shopee)

Phản hồi minh họa thành công; đọc error/message trước khi dùng kết quả.

NameTypeSampleDescription
request_idstringd52ca43b277a4f9292fb8be658bfd33dMã request của Shopee để tra lỗi.
errorstringMã lỗi Shopee; rỗng = thành công.
messagestringMô tả lỗi.
responseobjectKết quả xử lý.
bundle_deal_idint64100002Mã chương trình mua theo bộ.
namestringƯu đãi minh họaTên chương trình.
start_timetimestamp1794009600Thời điểm bắt đầu, Unix giây; phải sau thời điểm hiện tại.
end_timetimestamp1794182400Thời điểm kết thúc, Unix giây; phải sau thời điểm hiện tại.
bundle_deal_ruleobjectQuy tắc ưu đãi mua theo bộ.
rule_typeint321Loại mua theo bộ: 1 = FIX_PRICE (giá cố định), 2 = DISCOUNT_PERCENTAGE (giảm phần trăm), 3 = DISCOUNT_VALUE (giảm số tiền).
discount_valuefloat0Số tiền được giảm khi mua bộ; dùng khi rule_type=3.
fix_pricefloat90000Giá người mua trả cho bộ; dùng khi rule_type=1.
discount_percentageint320Phần trăm giảm giá khi mua bộ; dùng khi rule_type=2.
min_amountint322Số lượng sản phẩm người mua phải mua cùng nhau để đạt mức ưu đãi.
additional_tiersobject[]Các mức ưu đãi bổ sung, tối đa 2 mức; fix_price, discount_percentage, discount_value phải nhất quán với mức đầu theo cùng loại quy tắc.
min_amountint322Số lượng sản phẩm người mua phải mua cùng nhau để đạt mức ưu đãi.
fix_pricefloat90000Giá người mua trả cho bộ; dùng khi rule_type=1.
discount_valuefloat0Số tiền được giảm khi mua bộ; dùng khi rule_type=3.
discount_percentageint320Phần trăm giảm giá khi mua bộ; dùng khi rule_type=2.
purchase_limitint321Số bộ tối đa một người mua có thể mua.

Response sample

{
  "request_id": "demo-request",
  "error": "",
  "message": "",
  "response": {
    "bundle_deal_id": 100002,
    "name": "Ưu đãi minh họa",
    "start_time": 1794009600,
    "end_time": 1794182400,
    "bundle_deal_rule": {
      "rule_type": 1,
      "discount_value": 0,
      "fix_price": 90000,
      "discount_percentage": 0,
      "min_amount": 2,
      "additional_tiers": [
        {
          "min_amount": 2,
          "fix_price": 90000,
          "discount_value": 0,
          "discount_percentage": 0
        }
      ]
    },
    "purchase_limit": 1
  }
}

Shopee error codes (31)

Show
CodeMeaning
bundle.bundle_deal_discount_value_invalid_rangeSố tiền giảm ngoài khoảng giá cho phép.
bundle.bundle_deal_end_time_errorChỉ được rút ngắn thời điểm kết thúc.
bundle.bundle_deal_error_unknownLỗi chưa xác định của dịch vụ mua theo bộ.
bundle.bundle_deal_exceed_remaining_time_limitKết thúc phải trước thời điểm tối đa được phép.
bundle.bundle_deal_fix_price_invalid_rangeGiá bộ ngoài khoảng cho phép.
bundle.bundle_deal_multi_tier_invalid_fix_price_per_itemMức cao hơn phải có giá mỗi sản phẩm thấp hơn (fix_price/min_amount).
bundle.bundle_deal_multi_tier_feature_toggleChưa được tạo chương trình nhiều mức.
bundle.bundle_deal_name_lengthTên phải dài 1–25 ký tự.
bundle.bundle_deal_no_auth_updateKhông sửa chương trình mua theo bộ do Shopee tạo.
bundle.bundle_deal_not_existsChương trình mua theo bộ không tồn tại.
bundle.bundle_deal_ongoing_promotion_info_lockĐang diễn ra không đổi loại quy tắc, giá, mức giảm hoặc số mức.
bundle.bundle_deal_ongoing_promotion_info_lock_min_amountKhông đổi min_amount khi đang diễn ra và có sản phẩm bật.
bundle.bundle_deal_over_min_amountSố lượng sản phẩm không được vượt 3000.
bundle.bundle_deal_over_tierTối đa 3 mức ưu đãi.
bundle.bundle_deal_rule_type_errorKhông đổi loại quy tắc khi đang diễn ra.
bundle.bundle_deal_rule_type_mix_useCác mức phải dùng cùng loại quy tắc.
bundle.bundle_deal_rule_type_valueLoại quy tắc mua theo bộ không hợp lệ.
bundle.bundle_deal_tier_invalidMức đầu phải giảm dưới 90%.
bundle.bundle_deal_under_min_amountSố lượng sản phẩm phải lớn hơn 1.
bundle.bundle_deal_under_min_amount_multi_tierSố lượng mức sau phải lớn hơn mức trước.
bundle.bundle_deal_invaild_discount_percentagePhần trăm giảm phải từ 1 đến 99.
error_dataDữ 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_paramTham số sai / thiếu / sai kiểu — xem `message` để biết tham số nào.
error_serverLỗi hệ thống Shopee — thử lại sau ít phút.
error_shopGian hàng không hợp lệ — kiểm tra platform_shop_id.
bundle.bundle_deal_start_time_errorThời điểm bắt đầu không hợp lệ hoặc không được phép thay đổi; xem `message`.
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_limitChạ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_limitGọ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_bannedGian hàng đang bị Shopee khóa — mọi API tạm ngưng tới khi gỡ khóa.
error_kyc_authGian hàng chưa hoàn tất đăng ký người bán trên Kênh Người Bán.

Get started

  1. Sign up for Partner
  2. Enable a data type of the Khuyến mãi (Marketing) group on the platform page
  3. Create an API key (tick the Shopee channel)
  4. Call it as in the examples above