Skip to main content

POST Create Activity

Create Activity Shop Required scope: seller.promotion.write Use this API to create a product discount activity or a flash deal activity. You cannot create a coupon activity with this API. To do that, you'll need to go to the seller center or the seller app. To update the products or SKUs included in the activity, use Update Activity Product

. Version 202309

POST/promotion/202309/activities

Request

Header

PropertiesTypeDescription
content-type RequiredstringAllowed type: application/json
x-tts-access-token RequiredstringThe seller access_token value from Get Access Token, when user_type = 0. Follow this guide to get seller access_token.

Query

PropertiesTypeDescription
app_key RequiredstringEvery single app will have a unique key. Please use the specific key assigned to your app.
sign RequiredstringSignature generated by gen algorithm. When you send API requests to TTS, you must sign them so that TTS can identify the senders.
timestamp RequiredintUnix timestamp GMT (UTC+00:00). This timestamp is used across all API requests. Developers can use this convert to local time.
shop_cipher RequiredstringUse this property to pass shop information in requesting the API. Failure in passing the correct value when requesting the API for cross-border shops will return incorrect response. Get by API Get Authorization Shop

Body

PropertiesTypeDescription
title RequiredstringUnique name across all your activities. The length must not exceed 50 characters.
activity_type RequiredstringThe type of activities.Possible enumerations:- FIXED_PRICE: product discount activity with fixed price.- DIRECT_DISCOUNT: product discount activities with percentage off.- FLASHSALE: flash sale activity.- SHIPPING_DISCOUNT: shipping fee discount.- BUY_MORE_SAVE_MORE: Buy more save more discount.- BUY_X_GET_Y: Buy X get Y.
product_level RequiredstringActivity product dimension, values are:- PRODUCT: Promotion activity applies at the product (SPU) level. Any and all SKUs that are part of this product will be subject to the promotion.- VARIATION: Promotion activity only applies to specified SKUs.- SHOP: Promotion activity applies to all products in the shop.When activity_type is SHIPPING_DISCOUNT, the product_level can not be VARIATION.To set the products or SKUs covered by the activity, use Update Activity Product.
duration_typestringThe effective time type of the current activity- NORMAL: begin_time and end_time must be filled- INDEFINITE: begin_time and end_time aren't required, and the promotion will be a long-term activity which runs indefinitely. 1. INDEFINITE is only valid when activity_type is SHIPPING_DISCOUNT,2. If duration_type is INDEFINITE, start_time and end_time should be 0Default: NORMAL
begin_time RequiredintActivity start time. UNIX timestamp. The value must be greater than the value of the current time.
end_time RequiredintActivity end time. UNIX timestamp.
participation_limit[]objectThe number of times a buyer can participate in the promotion.
discountobjectDiscount information.
target_user_infoobjectThe targeted user type of the promotion.

Example

CurlGoNode.jsJavaEnable word wrap

Response Parameters

PropertiesTypeDescription
codeintThe success or failure status code returned in API response.
messagestringThe success or failure messages returned in API response. Reasons of failure will be described in the message.
request_idstringRequest log
dataobjectSpecific return information

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. |

Is this content helpful?Helpful

Not Helpful

PreviousNext