Update advanced discount

Update a specific promotion existing in the store by its ID

Access scopes

Requires the following access scope: update_promotion

Path params

ParamTypeDescription
storeIdnumberEcwid store ID.
promotionIdnumberAdvanced discount ID.

Headers

The Authorization header with a secret access token is required.

HeaderFormatDescription
AuthorizationBearer secret_ab***cdAccess token of the application.

Request

Send a JSON-formatted body with some of the following fields:

FieldTypeDescription
namestringName for the promotion. It is displayed on the checkout as the discount name.
discountBasestringBase from which discount is calculated on the checkout. Supported values:
"ITEM" – discount is applied only for products/categories specified in the targets array.
"SUBTOTAL" – discount will be applied to all products added to the cart.
"SHIPPING" – discount will be applied to all products added to the cart.
enabledbooleantrue if promotion is enabled, false otherwise
discountTypestringDescribes if the discount is calculated as a percent or an absolute value. Supports only two values: "PERCENT" or "ABSOLUTE".
amountnumberDiscount amount. Value is applied as an absolute sum or a percent depending on the "discountType" field.
triggersArray triggersTriggers that define when the discount is applied. Supports restricting by date, customer group and subtotal in any combination.
targetsArray targetsLimit the discount by categories, specific products, combinations and even attributes customer group and subtotal in any combination.

triggers

Set up triggers when the discount from promotion should be applied on the checkout:

FieldTypeDescription
startDatestringDate and time to start the promotion
endDatestringDate and time to end the promotion
customerGroupsArray of numbersCustomer group IDs for the promotion
subtotalnumberMinimum cost of products added to the cart for the promotion to be applied

targets

Restrict promotion by specific products, categories, product variations (combinations), and attributes:

FieldTypeDescription
categoriesArray of numbersRestrict promotion by a list of category IDs of products added to the cart.
productsArray of numbersRestrict promotion by a list of product IDs added to the cart.
attributesArray attributesRestrict promotion by a list of attribute values of products added to the cart.
combinationsArray combinationsRestrict promotion by a list of product combinations added to the cart.
shippingMethodsArray of stringsRestrict promotion by a list of shipping method IDs one of which must selected on the checkout, e.g. [6589-1709547151586"].

Requires "discountBase": "SHIPPING".
allbooleanInternal value (read-only).

attributes

Restrict the promotion of products with specific attribute values:

FieldTypeDescription
attributeIdnumberAttribute ID.
attributeValuesArray of stringsList of matching attribute values in products, for which the promotion should apply

combinations

Restrict promotion by specific product combinations:

FieldTypeDescription
productIdstringProduct ID.
combinationIdsArray of stringsCombination IDs for that product, for which the promotion should be applied
Language
Click Try It! to start a request and see the response here!