Admin Marketing: Promotions

Create a new cart rule

Create a new cart rule

post/marketing/cart-rules

Request

Request body

namestring required
descriptionstring
channelsinteger[] required

Assigned channel ids (request stays id-based; the response returns objects).

customer_groupsinteger[] required

Assigned customer-group ids (request stays id-based; the response returns objects).

coupon_type0 | 1 required

0 = no coupon (auto-applied), 1 = specific coupon.

use_auto_generation0 | 1

When coupon_type=1: 1 = auto-generate codes, 0 = use the supplied coupon_code.

coupon_codestring

Required when coupon_type=1 and use_auto_generation=0; must be unique.

uses_per_couponinteger

Total redemptions allowed per coupon (0 = unlimited).

usage_per_customerinteger

Redemptions allowed per customer (0 = unlimited).

condition_type1 | 2

1 = all conditions true, 2 = any condition true.

conditionsobject[]

Condition rows: { attribute, operator, value, attribute_type }.

action_type'by_percent' | 'by_fixed' | 'cart_fixed' | 'buy_x_get_y' required
discount_amountnumber required

0-100 when action_type=by_percent.

discount_quantityinteger

Max quantity discounted (buy_x_get_y).

discount_stepinteger

Buy-X step (buy_x_get_y).

apply_to_shipping0 | 1

Apply the discount to shipping too.

free_shipping0 | 1
end_other_rules0 | 1

Stop processing further rules when this one matches.

sort_orderinteger

Priority (lower runs first).

starts_fromstring date-time
ends_tillstring date-time
status0 | 1

Example request

{
  "name": "10% off summer",
  "description": "Sitewide 10% off summer collection",
  "channels": [
    1
  ],
  "customer_groups": [
    1,
    2,
    3
  ],
  "coupon_type": 1,
  "coupon_code": "SUMMER10",
  "uses_per_coupon": 100,
  "usage_per_customer": 1,
  "condition_type": 1,
  "conditions": [
    {
      "attribute": "cart|base_sub_total",
      "operator": ">=",
      "value": "100",
      "attribute_type": "price"
    }
  ],
  "action_type": "by_percent",
  "discount_amount": 10,
  "discount_quantity": 1,
  "starts_from": "2026-06-01 00:00:00",
  "ends_till": "2026-08-31 23:59:59",
  "status": 1
}

Response

Cart rule created.

Changes

No recorded changes to this operation across all 8 revisions of this API.