get https://app.ecwid.com/api/v3//promotions
Get all promotions from the store
Access scopes
Requires the following access scope: read_promotion
Response
A JSON array with the following fields:
Field | Type | Description |
---|---|---|
name | string | Name for the promotion. It is displayed on the checkout as the discount name. |
discountBase | string | Base from which discount is calculated on the checkout. Supports only two values: "ITEM" or "SUBTOTAL" .If "ITEM" – discount is applied only for products/categories specified in the targets array.If "SUBTOTAL" – discount will be applied to all products added to the cart. |
enabled | boolean | true if promotion is enabled, false otherwise |
discountType | string | Describes if the discount is calculated as a percent or an absolute value. Supports only two values: "PERCENT" or "ABSOLUTE" . |
amount | number | Discount amount. Value is applied as an absolute sum or a percent depending on the "discountType" field. |
triggers | Array | Triggers that define when the discount is applied. Supports restricting by date, customer group and subtotal in any combination. |
targets | Array | Limit 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:
Field | Type | Description |
---|---|---|
startDate | string | Date and time to start the promotion |
endDate | string | Date and time to end the promotion |
customerGroups | Array[number] | Customer group IDs for the promotion |
subtotal | number | Minimum cost of products added to the cart for the promotion to be applied |
Targets
Restrict promotion by specific products, categories, combintaions (product variations), and attributes:
Field | Type | Description |
---|---|---|
categories | Array[number] | Restrict promotion by a list of category IDs |
products | Array[number] | Restrict promotion by a list of product IDs |
attributes | Array | Restrict promotion by a list of attribute values |
combinations | Array | Restrict promotion by a list of product combinations |
all | boolean | Internal value (read-only) |
Attributes
Restrict the promotion by products with specific attribute values
Field | Type | Description |
---|---|---|
attributeId | number | Attribute ID |
attributeValues | Array[string] | Attribute values in products, for which the promotion should apply |
Combinations
Restrict promotion by specific product combinations:
Field | Type | Description |
---|---|---|
productId | string | Product ID |
combinationIds | Array[string] | Combination IDs for that product, for which the promotion should be applied |