Cart Rule
amerta / payload-types / CartRule
Interface: CartRule
Defined in: payload-types.ts:3046
This interface was referenced by Config's JSON-Schema
via the definition "cart-rules".
Properties
activeMessage?
optionalactiveMessage:string|null
Defined in: payload-types.ts:3139
Message shown when rule is active (e.g., 'You qualify for free delivery!')
applicability
applicability:
"all"|"specific_customers"|"customer_groups"
Defined in: payload-types.ts:3067
Who this rule applies to
buyXGetYBuyProduct?
optionalbuyXGetYBuyProduct:string|Product|null
Defined in: payload-types.ts:3103
Product to buy
buyXGetYBuyQuantity?
optionalbuyXGetYBuyQuantity:number|null
Defined in: payload-types.ts:3099
Buy quantity
buyXGetYDiscountType?
optionalbuyXGetYDiscountType:"fixed"|"percentage"|"free"|null
Defined in: payload-types.ts:3115
Discount type for the get product
buyXGetYDiscountValue?
optionalbuyXGetYDiscountValue:number|null
Defined in: payload-types.ts:3119
Discount amount or percentage
buyXGetYGetProduct?
optionalbuyXGetYGetProduct:string|Product|null
Defined in: payload-types.ts:3111
Product to get
buyXGetYGetQuantity?
optionalbuyXGetYGetQuantity:number|null
Defined in: payload-types.ts:3107
Get quantity (discount or free)
createdAt
createdAt:
string
Defined in: payload-types.ts:3161
customerGroups?
optionalcustomerGroups: (string|CustomerGroup)[] |null
Defined in: payload-types.ts:3127
Select customer groups
customers?
optionalcustomers: (string|User)[] |null
Defined in: payload-types.ts:3123
Select specific customers
description?
optionaldescription:string|null
Defined in: payload-types.ts:3055
Description shown to customers
discountType?
optionaldiscountType:"fixed"|"percentage"|null
Defined in: payload-types.ts:3083
Type of discount
discountValue?
optionaldiscountValue:number|null
Defined in: payload-types.ts:3087
Discount amount or percentage
expiryDate?
optionalexpiryDate:string|null
Defined in: payload-types.ts:3151
Date when rule expires (leave empty for no expiry)
freeGiftProduct?
optionalfreeGiftProduct:string|Product|null
Defined in: payload-types.ts:3091
Product to give for free
freeGiftQuantity?
optionalfreeGiftQuantity:number|null
Defined in: payload-types.ts:3095
Quantity of gift to give
id
id:
string
Defined in: payload-types.ts:3047
name
name:
string
Defined in: payload-types.ts:3051
Internal name for this rule (e.g., Free Delivery Over $50)
priority
priority:
number
Defined in: payload-types.ts:3131
Higher priority rules are applied first (0 = lowest)
ruleType
ruleType:
"free_delivery"|"discount"|"free_gift"|"buy_x_get_y"
Defined in: payload-types.ts:3059
Type of cart rule
startDate
startDate:
string
Defined in: payload-types.ts:3147
Date when rule becomes active
status
status:
"active"|"inactive"|"expired"
Defined in: payload-types.ts:3143
Rule status
timesUsed
timesUsed:
number
Defined in: payload-types.ts:3159
Number of times this rule has been used
triggerCollection?
optionaltriggerCollection: (string|Collection)[] |null
Defined in: payload-types.ts:3079
Select categories that trigger this rule
triggerProducts?
optionaltriggerProducts: (string|Product)[] |null
Defined in: payload-types.ts:3075
Select specific products that trigger this rule
triggerType
triggerType:
"collection"|"min_amount"|"min_quantity"|"specific_product"
Defined in: payload-types.ts:3063
What triggers this rule
triggerValue?
optionaltriggerValue:number|null
Defined in: payload-types.ts:3071
Minimum amount or quantity required
updatedAt
updatedAt:
string
Defined in: payload-types.ts:3160
upsellMessage?
optionalupsellMessage:string|null
Defined in: payload-types.ts:3135
Message shown to encourage customers (e.g., 'Add $X more to get free delivery')
usageLimit?
optionalusageLimit:number|null
Defined in: payload-types.ts:3155
Total usage limit (leave empty for unlimited)