LogoLogo
Build appsContact API support
Discounts and tips
  • Build apps
  • Site Templates
  • API Reference
  • Changelog
Discounts and tips
  • Discounts and tips overview
  • Add discounts to the store
    • Automatic discounts (promotions)
    • Discount coupons
    • Bulk discount prices for products
    • Discounts calculated on your server
  • Add tips or surcharges to the store
    • Add tips selection to the checkout
    • Apply hidden surcharges
    • Calculate surcharges on your server
  • Customize discounts
    • Set up "Buy X - Get Y" promotions
    • Set up "Free shipping" promotions
    • Set up start and end dates for discounts
    • Limit discounts to customer groups
    • Limit discounts by products and categories
    • Limit the number of discount coupon uses

Lightspeed® 2025

On this page
  • Add products from category X to receive free products from category Y
  • Add product X and receive discount on product Y
  • See also

Was this helpful?

  1. Customize discounts

Set up "Buy X - Get Y" promotions

PreviousCalculate surcharges on your serverNextSet up "Free shipping" promotions

Last updated 2 months ago

Was this helpful?

With promotions, you can set up Buy X - Get Y promotions in your store. For example, if customers add 3 any pizzas to the cart, they get a 100% discount on up to 2 drinks of their choice.

Add products from category X to receive free products from category Y

Request example for a new promotion: "Add 3 pizzas to the cart and receive two free drinks"

POST /api/v3/STOREID/promotions
Host: app.ecwid.com
Content-Type: application/json
Authorization: Bearer secret_token

{
    "name": "Free drink for any 3 pizzas",
    "discountBase": "ITEM",
    "discountType": "PERCENT",
    "amount": 100,
    "enabled": true,
    "triggers": {
        "minProductQuantityInCart": 3,
        "categories": [862076252]
    },
    "targets": {
        "maxDiscountedProductQuantity": 2,
        "categories": [375620372]
    }
}

where:

  • "discountBase": "ITEM" states that the discount from the promotion only affects products defined in the targets object.

  • triggers object contains trigger conditions – a minimum of 3 products added to the cart from the category ID 862076252 (pizzas in our case).

  • targets object defines that the discount only applies to the first two products from category ID 375620372. Products from other categories or the third and later products from category ID 375620372 won't be affected by the discount (drinks in our case).

Change STOREID with your store ID, and the secret_token with the secret access token of your app.

Add product X and receive discount on product Y

Request example for a new promotion: "Buy muffin and get 50% discount on latte"

POST /api/v3/STOREID/promotions
Host: app.ecwid.com
Content-Type: application/json
Authorization: Bearer secret_token

{
    "name": "50% discount on latte",
    "discountBase": "ITEM",
    "discountType": "PERCENT",
    "amount": 50,
    "enabled": true,
    "triggers": {
        "minProductQuantityInCart": 1,
        "products": [102039482]
    },
    "targets": {
        "maxDiscountedProductQuantity": 1,
        "products": [236754267]
    }
}

where:

  • "discountBase": "ITEM" states that the discount from the promotion only affects products defined in the targets object.

  • triggers object contains trigger conditions – a minimum of 1 product ID 102039482 in the cart (muffin in our case).

  • targets object limits the discount only to product ID 236754267 (latte in our case).

Change STOREID with your store ID, and the secret_token with the secret access token of your app.

See also

If you don't yet have an app for Ecwid API access, start with the following .

API reference on creating promotions
instructions