Skip to main content
Skip to main content

addPromotionTargetRules - Promotion Module Reference

This documentation provides a reference to the addPromotionTargetRules method. This belongs to the Promotion Module.

This method adds target promotion rules to a promotion's application method.

Example

const targetPromotionRules =
await promotionModuleService.addPromotionTargetRules(
"promo_123",
[
{
attribute: "SKU",
operator: "eq",
values: "SHIRT",
},
]
)

Parameters

promotionIdstringRequired
The promotion's ID.
rulesDataCreatePromotionRuleDTO[]Required
The promotion rules to be created and added as target rules to the promotion's application method.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<PromotionRuleDTO[]>Required
The created promotion rules.
Was this section helpful?