Skip to main content

Promotion

A Promotion is used to define a set of conditions under which promotions actions (typically discounts) will be applied to an Order.

Each assigned PromotionCondition is checked against the Order, and if they all return true, then each assign PromotionItemAction / PromotionLineAction / PromotionOrderAction / PromotionShippingAction is applied to the Order.

Signature

type

property

constructor

method(input?: DeepPartial<Promotion> &#38; { promotionConditions?: Array<PromotionCondition<any>>; promotionActions?: Array<PromotionAction<any>>; }) => Promotion

deletedAt

propertyDate | null

startsAt

propertyDate | null

endsAt

propertyDate | null

couponCode

propertystring

perCustomerUsageLimit

propertynumber

usageLimit

propertynumber

name

propertyLocaleString

description

propertyLocaleString

translations

propertyArray<Translation<Promotion>>

enabled

propertyboolean

channels

propertyChannel[]

orders

propertyOrder[]

customFields

propertyCustomPromotionFields

conditions

propertyConfigurableOperation[]

actions

propertyConfigurableOperation[]

priorityScore

propertynumber

The PriorityScore is used to determine the sequence in which multiple promotions are tested on a given order. A higher number moves the Promotion towards the end of the sequence.

The score is derived from the sum of the priorityValues of the PromotionConditions and PromotionActions comprising this Promotion.

An example illustrating the need for a priority is this:

Consider 2 Promotions, 1) buy 1 get one free and 2) 10% off when order total is over $50. If Promotion 2 is evaluated prior to Promotion 1, then it can trigger the 10% discount even if the subsequent application of Promotion 1 brings the order total down to way below $50.

apply

method(ctx: RequestContext, args: ApplyOrderActionArgs | ApplyOrderItemActionArgs | ApplyShippingActionArgs, state?: PromotionState) => Promise<Adjustment | undefined>

test

method(ctx: RequestContext, order: Order) => Promise<PromotionTestResult>

activate

method(ctx: RequestContext, order: Order) =>

deactivate

method(ctx: RequestContext, order: Order) =>
Was this chapter helpful?
Report Issue
Edited Feb 10, 2026ยทEdit this page