- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
batchPromotionRulesWorkflow - Medusa Core Workflows Reference
This documentation provides a reference to the batchPromotionRulesWorkflow
. It belongs to the @medusajs/medusa/core-flows
package.
This workflow manages a promotion's rules. It's used by the Manage Promotion Rules Admin API Route, Manage Promotion Buy Rules Admin API Route, and Manage Promotion Target Rules Admin API Route.
You can use this workflow within your own customizations or custom workflows, allowing you to manage promotion rules within your custom flows.
Source CodeExamples#
Steps#
Workflow Hook
Step conditioned by when
Input#
BatchPromotionRulesWorkflowInput
BatchPromotionRulesWorkflowInputThe data to manage a promotion's rules.
BatchPromotionRulesWorkflowInput
BatchPromotionRulesWorkflowInputid
stringThe ID of the promotion to manage the rules of.
id
stringrule_type
RuleTypeThe type of rule to manage.
rule_type
RuleTypeThe rules to create.
The rules to update.
delete
string[]OptionalThe IDs of the rules to delete.
delete
string[]OptionalOutput#
BatchPromotionRulesWorkflowOutput
BatchPromotionRulesWorkflowOutputThe result of managing the promotion's rules.
BatchPromotionRulesWorkflowOutput
BatchPromotionRulesWorkflowOutputcreated
PromotionRuleDTO[]The created rules.
created
PromotionRuleDTO[]updated
PromotionRuleDTO[]The updated rules.
updated
PromotionRuleDTO[]deleted
string[]The deleted rule IDs.
deleted
string[]Was this page helpful?