createPromotionRulesWorkflow - Medusa Core Workflows Reference
This documentation provides a reference to the createPromotionRulesWorkflow
. It belongs to the @medusajs/medusa/core-flows
package.
This workflow creates one or more promotion rules. It's used by other workflows, such as batchPromotionRulesWorkflow that manages the rules of a promotion.
You can use this workflow within your own customizations or custom workflows, allowing you to create promotion rules within your custom flows.
Source CodeExamples#
Steps#
Workflow hook
Step conditioned by when
View step details
Input#
AddPromotionRulesWorkflowDTO
AddPromotionRulesWorkflowDTOThe data to create rules for a promotion.
AddPromotionRulesWorkflowDTO
AddPromotionRulesWorkflowDTOrule_type
PromotionRuleTypesThe type of rules to create.
rule_type
PromotionRuleTypesdata
objectThe data to create the rules.
data
objectOutput#
PromotionRuleDTO[]
PromotionRuleDTO[]
PromotionRuleDTO[]
PromotionRuleDTO[]id
stringThe ID of the promotion rule.
id
stringvalues
PromotionRuleValueDTO[]The values of the promotion rule.
values
PromotionRuleValueDTO[]description
null | stringOptionalThe description of the promotion rule.
description
null | stringOptionalattribute
stringOptionalThe attribute of the promotion rule.
attribute
stringOptionalThe operator of the promotion rule.
Was this page helpful?