LogoLogo
Build appsContact API support
  • Build apps
  • Site Templates
  • API Reference
  • Changelog
  • REST API
    • REST API overview
    • Store Profile
      • Get store profile
      • Update store profile
      • Upload store logo image
      • Delete store logo image
      • Store reports
        • Get store reports
        • Get latest store update stats
        • Get deleted items history
    • Orders
      • Search orders
      • Get order
      • Get last order
      • Calculate order details
      • Update order
      • Create order
      • Delete order
      • Get repeat order URL
      • Order invoices
        • Get order receipt PDF
        • Get tax invoices for order
        • Generate tax invoice for order
      • Order statuses
        • Search order statuses
        • Get order status
        • Update custom order status
      • Order extra fields
        • Search order extra fields
        • Update order extra field
        • Add extra fields to order
        • Delete order extra field
      • Abandonned carts
        • Search abandoned carts
        • Get abandoned cart
        • Update abandoned cart
        • Convert abandoned cart to order
      • Recurring subscriptions
        • Search recurring subscriptions
        • Get recurring subscription
        • Update recurring subscription
    • Products
      • Search products
      • Get product
      • Update product
      • Create product
      • Delete product
      • Delete all products
      • Adjust product stock
      • Get product filters
      • Get recently used product swatches
      • Search product brands
      • Product images and videos
        • Upload main product image
        • Upload main product image (async)
        • Upload gallery product image
        • Upload gallery product image (async)
        • Delete main product image
        • Delete gallery product image
        • Delete all gallery product images
        • Upload main product video
        • Upload gallery product video
        • Upload cover for gallery video
        • Delete main product video
        • Delete gallery product video
        • Download gallery product video
        • Bulk update product images and videos
      • Product files
        • Upload product file
        • Download product file
        • Delete product file
        • Delete all product files
        • Change product file description
      • Product variations
        • Search product variations
        • Get product variation
        • Update product variation
        • Create product variation
        • Delete product variation
        • Delete all product variations
        • Adjust product variation stock
        • Upload product variation image
        • Upload product variation image (async)
        • Delete product variation image
      • Product types and attributes
        • Search product types
        • Get product type
        • Update product type and attributes
        • Create product type
        • Delete product type
      • Product reviews
        • Search product reviews
        • Get product reviews stats
        • Update product review status
        • Bulk update/delete product reviews
        • Delete product review
    • Categories
      • Search categories
      • Search categories by path
      • Get category
      • Update category
      • Create category
      • Delete category
      • Category images
        • Upload category image
        • Upload category image (async)
        • Delete category image
      • Manage order of categories in the store
        • Get order of categories
        • Update order of categories
      • Manage order of products in the category
        • Get order of products
        • Update order of products
        • Assign products to the category
        • Unassign products from the category
    • Customers
      • Search customers
      • Get customer
      • Update customer
      • Create customer
      • Delete customer
      • Customer groups
        • Search customer groups
        • Get customer group
        • Update customer group name
        • Create customer group
        • Delete customer group
      • Customer contacts
        • Search customer contacts
        • Get customer contact
        • Update customer contact
        • Create customer contact
        • Delete customer contact
      • Customer extra fields
        • Search customer extra fields
        • Get customer extra field
        • Update customer extra field
        • Create customer extra field
        • Delete customer extra field
    • Discounts
      • Promotions
        • Search promotions
        • Update promotion
        • Create promotion
        • Delete promotion
      • Discount coupons
        • Search discount coupons
        • Get discount coupon
        • Update discount coupon
        • Create discount coupon
        • Delete discount coupon
    • Domains
      • Search store domains
      • Update store domains
      • Search domains for purchase
      • Purchase domain
      • Send domain verification email
      • Reset domain password
    • Dictionaries
      • Country codes
      • Currency codes
      • Currency codes by country
      • State codes by country
      • Tax classes by country
    • Staff accounts
      • Search staff accounts
      • Get staff account
      • Get staff account scopes
      • Update staff account
      • Create staff account
      • Delete staff account
      • Resend staff account invite
      • Cancel staff account invite
    • Application
      • Get app subscription status
      • Cancel app subscription
      • Get all app storage data
      • Get specific app storage data
      • Update specific app storage data
      • Delete specific app storage data
      • Add app storage data
      • Custom charge with Ecwid billing
    • Batch requests
      • Create batch request
      • Get batch status
      • Search batch requests by status
      • Stop batch request
      • Stop and delete batch request
    • Shipping options
      • Search shipping options
      • Update shipping option
      • Create shipping option
      • Delete shipping option
    • Payment options
      • Search payment options
      • Get payment option
      • Update payment option
      • Create payment option
      • Delete payment option
    • Checkout extra fields
      • Add checkout extra fields with JavaScript
      • Manage checkout extra fields with REST API
        • Search checkout extra fields
        • Get checkout extra field
        • Update checkout extra field
        • Create checkout extra field
        • Delete checkout extra field
    • Storefront widget details
      • Get page slug and static code
      • Set base URL for storefront widgets
      • Optimize custom website SEO with better URLs
        • Enable Clean Store URLs on a custom website
        • Set Custom Page Slugs on a custom website
      • Dynamic loading for storefront widget
      • SSO (Single-Sign-On) for websites
        • Add SSO to the website
        • Customize SSO on the website
        • SSO code examples
      • Static store pages
        • Static code for home page
        • Static code for category page
        • Static code for product page

Lightspeed® 2025

On this page
  • Required access scopes
  • Path params
  • Headers
  • Request JSON
  • Response JSON

Was this helpful?

  1. REST API
  2. Discounts
  3. Promotions

Create promotion

POST https://app.ecwid.com/api/v3/{storeId}/promotions

Required access scopes

Your app must have the following access scopes to make this request: create_promotion

Path params

All path params are required.

Param
Type
Description

storeId

number

Ecwid store ID.

Headers

The Authorization header is required.

Header
Format
Description

Authorization

Bearer secret_ab***cd

Access token of the application.

Request JSON

A JSON object with the following fields:

Field
Type
Description

name

string

Name of the discount visible at the checkout.

Max length: 1024 symbols.

discountBase

string

Base for calculating the discount at the checkout.

One of: ITEM – Discount is only applied to products matching conditions from targets array. SUBTOTAL – Discount is applied to the cart subtotal cost, ignoring product limitations from targets array. SHIPPING – Discount is only applied to shipping costs matching conditions from targets array.

enabled

boolean

Defines if the promotion is enabled (true) or disabled (false). DIsabled promotions can't be used at the checkout.

discountType

string

Describes if the discount is calculated as a percent or an absolute value.

One of:

PERCENT - Price modifier applies as a percent from the product price.

ABSOLUTE - Price modifier applies as a flat value.

amount

number

Discount amount. Value is applied as an absolute sum or a percent depending on the "discountType" field.

triggers

Trigger conditions for the promotion to apply at the checkout. Promotion is automatically applied when all specified conditions are met.

targets

Target limitations: limit promotion's application by specific categories, products, combinations, and more. Promotion is automatically applied to products in the cart if they match all specified target limitations.

triggers

Field
Type
Description

startDate

string

Datetime when the promotion becomes available at the checkout. For example, 2025-03-06 00:00:00 +0000

endDate

string

Datetime when the promotion stops being available at the checkout. For example, 2025-03-30 12:00:00 +0000

customerGroups

array of numbers

Customer group IDs for the promotion, e.g. [0, 12345, 23456].

Maximum number of IDs: 200.

subtotal

number

Minimum cart subtotal (cost of products) for the promotion to be applied.

minProductQuantityInCart

number

Minimum quantity of products in the cart for the promotion to apply at the checkout.

maxProductQuantityInCart

number

Maximum quantity of products in the cart for the promotion to apply at the checkout.

categories

array of numbers

List of category IDs for promotion trigger. All products in the cart must be from specified category IDs to trigger the promotion.

excludedCategories

array of numbers

Exclude specific category IDs from promotion triggers. If any products added to the cart belong to the specified category IDs, the promotion will not apply to the cart.

products

array of numbers

List of product IDs for promotion trigger. All products in the cart must be from this list to trigger the promotion.

excludedProducts

array of numbers

Exclude specific product IDs from promotion triggers. If any products added to the cart match the specified IDs, the promotion will not apply to the cart.

combinations

array of numbers

List of product variation IDs for promotion trigger. All product variations added to the cart must be from this list to trigger the promotion.

excludedCombinations

array of numbers

Exclude specific product variation IDs from promotion triggers. If any of the specified product variation IDs is added to the cart, the promotion will not apply to it.

recurring

boolean

Defines if the promotion has recurrence settings. Recurrent promotions automatically become active on specified days. If true, requires recurrenceSettings > activeDays array to list at least one day of the week inside.

recurrenceSettings

Recurrence settings for the promotion. Requires "recurring": true to work.

targets

Field
Type
Description

categories

array of numbers

List of category IDs. If specified, promotion only applies to products from specified category IDs.

excludedCategories

array of numbers

Exclude specific category IDs from promotion targets. Promotion will not apply to products from specified categories.

products

array of numbers

List of product IDs. If specified, promotion only applies to specified product IDs.

excludedProducts

array of numbers

Exclude specific product IDs from promotion targets. Promotion will not apply to products from the list.

combinations

List of product variations promotion works with. If specified, promotion won't work with any product variations that are not specified here.

excludedCombinations

Exclude specific product variation IDs from promotion targets. Promotion will not apply to product variations from the list.

attributes

List of product attribute values. If specified, promotion won't work with any products that don't have product attributes and values specified here.

minDiscountedProductQuantity

number

Minimum quantity of products in the cart that can be discounted by the promotion.

maxDiscountedProductQuantity

number

Maximum quantity of products in the cart that can be discounted by the promotion.

shippingMethods

array of strings

List of shipping method IDs promotion works with. If specified, promotion won't work with any shipping method that is not specified here. For example. ["6589-1709547151586"].

Requires "discountBase": "SHIPPING".

Maximum number of IDs: 100.

all

boolean

Internal value (read-only).

attributes

Field
Type
Description

attributeId

number

Internal attribute ID.

attributeValues

array of strings

List of matching attribute values in products, for which the promotion should apply. Total maximum number of attribute values across all attributes is 30.

combinations

Field
Type
Description

productId

number

Internal attribute ID.

combinationIds

array of strings

List of matching product variations IDs (in string format). Total maximum number of product variation IDs across all products is 100.

recurrenceSettings

Field
Type
Description

activeDays

array of strings

List of days when the promotion becomes active automatically. If specified and the "recurring" is true , then the promotion is only available on listed days of the week. Format of days: "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN". For example, the "weekend sale" promotion will have "activeDays": ["SAT", "SUN"].

activeDayStartTime

string

Time when the promotion activates on the listed days. If not specified, the promotion starts at 00:00. Format: 24h, hh:mm:ss. For example, "activeDayStartTime": "09:30:00".

activeDayEndTime

string

Time when the promotion deactivates on the listed days. If not specified, the promotion ends at 24:00. Format: 24h, hh:mm:ss. For example, "activeDaEndTime": "22:00:00".

Response JSON

A JSON object with the following fields:

Field
Type
Description

id

number

Internal ID of the created promotion.

Last updated 23 days ago

Was this helpful?

object

object

object

array of objects

array of objects

array of objects

triggers
targets
recurrenceSettings
combinations
combinations
attributes