Search advanced discounts

Get all promotions from the store

Request and response example

Request:

curl --location 'https://app.ecwid.com/api/v3/1003/promotions' \
--header 'Authorization: Bearer secret_ab***cd'

Response:

{
    "total": 1,
    "count": 1,
    "offset": 0,
    "limit": 100,
    "items": [
        {
            "id": 608502,
            "name": "10% off on cart total above €50,00",
            "enabled": true,
            "discountBase": "SUBTOTAL",
            "discountType": "PERCENT",
            "amount": 10,
            "triggers": {
                "subtotal": 50
            }
        }
    ]
}

Access scopes

Requires the following access scope: read_promotion

Path params

ParamTypeDescription
storeIdnumberEcwid store ID.

Query params

All query params are optional.

ParamTypeDescription
responseFieldsstringLimit JSON response by specific fields. If specified, all missing fields will be removed from the response body.
Example: ?responseFields=items(name,enabled)

Example of using responseFields param:

curl --location 'https://app.ecwid.com/api/v3/1003/promotions?responseFields=items(name,enabled)' \
--header 'Authorization: Bearer secret_ab***cd'
{
    "items": [
        {
            "name": "10% off on cart total above €50,00",
            "enabled": true
        }
    ]
}

Headers

The Authorization header with a secret access token is required.

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

Response

A JSON array with 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!