Chuyển tới nội dung chính

POST Create Activity

Tạo hoạt động Shop Scope bắt buộc: seller.promotion.write Sử dụng API này để tạo hoạt động giảm giá sản phẩm hoặc hoạt động flash deal. Bạn không thể tạo hoạt động coupon bằng API này. Để làm điều đó, bạn cần truy cập seller center hoặc seller app. Để cập nhật các sản phẩm hoặc SKU có trong hoạt động, sử dụng Update Activity Product

. Phiên bản 202309

POST/promotion/202309/activities

Request

Header

PropertiesTypeDescription
content-type RequiredstringLoại được cho phép: application/json
x-tts-access-token RequiredstringGiá trị access_token của seller từ Get Access Token, khi user_type = 0. Làm theo hướng dẫn này để lấy access_token của seller.

Query

PropertiesTypeDescription
app_key RequiredstringMỗi app sẽ có một key duy nhất. Vui lòng sử dụng key cụ thể được gán cho app của bạn.
sign RequiredstringChữ ký được tạo bởi thuật toán gen. Khi bạn gửi các API request đến TTS, bạn phải ký chúng để TTS có thể nhận diện người gửi.
timestamp RequiredintUnix timestamp GMT (UTC+00:00). Timestamp này được sử dụng trên tất cả các API request. Lập trình viên có thể dùng để chuyển đổi sang giờ địa phương.
shop_cipher RequiredstringSử dụng property này để truyền thông tin shop khi gọi API. Việc không truyền đúng giá trị khi gọi API cho các shop xuyên biên giới sẽ trả về response không chính xác. Lấy bằng API Get Authorization Shop

Body

PropertiesTypeDescription
title RequiredstringTên duy nhất trên tất cả các hoạt động của bạn. Độ dài không được vượt quá 50 ký tự.
activity_type RequiredstringLoại hoạt động.Các giá trị có thể có:- FIXED_PRICE: hoạt động giảm giá sản phẩm với mức giá cố định.- DIRECT_DISCOUNT: hoạt động giảm giá sản phẩm theo phần trăm.- FLASHSALE: hoạt động flash sale.- SHIPPING_DISCOUNT: giảm phí vận chuyển.- BUY_MORE_SAVE_MORE: giảm giá mua nhiều tiết kiệm nhiều.- BUY_X_GET_Y: mua X tặng Y.
product_level RequiredstringChiều sản phẩm của hoạt động, các giá trị là:- PRODUCT: Hoạt động khuyến mãi áp dụng ở cấp sản phẩm (SPU). Bất kỳ và tất cả các SKU thuộc sản phẩm này sẽ được áp dụng khuyến mãi.- VARIATION: Hoạt động khuyến mãi chỉ áp dụng cho các SKU được chỉ định.- SHOP: Hoạt động khuyến mãi áp dụng cho tất cả sản phẩm trong shop.Khi activity_type là SHIPPING_DISCOUNT, product_level không thể là VARIATION.Để thiết lập các sản phẩm hoặc SKU được bao gồm trong hoạt động, sử dụng Update Activity Product.
duration_typestringLoại thời gian hiệu lực của hoạt động hiện tại- NORMAL: begin_time và end_time phải được điền- INDEFINITE: begin_time và end_time không bắt buộc, và khuyến mãi sẽ là hoạt động dài hạn chạy vô thời hạn. 1. INDEFINITE chỉ hợp lệ khi activity_type là SHIPPING_DISCOUNT,2. Nếu duration_type là INDEFINITE, start_time và end_time phải là 0Mặc định: NORMAL
begin_time RequiredintThời gian bắt đầu hoạt động. UNIX timestamp. Giá trị phải lớn hơn giá trị của thời gian hiện tại.
end_time RequiredintThời gian kết thúc hoạt động. UNIX timestamp.
participation_limit[]objectSố lần một người mua có thể tham gia khuyến mãi.
discountobjectThông tin giảm giá.
target_user_infoobjectLoại người dùng mục tiêu của khuyến mãi.

Example

CurlGoNode.jsJavaEnable word wrap

Response Parameters

PropertiesTypeDescription
codeintMã trạng thái thành công hoặc thất bại được trả về trong API response.
messagestringThông báo thành công hoặc thất bại được trả về trong API response. Lý do thất bại sẽ được mô tả trong message.
request_idstringRequest log
dataobjectThông tin trả về cụ thể

Example

JSONEnable word wrap

Error Code

View common error codes

| Code | Message | | --- | --- | | 17003203 | A storewide free shipping promotion activity is already active. Only one can be created at a time. | | 17029001 | Invalid parameters | | 17029002 | Title Length Too Long | | 17029004 | Duplicate activity title. | | 17029005 | Begin Time Earlier Than Now | | 17029006 | The activity period is too short. | | 17029007 | The activity period is too long. | | 17029008 | FlashSale Period Too Long | | 17029026 | Invalid SellerID | | 17029027 | Empty RequestSerialNo | | 17029035 | ShopRisk Check Failed | | 17029036 | ActivityType is not supported. | | 17029049 | ActivityVersion is not supported. | | 17029052 | ProductType is not supported | | 17029068 | Selected inventory_type is not supported in your region. | | 17029070 | Empty gift sku info. | | 17029071 | Gift sku id is invalid, not an integer. | | 17029072 | Gift sku repeated | | 17029073 | Price of the gift exceeds the upper limit | | 17029074 | Eligible products and the gift products must not be the same product. | | 17029075 | Number of gifts per tier does not meet the limit | | 17029076 | Gift sku is out of stock. | | 17029077 | Gifts across different tiers are repeated | | 17029078 | Number of gift tiers does not meet the requirement | | 17029082 | Specified time is outside of the defined range for this activity. Please check the time range for the activity and try again. | | 36009003 | Internal error. Please try again. If the issue persists after multiple attempts, please contact platform support. |

Nội dung này có hữu ích không?Hữu ích

Không hữu ích

PreviousNext