DocumentationTypesInterfaces

Cart Rule

amerta


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?

optional activeMessage: 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?

optional buyXGetYBuyProduct: string | Product | null

Defined in: payload-types.ts:3103

Product to buy


buyXGetYBuyQuantity?

optional buyXGetYBuyQuantity: number | null

Defined in: payload-types.ts:3099

Buy quantity


buyXGetYDiscountType?

optional buyXGetYDiscountType: "fixed" | "percentage" | "free" | null

Defined in: payload-types.ts:3115

Discount type for the get product


buyXGetYDiscountValue?

optional buyXGetYDiscountValue: number | null

Defined in: payload-types.ts:3119

Discount amount or percentage


buyXGetYGetProduct?

optional buyXGetYGetProduct: string | Product | null

Defined in: payload-types.ts:3111

Product to get


buyXGetYGetQuantity?

optional buyXGetYGetQuantity: number | null

Defined in: payload-types.ts:3107

Get quantity (discount or free)


createdAt

createdAt: string

Defined in: payload-types.ts:3161


customerGroups?

optional customerGroups: (string | CustomerGroup)[] | null

Defined in: payload-types.ts:3127

Select customer groups


customers?

optional customers: (string | User)[] | null

Defined in: payload-types.ts:3123

Select specific customers


description?

optional description: string | null

Defined in: payload-types.ts:3055

Description shown to customers


discountType?

optional discountType: "fixed" | "percentage" | null

Defined in: payload-types.ts:3083

Type of discount


discountValue?

optional discountValue: number | null

Defined in: payload-types.ts:3087

Discount amount or percentage


expiryDate?

optional expiryDate: string | null

Defined in: payload-types.ts:3151

Date when rule expires (leave empty for no expiry)


freeGiftProduct?

optional freeGiftProduct: string | Product | null

Defined in: payload-types.ts:3091

Product to give for free


freeGiftQuantity?

optional freeGiftQuantity: 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?

optional triggerCollection: (string | Collection)[] | null

Defined in: payload-types.ts:3079

Select categories that trigger this rule


triggerProducts?

optional triggerProducts: (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?

optional triggerValue: number | null

Defined in: payload-types.ts:3071

Minimum amount or quantity required


updatedAt

updatedAt: string

Defined in: payload-types.ts:3160


upsellMessage?

optional upsellMessage: string | null

Defined in: payload-types.ts:3135

Message shown to encourage customers (e.g., 'Add $X more to get free delivery')


usageLimit?

optional usageLimit: number | null

Defined in: payload-types.ts:3155

Total usage limit (leave empty for unlimited)