API documentation
Method list
Test your request
Changelog


addInventoryPromotion
Creates or updates an account-level catalog promotion.


Input parameters
promotion_idint(optional) Existing promotion identifier. Omit or pass 0 to create a promotion.
namevarchar(100)Promotion name. Required when creating a promotion.
is_enabledboolWhether the promotion is enabled. Required when creating a promotion.
products_filter_typeintRequired when creating a promotion. 1 - all products with a price in the source price group, 2 - tags, 3 - categories, 4 - explicit product-price list.
products_filter_dataarrayFilter payload for the selected products_filter_type. Type 1: omit this field. Type 2: tag ID array, e.g. [12, 18]. Type 3: category ID array, e.g. [3, 7]. Type 4: {"product_prices": {"": price}} with keys matching csv_identifier. Do not send a type key - use csv_identifier.
is_include_subcategoriesbool(optional) Include products from descendant categories. Used only when products_filter_type = 3. Ignored for other types.
source_price_group_idintSource price group identifier. Required for products_filter_type 1-3. Ignored when products_filter_type = 4 (stored as 0).
target_price_group_idintIndependent target price group identifier.
duration_typeint0 - unlimited, 1 - bounded date range. Required when creating a promotion.
date_startintPromotion start timestamp. Required when duration_type = 1. Ignored when duration_type = 0 (stored as 0).
date_endintPromotion end timestamp. Required when duration_type = 1. Ignored when duration_type = 0 (stored as 0).
price_multiplierfloatMultiplier applied to the source price (e.g. 0.8 means -20%). For products_filter_type 1-3 at least one of price_multiplier or price_addition is required. Ignored when products_filter_type = 4 (stored as 1).
price_additionfloatAmount added after applying the source multiplier. Can be negative. For products_filter_type 1-3 at least one of price_multiplier or price_addition is required. Ignored when products_filter_type = 4 (stored as 0).
price_roundint(optional) Price rounding after the multiplier and addition: 0 - without rounding, 1 - round up to the full amount, 2 - round down to the full amount, 3 - round up to .99, 4 - round down to .99, 5 - round up to the nearest 0.09, 6 - round down to the nearest 0.09, 7 - round up and down with an accuracy of 0.09, 8 - round to the nearest 0.10, 9 - round units to closest 5. Ignored when products_filter_type = 4 (stored and returned as 0).
csv_identifiervarchar(10)Identifier type used as keys in products_filter_data.product_prices: id or sku. Required when products_filter_type = 4. Ignored for other types.



Output data
The method returns the data in JSON format.
statusvarchar(30)SUCCESS - request executed correctly
ERROR - an error occurred during an API request. Error details will be described in 2 additional returned fields: error_message and error_code
promotion_idintCreated or updated promotion identifier.



Sample
Input data:
Output data:
A sample request in PHP: