docs: [12/n] generate core-flows reference (#8793)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-08-27 12:23:32 +03:00
1 parent d4aaf70667
commit 8553cd6427
93 files changed
+1948

No files matched your search

@@ -0,0 +1,16 @@
---
slug: /references/medusa-workflows/steps/addCampaignPromotionsStep
sidebar_label: addCampaignPromotionsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# addCampaignPromotionsStep - Medusa Workflows API Reference
This documentation provides a reference to the `addCampaignPromotionsStep`. It belongs to the `@medusajs/core-flows` package.
This step adds promotions to a campaign.
## Input
<TypeList types={[{"name":"","type":"","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"","type":"","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addCampaignPromotionsStep"/>
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/steps/addRulesToPromotionsStep
sidebar_label: addRulesToPromotionsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# addRulesToPromotionsStep - Medusa Workflows API Reference
This documentation provides a reference to the `addRulesToPromotionsStep`. It belongs to the `@medusajs/core-flows` package.
This step adds rules to a promotion.
## Input
<TypeList types={[{"name":"AddPromotionRulesWorkflowDTO","type":"`AddPromotionRulesWorkflowDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addRulesToPromotionsStep"/>
## Output
<TypeList types={[{"name":"PromotionRuleDTO[]","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionRuleDTO","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion rule details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[PromotionRuleValueDTO](../../../../../promotion/interfaces/promotion.PromotionRuleValueDTO/page.mdx)[]","description":"The values of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the promotion rule value.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../../../../promotion/types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addRulesToPromotionsStep"/>
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/steps/createCampaignsStep
sidebar_label: createCampaignsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# createCampaignsStep - Medusa Workflows API Reference
This documentation provides a reference to the `createCampaignsStep`. It belongs to the `@medusajs/core-flows` package.
This step cancels one or more campaigns.
## Input
<TypeList types={[{"name":"CreateCampaignDTO[]","type":"[CreateCampaignDTO](../../../../../promotion/interfaces/promotion.CreateCampaignDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CreateCampaignDTO","type":"[CreateCampaignDTO](../../../../../promotion/interfaces/promotion.CreateCampaignDTO/page.mdx)","optional":false,"defaultValue":"","description":"The campaign to be created.","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`null` \\| `Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`null` \\| `Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"`null` \\| [CreateCampaignBudgetDTO](../../../../../promotion/interfaces/promotion.CreateCampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"[CampaignBudgetTypeValues](../../../../../promotion/types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"How much is used of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`null` \\| `string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createCampaignsStep"/>
## Output
<TypeList types={[{"name":"CampaignDTO[]","type":"[CampaignDTO](../../../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CampaignDTO","type":"[CampaignDTO](../../../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","optional":false,"defaultValue":"","description":"The campaign details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CampaignBudgetDTO](../../../../../promotion/interfaces/promotion.CampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[CampaignBudgetTypeValues](../../../../../promotion/types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget:\n\n- `spend` indicates that the budget is limited by the amount discounted by the promotions in the associated campaign.\n- `usage` indicates that the budget is limited by the number of times the promotions of the associated campaign have been used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"The usage from the campaign budget's limit:\n\n- If the budget's type is `spend`, the value of this attribute is the amount discounted so far by the promotions in the associated campaign.\n- If the budget's type is `usage`, the value of this attribute is the number of times the promotions of the associated campaign have been used so far.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"promotions","type":"[PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","description":"The associated promotions.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_id","type":"`null` \\| `string`","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign","type":"[CampaignDTO](../../../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-developLine truncated
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/steps/createPromotionsStep
sidebar_label: createPromotionsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# createPromotionsStep - Medusa Workflows API Reference
This documentation provides a reference to the `createPromotionsStep`. It belongs to the `@medusajs/core-flows` package.
This step creates one or more promotions.
## Input
<TypeList types={[{"name":"CreatePromotionDTO[]","type":"[CreatePromotionDTO](../../../../../promotion/interfaces/promotion.CreatePromotionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CreatePromotionDTO","type":"[CreatePromotionDTO](../../../../../promotion/interfaces/promotion.CreatePromotionDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion to be created.","expandable":false,"children":[{"name":"code","type":"`string`","description":"The code of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[CreateApplicationMethodDTO](../../../../../promotion/interfaces/promotion.CreateApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"[ApplicationMethodTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../../../../promotion/types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"Currency of the value to apply.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_rules","type":"[CreatePromotionRuleDTO](../../../../../promotion/interfaces/promotion.CreatePromotionRuleDTO/page.mdx)[]","description":"The target rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules","type":"[CreatePromotionRuleDTO](../../../../../promotion/interfaces/promotion.CreatePromotionRuleDTO/page.mdx)[]","description":"The buy rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePromotionRuleDTO](../../../../../promotion/interfaces/promotion.CreatePromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../../../../proLine truncated
## Output
<TypeList types={[{"name":"PromotionDTO[]","type":"[PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionDTO","type":"[PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the application method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApplicationMethodTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../../../../promotion/types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the application method","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_rules","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The target rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The buy rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rules","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`strinLine truncated
@@ -0,0 +1,16 @@
---
slug: /references/medusa-workflows/steps/deleteCampaignsStep
sidebar_label: deleteCampaignsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteCampaignsStep - Medusa Workflows API Reference
This documentation provides a reference to the `deleteCampaignsStep`. It belongs to the `@medusajs/core-flows` package.
This step deletes one or more campaigns.
## Input
<TypeList types={[{"name":"string[]","type":"`string`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteCampaignsStep"/>
@@ -0,0 +1,16 @@
---
slug: /references/medusa-workflows/steps/deletePromotionsStep
sidebar_label: deletePromotionsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# deletePromotionsStep - Medusa Workflows API Reference
This documentation provides a reference to the `deletePromotionsStep`. It belongs to the `@medusajs/core-flows` package.
This step deletes one or more promotions.
## Input
<TypeList types={[{"name":"string[]","type":"`string`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deletePromotionsStep"/>
@@ -0,0 +1,16 @@
---
slug: /references/medusa-workflows/steps/removeCampaignPromotionsStep
sidebar_label: removeCampaignPromotionsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# removeCampaignPromotionsStep - Medusa Workflows API Reference
This documentation provides a reference to the `removeCampaignPromotionsStep`. It belongs to the `@medusajs/core-flows` package.
This step removes promotions from a campaigns.
## Input
<TypeList types={[{"name":"","type":"","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"","type":"","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="removeCampaignPromotionsStep"/>
@@ -0,0 +1,16 @@
---
slug: /references/medusa-workflows/steps/removeRulesFromPromotionsStep
sidebar_label: removeRulesFromPromotionsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# removeRulesFromPromotionsStep - Medusa Workflows API Reference
This documentation provides a reference to the `removeRulesFromPromotionsStep`. It belongs to the `@medusajs/core-flows` package.
This step removes rules from a promotion.
## Input
<TypeList types={[{"name":"RemovePromotionRulesWorkflowDTO","type":"`RemovePromotionRulesWorkflowDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="removeRulesFromPromotionsStep"/>
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/steps/updateCampaignsStep
sidebar_label: updateCampaignsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateCampaignsStep - Medusa Workflows API Reference
This documentation provides a reference to the `updateCampaignsStep`. It belongs to the `@medusajs/core-flows` package.
This step updates one or more campaigns.
## Input
<TypeList types={[{"name":"UpdateCampaignDTO[]","type":"[UpdateCampaignDTO](../../../../../promotion/interfaces/promotion.UpdateCampaignDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"UpdateCampaignDTO","type":"[UpdateCampaignDTO](../../../../../promotion/interfaces/promotion.UpdateCampaignDTO/page.mdx)","optional":false,"defaultValue":"","description":"The attributes to update in the campaign.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`null` \\| `Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`null` \\| `Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"Omit&#60;[UpdateCampaignBudgetDTO](../../../../../promotion/interfaces/promotion.UpdateCampaignBudgetDTO/page.mdx), \"id\"&#62;","description":"The budget of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"[CampaignBudgetTypeValues](../../../../../promotion/types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`null` \\| `string`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"How much is used of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateCampaignsStep"/>
## Output
<TypeList types={[{"name":"CampaignDTO[]","type":"[CampaignDTO](../../../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CampaignDTO","type":"[CampaignDTO](../../../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","optional":false,"defaultValue":"","description":"The campaign details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CampaignBudgetDTO](../../../../../promotion/interfaces/promotion.CampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[CampaignBudgetTypeValues](../../../../../promotion/types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget:\n\n- `spend` indicates that the budget is limited by the amount discounted by the promotions in the associated campaign.\n- `usage` indicates that the budget is limited by the number of times the promotions of the associated campaign have been used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"The usage from the campaign budget's limit:\n\n- If the budget's type is `spend`, the value of this attribute is the amount discounted so far by the promotions in the associated campaign.\n- If the budget's type is `usage`, the value of this attribute is the number of times the promotions of the associated campaign have been used so far.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"promotions","type":"[PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","description":"The associated promotions.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_id","type":"`null` \\| `string`","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign","type":"[CampaignDTO](../../../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-developLine truncated
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/steps/updatePromotionRulesStep
sidebar_label: updatePromotionRulesStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# updatePromotionRulesStep - Medusa Workflows API Reference
This documentation provides a reference to the `updatePromotionRulesStep`. It belongs to the `@medusajs/core-flows` package.
This step updates one or more promotion rules.
## Input
<TypeList types={[{"name":"UpdatePromotionRulesWorkflowDTO","type":"`UpdatePromotionRulesWorkflowDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updatePromotionRulesStep"/>
## Output
<TypeList types={[{"name":"PromotionRuleDTO[]","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionRuleDTO","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion rule details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[PromotionRuleValueDTO](../../../../../promotion/interfaces/promotion.PromotionRuleValueDTO/page.mdx)[]","description":"The values of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the promotion rule value.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../../../../promotion/types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updatePromotionRulesStep"/>
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/steps/updatePromotionsStep
sidebar_label: updatePromotionsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# updatePromotionsStep - Medusa Workflows API Reference
This documentation provides a reference to the `updatePromotionsStep`. It belongs to the `@medusajs/core-flows` package.
This step updates one or more promotions.
## Input
<TypeList types={[{"name":"UpdatePromotionDTO[]","type":"[UpdatePromotionDTO](../../../../../promotion/interfaces/promotion.UpdatePromotionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"UpdatePromotionDTO","type":"[UpdatePromotionDTO](../../../../../promotion/interfaces/promotion.UpdatePromotionDTO/page.mdx)","optional":false,"defaultValue":"","description":"The attributes to update in the promotion.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[UpdateApplicationMethodDTO](../../../../../promotion/interfaces/promotion.UpdateApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApplicationMethodTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../../../../promotion/types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the promotions application","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"campaign_id","type":"`null` \\| `string`","description":"The associated campaign's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updatePromotionsStep"/>
## Output
<TypeList types={[{"name":"PromotionDTO[]","type":"[PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionDTO","type":"[PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the application method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApplicationMethodTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../../../../promotion/types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the application method","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_rules","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The target rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The buy rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rules","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`strinLine truncated
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# addCampaignPromotionsStepId
`Const` **addCampaignPromotionsStepId**: `"add-campaign-promotions"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# addRulesToPromotionsStepId
`Const` **addRulesToPromotionsStepId**: `"add-rules-to-promotions"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# createCampaignsStepId
`Const` **createCampaignsStepId**: `"create-campaigns"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# createPromotionsStepId
`Const` **createPromotionsStepId**: `"create-promotions"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteCampaignsStepId
`Const` **deleteCampaignsStepId**: `"delete-campaigns"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# deletePromotionsStepId
`Const` **deletePromotionsStepId**: `"delete-promotions"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# removeCampaignPromotionsStepId
`Const` **removeCampaignPromotionsStepId**: `"remove-campaign-promotions"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# removeRulesFromPromotionsStepId
`Const` **removeRulesFromPromotionsStepId**: `"remove-rules-from-promotions"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateCampaignsStepId
`Const` **updateCampaignsStepId**: `"update-campaigns"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# updatePromotionRulesStepId
`Const` **updatePromotionRulesStepId**: `"update-promotion-rules"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# updatePromotionsStepId
`Const` **updatePromotionsStepId**: `"update-promotions"`
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/addOrRemoveCampaignPromotionsWorkflow
sidebar_label: addOrRemoveCampaignPromotionsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# addOrRemoveCampaignPromotionsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `addOrRemoveCampaignPromotionsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow adds or removes promotions from campaigns.
## Steps
<WorkflowDiagram workflow={{"name":"addOrRemoveCampaignPromotionsWorkflow","steps":[{"type":"step","name":"addCampaignPromotionsStep","description":"This step adds promotions to a campaign.","link":"../../../../core_flows.Steps_Promotion/page.mdx#addcampaignpromotionsstep","depth":1},{"type":"step","name":"removeCampaignPromotionsStep","description":"This step removes promotions from a campaigns.","link":"../../../../core_flows.Steps_Promotion/page.mdx#removecampaignpromotionsstep","depth":1}]}} />
## Input
<TypeList types={[{"name":"LinkWorkflowInput","type":"[LinkWorkflowInput](../../../../../types/CommonTypes/types/types.CommonTypes.LinkWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"add","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remove","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addOrRemoveCampaignPromotionsWorkflow"/>
@@ -0,0 +1,24 @@
---
slug: /references/medusa-workflows/batchPromotionRulesWorkflow
sidebar_label: batchPromotionRulesWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# batchPromotionRulesWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `batchPromotionRulesWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow creates, updates, or deletes promotion rules.
## Steps
<WorkflowDiagram workflow={{"name":"batchPromotionRulesWorkflow","steps":[{"type":"workflow","name":"createPromotionRulesWorkflow","description":"This workflow creates one or more promotion rules.","link":"../../../../core_flows.Workflows_Promotion/page.mdx#createpromotionrulesworkflow","depth":1},{"type":"workflow","name":"updatePromotionRulesWorkflow","description":"This workflow updates one or more promotion rules.","link":"../../../../core_flows.Workflows_Promotion/page.mdx#updatepromotionrulesworkflow","depth":1}]}} />
## Input
<TypeList types={[{"name":"BatchWorkflowInput&#60;CreatePromotionRuleDTO, UpdatePromotionRuleDTO&#62; & object","type":"[BatchWorkflowInput](../../../../../types/CommonTypes/types/types.CommonTypes.BatchWorkflowInput/page.mdx)&#60;[CreatePromotionRuleDTO](../../../../../promotion/interfaces/promotion.CreatePromotionRuleDTO/page.mdx), [UpdatePromotionRuleDTO](../../../../../promotion/interfaces/promotion.UpdatePromotionRuleDTO/page.mdx)&#62; & `object`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"BatchWorkflowInput","type":"[BatchWorkflowInput](../../../../../types/CommonTypes/types/types.CommonTypes.BatchWorkflowInput/page.mdx)&#60;[CreatePromotionRuleDTO](../../../../../promotion/interfaces/promotion.CreatePromotionRuleDTO/page.mdx), [UpdatePromotionRuleDTO](../../../../../promotion/interfaces/promotion.UpdatePromotionRuleDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CreatePromotionRuleDTO","type":"`object`","description":"The promotion rule to be created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"UpdatePromotionRuleDTO","type":"`object`","description":"The attributes to update in the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type","type":"[RuleType](../../../../../utils/PromotionUtils/enums/utils.PromotionUtils.RuleType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"RULES","type":"`\"rules\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"TARGET_RULES","type":"`\"target_rules\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"BUY_RULES","type":"`\"buy_rules\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="batchPromotionRulesWorkflow"/>
## Output
<TypeList types={[{"name":"BatchWorkflowOutput","type":"[BatchWorkflowOutput](../../../../../types/CommonTypes/types/types.CommonTypes.BatchWorkflowOutput/page.mdx)&#60;[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionRuleDTO","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion rule details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[PromotionRuleValueDTO](../../../../../promotion/interfaces/promotion.PromotionRuleValueDTO/page.mdx)[]","description":"The values of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the promotion rule value.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../../../../promotion/types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="batchPromotionRulesWorkflow"/>
@@ -0,0 +1,46 @@
---
slug: /references/medusa-workflows/createCampaignsWorkflow
sidebar_label: createCampaignsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# createCampaignsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `createCampaignsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow creates one or more campaigns.
## Steps
<WorkflowDiagram workflow={{"name":"createCampaignsWorkflow","steps":[{"type":"step","name":"createCampaignsStep","description":"This step cancels one or more campaigns.","link":"../../../../core_flows.Steps_Promotion/page.mdx#createcampaignsstep","depth":1},{"type":"hook","name":"campaignsCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#campaignsCreated","depth":2}]}} />
## Input
<TypeList types={[{"name":"CreateCampaignsWorkflowInput","type":"[CreateCampaignsWorkflowInput](../../../../types/core_flows.CreateCampaignsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"campaignsData","type":"[CreateCampaignDTO](../../../../../promotion/interfaces/promotion.CreateCampaignDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`null` \\| `Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`null` \\| `Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"`null` \\| [CreateCampaignBudgetDTO](../../../../../promotion/interfaces/promotion.CreateCampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"[CampaignBudgetTypeValues](../../../../../promotion/types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"How much is used of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`null` \\| `string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createCampaignsWorkflow"/>
## Output
<TypeList types={[{"name":"CampaignDTO[]","type":"[CampaignDTO](../../../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CampaignDTO","type":"[CampaignDTO](../../../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","optional":false,"defaultValue":"","description":"The campaign details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CampaignBudgetDTO](../../../../../promotion/interfaces/promotion.CampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[CampaignBudgetTypeValues](../../../../../promotion/types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget:\n\n- `spend` indicates that the budget is limited by the amount discounted by the promotions in the associated campaign.\n- `usage` indicates that the budget is limited by the number of times the promotions of the associated campaign have been used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"The usage from the campaign budget's limit:\n\n- If the budget's type is `spend`, the value of this attribute is the amount discounted so far by the promotions in the associated campaign.\n- If the budget's type is `usage`, the value of this attribute is the number of times the promotions of the associated campaign have been used so far.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"promotions","type":"[PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","description":"The associated promotions.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_id","type":"`null` \\| `string`","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign","type":"[CampaignDTO](../../../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-developLine truncated
## Hooks
### campaignsCreated
#### Example
```ts
import { createCampaignsWorkflow } from "@medusajs/core-flows"
createCampaignsWorkflow.hooks.campaignsCreated(
async (({ campaigns, additional_data }, { container }) => {
//TODO
})
)
```
#### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"campaigns","type":"[CampaignDTO](../../../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CampaignBudgetDTO](../../../../../promotion/interfaces/promotion.CampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotions","type":"[PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","description":"The associated promotions.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="campaignsCreated"/>
@@ -0,0 +1,24 @@
---
slug: /references/medusa-workflows/createPromotionRulesWorkflow
sidebar_label: createPromotionRulesWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# createPromotionRulesWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `createPromotionRulesWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow creates one or more promotion rules.
## Steps
<WorkflowDiagram workflow={{"name":"createPromotionRulesWorkflow","steps":[{"type":"step","name":"addRulesToPromotionsStep","description":"This step adds rules to a promotion.","link":"../../../../core_flows.Steps_Promotion/page.mdx#addrulestopromotionsstep","depth":1}]}} />
## Input
<TypeList types={[{"name":"AddPromotionRulesWorkflowDTO","type":"`AddPromotionRulesWorkflowDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createPromotionRulesWorkflow"/>
## Output
<TypeList types={[{"name":"PromotionRuleDTO[]","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionRuleDTO","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion rule details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[PromotionRuleValueDTO](../../../../../promotion/interfaces/promotion.PromotionRuleValueDTO/page.mdx)[]","description":"The values of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the promotion rule value.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../../../../promotion/types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createPromotionRulesWorkflow"/>
@@ -0,0 +1,46 @@
---
slug: /references/medusa-workflows/createPromotionsWorkflow
sidebar_label: createPromotionsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# createPromotionsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `createPromotionsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow creates one or more promotions.
## Steps
<WorkflowDiagram workflow={{"name":"createPromotionsWorkflow","steps":[{"type":"step","name":"createPromotionsStep","description":"This step creates one or more promotions.","link":"../../../../core_flows.Steps_Promotion/page.mdx#createpromotionsstep","depth":1},{"type":"hook","name":"promotionsCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#promotionsCreated","depth":2}]}} />
## Input
<TypeList types={[{"name":"CreatePromotionsWorkflowInput","type":"[CreatePromotionsWorkflowInput](../../../../types/core_flows.CreatePromotionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"promotionsData","type":"[CreatePromotionDTO](../../../../../promotion/interfaces/promotion.CreatePromotionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"code","type":"`string`","description":"The code of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[CreateApplicationMethodDTO](../../../../../promotion/interfaces/promotion.CreateApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"[ApplicationMethodTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../../../../promotion/types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"Currency of the value to apply.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_rules","type":"[CreatePromotionRuleDTO](../../../../../promotion/interfaces/promotion.CreatePromotionRuleDTO/page.mdx)[]","description":"The target rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules","type":"[CreatePromotionRuleDTO](../../../../../promotion/interfaces/promotion.CreatePromotionRuleDTO/page.mdx)[]","description":"The buy rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePromotionRuleDTO](../../../../../promotion/interfaces/promotion.CreatePromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../../../../promotion/types/promoLine truncated
## Output
<TypeList types={[{"name":"PromotionDTO[]","type":"[PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionDTO","type":"[PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the application method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApplicationMethodTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../../../../promotion/types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the application method","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_rules","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The target rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The buy rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rules","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`strinLine truncated
## Hooks
### promotionsCreated
#### Example
```ts
import { createPromotionsWorkflow } from "@medusajs/core-flows"
createPromotionsWorkflow.hooks.promotionsCreated(
async (({ promotions, additional_data }, { container }) => {
//TODO
})
)
```
#### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"promotions","type":"[PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_id","type":"`null` \\| `string`","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign","type":"[CampaignDTO](../../../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="promotionsCreated"/>
@@ -0,0 +1,42 @@
---
slug: /references/medusa-workflows/deleteCampaignsWorkflow
sidebar_label: deleteCampaignsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteCampaignsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `deleteCampaignsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow deletes one or more campaigns.
## Steps
<WorkflowDiagram workflow={{"name":"deleteCampaignsWorkflow","steps":[{"type":"step","name":"deleteCampaignsStep","description":"This step deletes one or more campaigns.","link":"../../../../core_flows.Steps_Promotion/page.mdx#deletecampaignsstep","depth":1},{"type":"hook","name":"campaignsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#campaignsDeleted","depth":2}]}} />
## Input
<TypeList types={[{"name":"DeleteCampaignsWorkflowInput","type":"[DeleteCampaignsWorkflowInput](../../../../types/core_flows.DeleteCampaignsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteCampaignsWorkflow"/>
## Hooks
### campaignsDeleted
#### Example
```ts
import { deleteCampaignsWorkflow } from "@medusajs/core-flows"
deleteCampaignsWorkflow.hooks.campaignsDeleted(
async (({ ids }, { container }) => {
//TODO
})
)
```
#### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="campaignsDeleted"/>
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/deletePromotionRulesWorkflow
sidebar_label: deletePromotionRulesWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# deletePromotionRulesWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `deletePromotionRulesWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow deletes one or more promotion rules.
## Steps
<WorkflowDiagram workflow={{"name":"deletePromotionRulesWorkflow","steps":[{"type":"step","name":"removeRulesFromPromotionsStep","description":"This step removes rules from a promotion.","link":"../../../../core_flows.Steps_Promotion/page.mdx#removerulesfrompromotionsstep","depth":1}]}} />
## Input
<TypeList types={[{"name":"RemovePromotionRulesWorkflowDTO","type":"`RemovePromotionRulesWorkflowDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deletePromotionRulesWorkflow"/>
@@ -0,0 +1,42 @@
---
slug: /references/medusa-workflows/deletePromotionsWorkflow
sidebar_label: deletePromotionsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# deletePromotionsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `deletePromotionsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow deletes one or more promotions.
## Steps
<WorkflowDiagram workflow={{"name":"deletePromotionsWorkflow","steps":[{"type":"step","name":"deletePromotionsStep","description":"This step deletes one or more promotions.","link":"../../../../core_flows.Steps_Promotion/page.mdx#deletepromotionsstep","depth":1},{"type":"hook","name":"promotionsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#promotionsDeleted","depth":2}]}} />
## Input
<TypeList types={[{"name":"DeletePromotionsWorkflowInput","type":"[DeletePromotionsWorkflowInput](../../../../types/core_flows.DeletePromotionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deletePromotionsWorkflow"/>
## Hooks
### promotionsDeleted
#### Example
```ts
import { deletePromotionsWorkflow } from "@medusajs/core-flows"
deletePromotionsWorkflow.hooks.promotionsDeleted(
async (({ ids }, { container }) => {
//TODO
})
)
```
#### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="promotionsDeleted"/>
@@ -0,0 +1,46 @@
---
slug: /references/medusa-workflows/updateCampaignsWorkflow
sidebar_label: updateCampaignsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateCampaignsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `updateCampaignsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow updates one or more campaigns.
## Steps
<WorkflowDiagram workflow={{"name":"updateCampaignsWorkflow","steps":[{"type":"step","name":"updateCampaignsStep","description":"This step updates one or more campaigns.","link":"../../../../core_flows.Steps_Promotion/page.mdx#updatecampaignsstep","depth":1},{"type":"hook","name":"campaignsUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#campaignsUpdated","depth":2}]}} />
## Input
<TypeList types={[{"name":"UpdateCampaignsWorkflowInput","type":"[UpdateCampaignsWorkflowInput](../../../../types/core_flows.UpdateCampaignsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"campaignsData","type":"[UpdateCampaignDTO](../../../../../promotion/interfaces/promotion.UpdateCampaignDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`null` \\| `Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`null` \\| `Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"Omit&#60;[UpdateCampaignBudgetDTO](../../../../../promotion/interfaces/promotion.UpdateCampaignBudgetDTO/page.mdx), \"id\"&#62;","description":"The budget of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"[CampaignBudgetTypeValues](../../../../../promotion/types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`null` \\| `string`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"How much is used of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateCampaignsWorkflow"/>
## Output
<TypeList types={[{"name":"CampaignDTO[]","type":"[CampaignDTO](../../../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CampaignDTO","type":"[CampaignDTO](../../../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","optional":false,"defaultValue":"","description":"The campaign details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CampaignBudgetDTO](../../../../../promotion/interfaces/promotion.CampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[CampaignBudgetTypeValues](../../../../../promotion/types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget:\n\n- `spend` indicates that the budget is limited by the amount discounted by the promotions in the associated campaign.\n- `usage` indicates that the budget is limited by the number of times the promotions of the associated campaign have been used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"The usage from the campaign budget's limit:\n\n- If the budget's type is `spend`, the value of this attribute is the amount discounted so far by the promotions in the associated campaign.\n- If the budget's type is `usage`, the value of this attribute is the number of times the promotions of the associated campaign have been used so far.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"promotions","type":"[PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","description":"The associated promotions.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_id","type":"`null` \\| `string`","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign","type":"[CampaignDTO](../../../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-developLine truncated
## Hooks
### campaignsUpdated
#### Example
```ts
import { updateCampaignsWorkflow } from "@medusajs/core-flows"
updateCampaignsWorkflow.hooks.campaignsUpdated(
async (({ campaigns, additional_data }, { container }) => {
//TODO
})
)
```
#### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"campaigns","type":"[CampaignDTO](../../../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CampaignBudgetDTO](../../../../../promotion/interfaces/promotion.CampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotions","type":"[PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","description":"The associated promotions.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="campaignsUpdated"/>
@@ -0,0 +1,24 @@
---
slug: /references/medusa-workflows/updatePromotionRulesWorkflow
sidebar_label: updatePromotionRulesWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# updatePromotionRulesWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `updatePromotionRulesWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow updates one or more promotion rules.
## Steps
<WorkflowDiagram workflow={{"name":"updatePromotionRulesWorkflow","steps":[{"type":"step","name":"updatePromotionRulesStep","description":"This step updates one or more promotion rules.","link":"../../../../core_flows.Steps_Promotion/page.mdx#updatepromotionrulesstep","depth":1}]}} />
## Input
<TypeList types={[{"name":"UpdatePromotionRulesWorkflowDTO","type":"`UpdatePromotionRulesWorkflowDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updatePromotionRulesWorkflow"/>
## Output
<TypeList types={[{"name":"PromotionRuleDTO[]","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionRuleDTO","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion rule details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[PromotionRuleValueDTO](../../../../../promotion/interfaces/promotion.PromotionRuleValueDTO/page.mdx)[]","description":"The values of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the promotion rule value.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../../../../promotion/types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updatePromotionRulesWorkflow"/>
@@ -0,0 +1,46 @@
---
slug: /references/medusa-workflows/updatePromotionsWorkflow
sidebar_label: updatePromotionsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# updatePromotionsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `updatePromotionsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow updates one or more promotions.
## Steps
<WorkflowDiagram workflow={{"name":"updatePromotionsWorkflow","steps":[{"type":"step","name":"updatePromotionsStep","description":"This step updates one or more promotions.","link":"../../../../core_flows.Steps_Promotion/page.mdx#updatepromotionsstep","depth":1},{"type":"hook","name":"promotionsUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#promotionsUpdated","depth":2}]}} />
## Input
<TypeList types={[{"name":"UpdatePromotionsWorkflowInput","type":"[UpdatePromotionsWorkflowInput](../../../../types/core_flows.UpdatePromotionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"promotionsData","type":"[UpdatePromotionDTO](../../../../../promotion/interfaces/promotion.UpdatePromotionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[UpdateApplicationMethodDTO](../../../../../promotion/interfaces/promotion.UpdateApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApplicationMethodTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../../../../promotion/types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the promotions application","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"campaign_id","type":"`null` \\| `string`","description":"The associated campaign's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updatePromotionsWorkflow"/>
## Output
<TypeList types={[{"name":"PromotionDTO[]","type":"[PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionDTO","type":"[PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the application method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApplicationMethodTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../../../../promotion/types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the application method","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_rules","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The target rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The buy rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rules","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`strinLine truncated
## Hooks
### promotionsUpdated
#### Example
```ts
import { updatePromotionsWorkflow } from "@medusajs/core-flows"
updatePromotionsWorkflow.hooks.promotionsUpdated(
async (({ promotions, additional_data }, { container }) => {
//TODO
})
)
```
#### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"promotions","type":"[PromotionDTO](../../../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[PromotionRuleDTO](../../../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_id","type":"`null` \\| `string`","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign","type":"[CampaignDTO](../../../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="promotionsUpdated"/>
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# addOrRemoveCampaignPromotionsWorkflowId
`Const` **addOrRemoveCampaignPromotionsWorkflowId**: `"add-or-remove-campaign-promotions"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# batchPromotionRulesWorkflowId
`Const` **batchPromotionRulesWorkflowId**: `"batch-promotion-rules"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# createCampaignsWorkflowId
`Const` **createCampaignsWorkflowId**: `"create-campaigns"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# createPromotionRulesWorkflowId
`Const` **createPromotionRulesWorkflowId**: `"create-promotion-rules-workflow"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# createPromotionsWorkflowId
`Const` **createPromotionsWorkflowId**: `"create-promotions"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteCampaignsWorkflowId
`Const` **deleteCampaignsWorkflowId**: `"delete-campaigns"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# deletePromotionRulesWorkflowId
`Const` **deletePromotionRulesWorkflowId**: `"delete-promotion-rules-workflow"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# deletePromotionsWorkflowId
`Const` **deletePromotionsWorkflowId**: `"delete-promotions"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateCampaignsWorkflowId
`Const` **updateCampaignsWorkflowId**: `"update-campaigns"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# updatePromotionRulesWorkflowId
`Const` **updatePromotionRulesWorkflowId**: `"update-promotion-rules-workflow"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# updatePromotionsWorkflowId
`Const` **updatePromotionsWorkflowId**: `"update-promotions"`
@@ -0,0 +1,135 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# Steps\_Promotion
## addCampaignPromotionsStep
This step adds promotions to a campaign.
### Input
<TypeList types={[{"name":"","type":"","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"","type":"","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addCampaignPromotionsStep"/>
___
## addRulesToPromotionsStep
This step adds rules to a promotion.
### Input
<TypeList types={[{"name":"AddPromotionRulesWorkflowDTO","type":"`AddPromotionRulesWorkflowDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addRulesToPromotionsStep"/>
### Output
<TypeList types={[{"name":"PromotionRuleDTO[]","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionRuleDTO","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion rule details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[PromotionRuleValueDTO](../../../promotion/interfaces/promotion.PromotionRuleValueDTO/page.mdx)[]","description":"The values of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the promotion rule value.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../../promotion/types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addRulesToPromotionsStep"/>
___
## createCampaignsStep
This step cancels one or more campaigns.
### Input
<TypeList types={[{"name":"CreateCampaignDTO[]","type":"[CreateCampaignDTO](../../../promotion/interfaces/promotion.CreateCampaignDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CreateCampaignDTO","type":"[CreateCampaignDTO](../../../promotion/interfaces/promotion.CreateCampaignDTO/page.mdx)","optional":false,"defaultValue":"","description":"The campaign to be created.","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`null` \\| `Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`null` \\| `Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"`null` \\| [CreateCampaignBudgetDTO](../../../promotion/interfaces/promotion.CreateCampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"[CampaignBudgetTypeValues](../../../promotion/types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"How much is used of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`null` \\| `string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createCampaignsStep"/>
### Output
<TypeList types={[{"name":"CampaignDTO[]","type":"[CampaignDTO](../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CampaignDTO","type":"[CampaignDTO](../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","optional":false,"defaultValue":"","description":"The campaign details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CampaignBudgetDTO](../../../promotion/interfaces/promotion.CampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[CampaignBudgetTypeValues](../../../promotion/types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget:\n\n- `spend` indicates that the budget is limited by the amount discounted by the promotions in the associated campaign.\n- `usage` indicates that the budget is limited by the number of times the promotions of the associated campaign have been used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"The usage from the campaign budget's limit:\n\n- If the budget's type is `spend`, the value of this attribute is the amount discounted so far by the promotions in the associated campaign.\n- If the budget's type is `usage`, the value of this attribute is the number of times the promotions of the associated campaign have been used so far.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"promotions","type":"[PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","description":"The associated promotions.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_id","type":"`null` \\| `string`","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign","type":"[CampaignDTO](../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-recordsLine truncated
___
## createPromotionsStep
This step creates one or more promotions.
### Input
<TypeList types={[{"name":"CreatePromotionDTO[]","type":"[CreatePromotionDTO](../../../promotion/interfaces/promotion.CreatePromotionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CreatePromotionDTO","type":"[CreatePromotionDTO](../../../promotion/interfaces/promotion.CreatePromotionDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion to be created.","expandable":false,"children":[{"name":"code","type":"`string`","description":"The code of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[CreateApplicationMethodDTO](../../../promotion/interfaces/promotion.CreateApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"[ApplicationMethodTypeValues](../../../promotion/types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../../promotion/types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"Currency of the value to apply.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_rules","type":"[CreatePromotionRuleDTO](../../../promotion/interfaces/promotion.CreatePromotionRuleDTO/page.mdx)[]","description":"The target rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules","type":"[CreatePromotionRuleDTO](../../../promotion/interfaces/promotion.CreatePromotionRuleDTO/page.mdx)[]","description":"The buy rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePromotionRuleDTO](../../../promotion/interfaces/promotion.CreatePromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../../promotion/types/promotion.PromotionRuleOperatorValues/page.mdx)","descriptiLine truncated
### Output
<TypeList types={[{"name":"PromotionDTO[]","type":"[PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionDTO","type":"[PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the application method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApplicationMethodTypeValues](../../../promotion/types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../../promotion/types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the application method","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_rules","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The target rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The buy rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rules","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule.","optional":falseLine truncated
___
## deleteCampaignsStep
This step deletes one or more campaigns.
### Input
<TypeList types={[{"name":"string[]","type":"`string`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteCampaignsStep"/>
___
## deletePromotionsStep
This step deletes one or more promotions.
### Input
<TypeList types={[{"name":"string[]","type":"`string`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deletePromotionsStep"/>
___
## removeCampaignPromotionsStep
This step removes promotions from a campaigns.
### Input
<TypeList types={[{"name":"","type":"","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"","type":"","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="removeCampaignPromotionsStep"/>
___
## removeRulesFromPromotionsStep
This step removes rules from a promotion.
### Input
<TypeList types={[{"name":"RemovePromotionRulesWorkflowDTO","type":"`RemovePromotionRulesWorkflowDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="removeRulesFromPromotionsStep"/>
___
## updateCampaignsStep
This step updates one or more campaigns.
### Input
<TypeList types={[{"name":"UpdateCampaignDTO[]","type":"[UpdateCampaignDTO](../../../promotion/interfaces/promotion.UpdateCampaignDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"UpdateCampaignDTO","type":"[UpdateCampaignDTO](../../../promotion/interfaces/promotion.UpdateCampaignDTO/page.mdx)","optional":false,"defaultValue":"","description":"The attributes to update in the campaign.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`null` \\| `Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`null` \\| `Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"Omit&#60;[UpdateCampaignBudgetDTO](../../../promotion/interfaces/promotion.UpdateCampaignBudgetDTO/page.mdx), \"id\"&#62;","description":"The budget of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"[CampaignBudgetTypeValues](../../../promotion/types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`null` \\| `string`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"How much is used of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateCampaignsStep"/>
### Output
<TypeList types={[{"name":"CampaignDTO[]","type":"[CampaignDTO](../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CampaignDTO","type":"[CampaignDTO](../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","optional":false,"defaultValue":"","description":"The campaign details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CampaignBudgetDTO](../../../promotion/interfaces/promotion.CampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[CampaignBudgetTypeValues](../../../promotion/types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget:\n\n- `spend` indicates that the budget is limited by the amount discounted by the promotions in the associated campaign.\n- `usage` indicates that the budget is limited by the number of times the promotions of the associated campaign have been used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"The usage from the campaign budget's limit:\n\n- If the budget's type is `spend`, the value of this attribute is the amount discounted so far by the promotions in the associated campaign.\n- If the budget's type is `usage`, the value of this attribute is the number of times the promotions of the associated campaign have been used so far.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"promotions","type":"[PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","description":"The associated promotions.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_id","type":"`null` \\| `string`","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign","type":"[CampaignDTO](../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-recordsLine truncated
___
## updatePromotionRulesStep
This step updates one or more promotion rules.
### Input
<TypeList types={[{"name":"UpdatePromotionRulesWorkflowDTO","type":"`UpdatePromotionRulesWorkflowDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updatePromotionRulesStep"/>
### Output
<TypeList types={[{"name":"PromotionRuleDTO[]","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionRuleDTO","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion rule details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[PromotionRuleValueDTO](../../../promotion/interfaces/promotion.PromotionRuleValueDTO/page.mdx)[]","description":"The values of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the promotion rule value.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../../promotion/types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updatePromotionRulesStep"/>
___
## updatePromotionsStep
This step updates one or more promotions.
### Input
<TypeList types={[{"name":"UpdatePromotionDTO[]","type":"[UpdatePromotionDTO](../../../promotion/interfaces/promotion.UpdatePromotionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"UpdatePromotionDTO","type":"[UpdatePromotionDTO](../../../promotion/interfaces/promotion.UpdatePromotionDTO/page.mdx)","optional":false,"defaultValue":"","description":"The attributes to update in the promotion.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[UpdateApplicationMethodDTO](../../../promotion/interfaces/promotion.UpdateApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApplicationMethodTypeValues](../../../promotion/types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../../promotion/types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the promotions application","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"campaign_id","type":"`null` \\| `string`","description":"The associated campaign's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updatePromotionsStep"/>
### Output
<TypeList types={[{"name":"PromotionDTO[]","type":"[PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionDTO","type":"[PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the application method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApplicationMethodTypeValues](../../../promotion/types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../../promotion/types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the application method","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_rules","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The target rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The buy rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rules","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule.","optional":falseLine truncated
@@ -0,0 +1,315 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# Workflows\_Promotion
## addOrRemoveCampaignPromotionsWorkflow
This workflow adds or removes promotions from campaigns.
### Steps
<WorkflowDiagram workflow={{"name":"addOrRemoveCampaignPromotionsWorkflow","steps":[{"type":"step","name":"addCampaignPromotionsStep","description":"This step adds promotions to a campaign.","link":"../../core_flows.Steps_Promotion/page.mdx#addcampaignpromotionsstep","depth":1},{"type":"step","name":"removeCampaignPromotionsStep","description":"This step removes promotions from a campaigns.","link":"../../core_flows.Steps_Promotion/page.mdx#removecampaignpromotionsstep","depth":1}]}} />
### Input
<TypeList types={[{"name":"LinkWorkflowInput","type":"[LinkWorkflowInput](../../../types/CommonTypes/types/types.CommonTypes.LinkWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"add","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remove","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addOrRemoveCampaignPromotionsWorkflow"/>
___
## batchPromotionRulesWorkflow
This workflow creates, updates, or deletes promotion rules.
### Steps
<WorkflowDiagram workflow={{"name":"batchPromotionRulesWorkflow","steps":[{"type":"workflow","name":"createPromotionRulesWorkflow","description":"This workflow creates one or more promotion rules.","link":"../../core_flows.Workflows_Promotion/page.mdx#createpromotionrulesworkflow","depth":1},{"type":"workflow","name":"updatePromotionRulesWorkflow","description":"This workflow updates one or more promotion rules.","link":"../../core_flows.Workflows_Promotion/page.mdx#updatepromotionrulesworkflow","depth":1}]}} />
### Input
<TypeList types={[{"name":"BatchWorkflowInput&#60;CreatePromotionRuleDTO, UpdatePromotionRuleDTO&#62; & object","type":"[BatchWorkflowInput](../../../types/CommonTypes/types/types.CommonTypes.BatchWorkflowInput/page.mdx)&#60;[CreatePromotionRuleDTO](../../../promotion/interfaces/promotion.CreatePromotionRuleDTO/page.mdx), [UpdatePromotionRuleDTO](../../../promotion/interfaces/promotion.UpdatePromotionRuleDTO/page.mdx)&#62; & `object`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"BatchWorkflowInput","type":"[BatchWorkflowInput](../../../types/CommonTypes/types/types.CommonTypes.BatchWorkflowInput/page.mdx)&#60;[CreatePromotionRuleDTO](../../../promotion/interfaces/promotion.CreatePromotionRuleDTO/page.mdx), [UpdatePromotionRuleDTO](../../../promotion/interfaces/promotion.UpdatePromotionRuleDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CreatePromotionRuleDTO","type":"`object`","description":"The promotion rule to be created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"UpdatePromotionRuleDTO","type":"`object`","description":"The attributes to update in the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rule_type","type":"[RuleType](../../../utils/PromotionUtils/enums/utils.PromotionUtils.RuleType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"RULES","type":"`\"rules\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"TARGET_RULES","type":"`\"target_rules\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"BUY_RULES","type":"`\"buy_rules\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="batchPromotionRulesWorkflow"/>
### Output
<TypeList types={[{"name":"BatchWorkflowOutput","type":"[BatchWorkflowOutput](../../../types/CommonTypes/types/types.CommonTypes.BatchWorkflowOutput/page.mdx)&#60;[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionRuleDTO","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion rule details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[PromotionRuleValueDTO](../../../promotion/interfaces/promotion.PromotionRuleValueDTO/page.mdx)[]","description":"The values of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the promotion rule value.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../../promotion/types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="batchPromotionRulesWorkflow"/>
___
## createCampaignsWorkflow
This workflow creates one or more campaigns.
### Steps
<WorkflowDiagram workflow={{"name":"createCampaignsWorkflow","steps":[{"type":"step","name":"createCampaignsStep","description":"This step cancels one or more campaigns.","link":"../../core_flows.Steps_Promotion/page.mdx#createcampaignsstep","depth":1},{"type":"hook","name":"campaignsCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#campaignsCreated","depth":2}]}} />
### Input
<TypeList types={[{"name":"CreateCampaignsWorkflowInput","type":"[CreateCampaignsWorkflowInput](../../types/core_flows.CreateCampaignsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"campaignsData","type":"[CreateCampaignDTO](../../../promotion/interfaces/promotion.CreateCampaignDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`null` \\| `Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`null` \\| `Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"`null` \\| [CreateCampaignBudgetDTO](../../../promotion/interfaces/promotion.CreateCampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"[CampaignBudgetTypeValues](../../../promotion/types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"How much is used of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`null` \\| `string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createCampaignsWorkflow"/>
### Output
<TypeList types={[{"name":"CampaignDTO[]","type":"[CampaignDTO](../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CampaignDTO","type":"[CampaignDTO](../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","optional":false,"defaultValue":"","description":"The campaign details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CampaignBudgetDTO](../../../promotion/interfaces/promotion.CampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[CampaignBudgetTypeValues](../../../promotion/types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget:\n\n- `spend` indicates that the budget is limited by the amount discounted by the promotions in the associated campaign.\n- `usage` indicates that the budget is limited by the number of times the promotions of the associated campaign have been used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"The usage from the campaign budget's limit:\n\n- If the budget's type is `spend`, the value of this attribute is the amount discounted so far by the promotions in the associated campaign.\n- If the budget's type is `usage`, the value of this attribute is the number of times the promotions of the associated campaign have been used so far.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"promotions","type":"[PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","description":"The associated promotions.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_id","type":"`null` \\| `string`","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign","type":"[CampaignDTO](../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-recordsLine truncated
### Hooks
#### campaignsCreated
##### Example
```ts
import { createCampaignsWorkflow } from "@medusajs/core-flows"
createCampaignsWorkflow.hooks.campaignsCreated(
async (({ campaigns, additional_data }, { container }) => {
//TODO
})
)
```
##### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"campaigns","type":"[CampaignDTO](../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CampaignBudgetDTO](../../../promotion/interfaces/promotion.CampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotions","type":"[PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","description":"The associated promotions.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="campaignsCreated"/>
___
## createPromotionRulesWorkflow
This workflow creates one or more promotion rules.
### Steps
<WorkflowDiagram workflow={{"name":"createPromotionRulesWorkflow","steps":[{"type":"step","name":"addRulesToPromotionsStep","description":"This step adds rules to a promotion.","link":"../../core_flows.Steps_Promotion/page.mdx#addrulestopromotionsstep","depth":1}]}} />
### Input
<TypeList types={[{"name":"AddPromotionRulesWorkflowDTO","type":"`AddPromotionRulesWorkflowDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createPromotionRulesWorkflow"/>
### Output
<TypeList types={[{"name":"PromotionRuleDTO[]","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionRuleDTO","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion rule details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[PromotionRuleValueDTO](../../../promotion/interfaces/promotion.PromotionRuleValueDTO/page.mdx)[]","description":"The values of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the promotion rule value.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../../promotion/types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createPromotionRulesWorkflow"/>
___
## createPromotionsWorkflow
This workflow creates one or more promotions.
### Steps
<WorkflowDiagram workflow={{"name":"createPromotionsWorkflow","steps":[{"type":"step","name":"createPromotionsStep","description":"This step creates one or more promotions.","link":"../../core_flows.Steps_Promotion/page.mdx#createpromotionsstep","depth":1},{"type":"hook","name":"promotionsCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#promotionsCreated","depth":2}]}} />
### Input
<TypeList types={[{"name":"CreatePromotionsWorkflowInput","type":"[CreatePromotionsWorkflowInput](../../types/core_flows.CreatePromotionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"promotionsData","type":"[CreatePromotionDTO](../../../promotion/interfaces/promotion.CreatePromotionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"code","type":"`string`","description":"The code of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[CreateApplicationMethodDTO](../../../promotion/interfaces/promotion.CreateApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"[ApplicationMethodTypeValues](../../../promotion/types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../../promotion/types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"Currency of the value to apply.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_rules","type":"[CreatePromotionRuleDTO](../../../promotion/interfaces/promotion.CreatePromotionRuleDTO/page.mdx)[]","description":"The target rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules","type":"[CreatePromotionRuleDTO](../../../promotion/interfaces/promotion.CreatePromotionRuleDTO/page.mdx)[]","description":"The buy rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePromotionRuleDTO](../../../promotion/interfaces/promotion.CreatePromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../../promotion/types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator Line truncated
### Output
<TypeList types={[{"name":"PromotionDTO[]","type":"[PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionDTO","type":"[PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the application method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApplicationMethodTypeValues](../../../promotion/types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../../promotion/types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the application method","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_rules","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The target rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The buy rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rules","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule.","optional":falseLine truncated
### Hooks
#### promotionsCreated
##### Example
```ts
import { createPromotionsWorkflow } from "@medusajs/core-flows"
createPromotionsWorkflow.hooks.promotionsCreated(
async (({ promotions, additional_data }, { container }) => {
//TODO
})
)
```
##### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"promotions","type":"[PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_id","type":"`null` \\| `string`","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign","type":"[CampaignDTO](../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="promotionsCreated"/>
___
## deleteCampaignsWorkflow
This workflow deletes one or more campaigns.
### Steps
<WorkflowDiagram workflow={{"name":"deleteCampaignsWorkflow","steps":[{"type":"step","name":"deleteCampaignsStep","description":"This step deletes one or more campaigns.","link":"../../core_flows.Steps_Promotion/page.mdx#deletecampaignsstep","depth":1},{"type":"hook","name":"campaignsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#campaignsDeleted","depth":2}]}} />
### Input
<TypeList types={[{"name":"DeleteCampaignsWorkflowInput","type":"[DeleteCampaignsWorkflowInput](../../types/core_flows.DeleteCampaignsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteCampaignsWorkflow"/>
### Hooks
#### campaignsDeleted
##### Example
```ts
import { deleteCampaignsWorkflow } from "@medusajs/core-flows"
deleteCampaignsWorkflow.hooks.campaignsDeleted(
async (({ ids }, { container }) => {
//TODO
})
)
```
##### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="campaignsDeleted"/>
___
## deletePromotionRulesWorkflow
This workflow deletes one or more promotion rules.
### Steps
<WorkflowDiagram workflow={{"name":"deletePromotionRulesWorkflow","steps":[{"type":"step","name":"removeRulesFromPromotionsStep","description":"This step removes rules from a promotion.","link":"../../core_flows.Steps_Promotion/page.mdx#removerulesfrompromotionsstep","depth":1}]}} />
### Input
<TypeList types={[{"name":"RemovePromotionRulesWorkflowDTO","type":"`RemovePromotionRulesWorkflowDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deletePromotionRulesWorkflow"/>
___
## deletePromotionsWorkflow
This workflow deletes one or more promotions.
### Steps
<WorkflowDiagram workflow={{"name":"deletePromotionsWorkflow","steps":[{"type":"step","name":"deletePromotionsStep","description":"This step deletes one or more promotions.","link":"../../core_flows.Steps_Promotion/page.mdx#deletepromotionsstep","depth":1},{"type":"hook","name":"promotionsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#promotionsDeleted","depth":2}]}} />
### Input
<TypeList types={[{"name":"DeletePromotionsWorkflowInput","type":"[DeletePromotionsWorkflowInput](../../types/core_flows.DeletePromotionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deletePromotionsWorkflow"/>
### Hooks
#### promotionsDeleted
##### Example
```ts
import { deletePromotionsWorkflow } from "@medusajs/core-flows"
deletePromotionsWorkflow.hooks.promotionsDeleted(
async (({ ids }, { container }) => {
//TODO
})
)
```
##### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="promotionsDeleted"/>
___
## updateCampaignsWorkflow
This workflow updates one or more campaigns.
### Steps
<WorkflowDiagram workflow={{"name":"updateCampaignsWorkflow","steps":[{"type":"step","name":"updateCampaignsStep","description":"This step updates one or more campaigns.","link":"../../core_flows.Steps_Promotion/page.mdx#updatecampaignsstep","depth":1},{"type":"hook","name":"campaignsUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#campaignsUpdated","depth":2}]}} />
### Input
<TypeList types={[{"name":"UpdateCampaignsWorkflowInput","type":"[UpdateCampaignsWorkflowInput](../../types/core_flows.UpdateCampaignsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"campaignsData","type":"[UpdateCampaignDTO](../../../promotion/interfaces/promotion.UpdateCampaignDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`null` \\| `Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`null` \\| `Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"Omit&#60;[UpdateCampaignBudgetDTO](../../../promotion/interfaces/promotion.UpdateCampaignBudgetDTO/page.mdx), \"id\"&#62;","description":"The budget of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"[CampaignBudgetTypeValues](../../../promotion/types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`null` \\| `string`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"How much is used of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateCampaignsWorkflow"/>
### Output
<TypeList types={[{"name":"CampaignDTO[]","type":"[CampaignDTO](../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CampaignDTO","type":"[CampaignDTO](../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","optional":false,"defaultValue":"","description":"The campaign details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CampaignBudgetDTO](../../../promotion/interfaces/promotion.CampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[CampaignBudgetTypeValues](../../../promotion/types/promotion.CampaignBudgetTypeValues/page.mdx)","description":"The type of the campaign budget:\n\n- `spend` indicates that the budget is limited by the amount discounted by the promotions in the associated campaign.\n- `usage` indicates that the budget is limited by the number of times the promotions of the associated campaign have been used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`null` \\| `number`","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`number`","description":"The usage from the campaign budget's limit:\n\n- If the budget's type is `spend`, the value of this attribute is the amount discounted so far by the promotions in the associated campaign.\n- If the budget's type is `usage`, the value of this attribute is the number of times the promotions of the associated campaign have been used so far.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"promotions","type":"[PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","description":"The associated promotions.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_id","type":"`null` \\| `string`","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign","type":"[CampaignDTO](../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-recordsLine truncated
### Hooks
#### campaignsUpdated
##### Example
```ts
import { updateCampaignsWorkflow } from "@medusajs/core-flows"
updateCampaignsWorkflow.hooks.campaignsUpdated(
async (({ campaigns, additional_data }, { container }) => {
//TODO
})
)
```
##### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"campaigns","type":"[CampaignDTO](../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"`string`","description":"The campaign identifier of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`Date`","description":"The start date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`Date`","description":"The end date of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"[CampaignBudgetDTO](../../../promotion/interfaces/promotion.CampaignBudgetDTO/page.mdx)","description":"The associated campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotions","type":"[PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","description":"The associated promotions.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="campaignsUpdated"/>
___
## updatePromotionRulesWorkflow
This workflow updates one or more promotion rules.
### Steps
<WorkflowDiagram workflow={{"name":"updatePromotionRulesWorkflow","steps":[{"type":"step","name":"updatePromotionRulesStep","description":"This step updates one or more promotion rules.","link":"../../core_flows.Steps_Promotion/page.mdx#updatepromotionrulesstep","depth":1}]}} />
### Input
<TypeList types={[{"name":"UpdatePromotionRulesWorkflowDTO","type":"`UpdatePromotionRulesWorkflowDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updatePromotionRulesWorkflow"/>
### Output
<TypeList types={[{"name":"PromotionRuleDTO[]","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionRuleDTO","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion rule details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[PromotionRuleValueDTO](../../../promotion/interfaces/promotion.PromotionRuleValueDTO/page.mdx)[]","description":"The values of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the promotion rule value.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"description","type":"`null` \\| `string`","description":"The description of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attribute","type":"`string`","description":"The attribute of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"operator","type":"[PromotionRuleOperatorValues](../../../promotion/types/promotion.PromotionRuleOperatorValues/page.mdx)","description":"The operator of the promotion rule.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updatePromotionRulesWorkflow"/>
___
## updatePromotionsWorkflow
This workflow updates one or more promotions.
### Steps
<WorkflowDiagram workflow={{"name":"updatePromotionsWorkflow","steps":[{"type":"step","name":"updatePromotionsStep","description":"This step updates one or more promotions.","link":"../../core_flows.Steps_Promotion/page.mdx#updatepromotionsstep","depth":1},{"type":"hook","name":"promotionsUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#promotionsUpdated","depth":2}]}} />
### Input
<TypeList types={[{"name":"UpdatePromotionsWorkflowInput","type":"[UpdatePromotionsWorkflowInput](../../types/core_flows.UpdatePromotionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"promotionsData","type":"[UpdatePromotionDTO](../../../promotion/interfaces/promotion.UpdatePromotionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[UpdateApplicationMethodDTO](../../../promotion/interfaces/promotion.UpdateApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApplicationMethodTypeValues](../../../promotion/types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../../promotion/types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the promotions application","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"campaign_id","type":"`null` \\| `string`","description":"The associated campaign's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updatePromotionsWorkflow"/>
### Output
<TypeList types={[{"name":"PromotionDTO[]","type":"[PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"PromotionDTO","type":"[PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","optional":false,"defaultValue":"","description":"The promotion details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the application method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApplicationMethodTypeValues](../../../promotion/types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of the application method indicating how\nthe associated promotion is applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"[ApplicationMethodTargetTypeValues](../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The target type of the application method indicating\nwhether the associated promotion is applied to the cart's items,\nshipping methods, or the whole order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"[ApplicationMethodAllocationValues](../../../promotion/types/promotion.ApplicationMethodAllocationValues/page.mdx)","description":"The allocation value that indicates whether the associated promotion\nis applied on each item in a cart or split between the items in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`number`","description":"The discounted amount applied by the associated promotion based on the `type`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the application method","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required for a `buyget` promotion to be applied.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the\nvalue of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`null` \\| `number`","description":"The quantity that results from matching the `buyget` promotion's condition.\nFor example, if the promotion is a \"Buy 2 shirts get 1 free\", the value\nof this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"`string` \\| [PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)","description":"The promotion of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"target_rules","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The target rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The buy rules of the application method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rules","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion rule.","optional":falseLine truncated
### Hooks
#### promotionsUpdated
##### Example
```ts
import { updatePromotionsWorkflow } from "@medusajs/core-flows"
updatePromotionsWorkflow.hooks.promotionsUpdated(
async (({ promotions, additional_data }, { container }) => {
//TODO
})
)
```
##### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"promotions","type":"[PromotionDTO](../../../promotion/interfaces/promotion.PromotionDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[PromotionTypeValues](../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of the promotion:\n\n- `standard` indicates that a promotion is a standard one applied with conditions.\n- `buyget` indicates that a promotion is a \"Buy X get Y\" promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"`boolean`","description":"Whether the promotion is applied automatically.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method","type":"[ApplicationMethodDTO](../../../promotion/interfaces/promotion.ApplicationMethodDTO/page.mdx)","description":"The associated application method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[PromotionRuleDTO](../../../promotion/interfaces/promotion.PromotionRuleDTO/page.mdx)[]","description":"The rules of the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_id","type":"`null` \\| `string`","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign","type":"[CampaignDTO](../../../promotion/interfaces/promotion.CampaignDTO/page.mdx)","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="promotionsUpdated"/>
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/steps/createReservationsStep
sidebar_label: createReservationsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# createReservationsStep - Medusa Workflows API Reference
This documentation provides a reference to the `createReservationsStep`. It belongs to the `@medusajs/core-flows` package.
This step creates one or more reservations.
## Input
<TypeList types={[{"name":"CreateReservationItemInput[]","type":"[CreateReservationItemInput](../../../../../types/InventoryTypes/interfaces/types.InventoryTypes.CreateReservationItemInput/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CreateReservationItemInput","type":"[CreateReservationItemInput](../../../../../types/InventoryTypes/interfaces/types.InventoryTypes.CreateReservationItemInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the reservation item to be created.","expandable":false,"children":[{"name":"inventory_item_id","type":"`string`","description":"The ID of the associated inventory item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The ID of the associated location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"[BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"The reserved quantity.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The ID of the associated line item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Allow backorder of the item. If true, it won't check inventory levels before reserving it.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"The user or system that created the reservation. Can be any form of identification string.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"An ID associated with an external third-party system that the reservation item is connected to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createReservationsStep"/>
## Output
<TypeList types={[{"name":"ReservationItemDTO[]","type":"[ReservationItemDTO](../../../../../types/InventoryTypes/interfaces/types.InventoryTypes.ReservationItemDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ReservationItemDTO","type":"[ReservationItemDTO](../../../../../types/InventoryTypes/interfaces/types.InventoryTypes.ReservationItemDTO/page.mdx)","optional":false,"defaultValue":"","description":"The reservation item details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"The associated inventory item's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"[BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"The quantity of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string` \\| `Date`","description":"The deletion date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The associated line item's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Allow backorder of the item. If true, it won't check inventory levels before reserving it.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"The created by of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createReservationsStep"/>
@@ -0,0 +1,16 @@
---
slug: /references/medusa-workflows/steps/deleteReservationsByLineItemsStep
sidebar_label: deleteReservationsByLineItemsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteReservationsByLineItemsStep - Medusa Workflows API Reference
This documentation provides a reference to the `deleteReservationsByLineItemsStep`. It belongs to the `@medusajs/core-flows` package.
This step deletes reservations by their associated line items.
## Input
<TypeList types={[{"name":"string[]","type":"`string`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteReservationsByLineItemsStep"/>
@@ -0,0 +1,16 @@
---
slug: /references/medusa-workflows/steps/deleteReservationsStep
sidebar_label: deleteReservationsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteReservationsStep - Medusa Workflows API Reference
This documentation provides a reference to the `deleteReservationsStep`. It belongs to the `@medusajs/core-flows` package.
This step deletes one or more reservations.
## Input
<TypeList types={[{"name":"string[]","type":"`string`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteReservationsStep"/>
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/steps/updateReservationsStep
sidebar_label: updateReservationsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateReservationsStep - Medusa Workflows API Reference
This documentation provides a reference to the `updateReservationsStep`. It belongs to the `@medusajs/core-flows` package.
This step updates one or more reservations.
## Input
<TypeList types={[{"name":"UpdateReservationItemInput[]","type":"[UpdateReservationItemInput](../../../../../types/InventoryTypes/interfaces/types.InventoryTypes.UpdateReservationItemInput/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"UpdateReservationItemInput","type":"[UpdateReservationItemInput](../../../../../types/InventoryTypes/interfaces/types.InventoryTypes.UpdateReservationItemInput/page.mdx)","optional":false,"defaultValue":"","description":"The attributes to update in a reservation item.","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"[BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"The reserved quantity.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"location_id","type":"`string`","description":"The ID of the associated location.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Allow backorder of the item. If true, it won't check inventory levels before reserving it.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateReservationsStep"/>
## Output
<TypeList types={[{"name":"ReservationItemDTO[]","type":"[ReservationItemDTO](../../../../../types/InventoryTypes/interfaces/types.InventoryTypes.ReservationItemDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ReservationItemDTO","type":"[ReservationItemDTO](../../../../../types/InventoryTypes/interfaces/types.InventoryTypes.ReservationItemDTO/page.mdx)","optional":false,"defaultValue":"","description":"The reservation item details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"The associated inventory item's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"[BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"The quantity of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string` \\| `Date`","description":"The deletion date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The associated line item's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Allow backorder of the item. If true, it won't check inventory levels before reserving it.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"The created by of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateReservationsStep"/>
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# createReservationsStepId
`Const` **createReservationsStepId**: `"create-reservations-step"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteReservationsByLineItemsStepId
`Const` **deleteReservationsByLineItemsStepId**: `"delete-reservations-by-line-items"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteReservationsStepId
`Const` **deleteReservationsStepId**: `"delete-reservations"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateReservationsStepId
`Const` **updateReservationsStepId**: `"update-reservations-step"`
@@ -0,0 +1,24 @@
---
slug: /references/medusa-workflows/createReservationsWorkflow
sidebar_label: createReservationsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# createReservationsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `createReservationsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow creates one or more reservations.
## Steps
<WorkflowDiagram workflow={{"name":"createReservationsWorkflow","steps":[{"type":"step","name":"createReservationsStep","description":"This step creates one or more reservations.","link":"../../../../core_flows.Steps_Reservation/page.mdx#createreservationsstep","depth":1}]}} />
## Input
<TypeList types={[{"name":"CreateReservationsWorkflowInput","type":"[CreateReservationsWorkflowInput](../../../../../types/WorkflowTypes/ReservationWorkflow/interfaces/types.WorkflowTypes.ReservationWorkflow.CreateReservationsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"reservations","type":"[CreateReservationItemInput](../../../../../types/InventoryTypes/interfaces/types.InventoryTypes.CreateReservationItemInput/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"inventory_item_id","type":"`string`","description":"The ID of the associated inventory item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The ID of the associated location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"[BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"The reserved quantity.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The ID of the associated line item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Allow backorder of the item. If true, it won't check inventory levels before reserving it.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"The user or system that created the reservation. Can be any form of identification string.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"An ID associated with an external third-party system that the reservation item is connected to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createReservationsWorkflow"/>
## Output
<TypeList types={[{"name":"CreateReservationsWorkflowOutput","type":"[CreateReservationsWorkflowOutput](../../../../../types/WorkflowTypes/ReservationWorkflow/types/types.WorkflowTypes.ReservationWorkflow.CreateReservationsWorkflowOutput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"The associated inventory item's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"[BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"The quantity of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string` \\| `Date`","description":"The deletion date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The associated line item's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Allow backorder of the item. If true, it won't check inventory levels before reserving it.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"The created by of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createReservationsWorkflow"/>
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/deleteReservationsByLineItemsWorkflow
sidebar_label: deleteReservationsByLineItemsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteReservationsByLineItemsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `deleteReservationsByLineItemsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow deletes reservations by their associated line items.
## Steps
<WorkflowDiagram workflow={{"name":"deleteReservationsByLineItemsWorkflow","steps":[{"type":"step","name":"deleteReservationsByLineItemsStep","description":"This step deletes reservations by their associated line items.","link":"../../../../core_flows.Steps_Reservation/page.mdx#deletereservationsbylineitemsstep","depth":1}]}} />
## Input
<TypeList types={[{"name":"DeleteReservationByLineItemsWorkflowInput","type":"[DeleteReservationByLineItemsWorkflowInput](../../../../types/core_flows.DeleteReservationByLineItemsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteReservationsByLineItemsWorkflow"/>
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/deleteReservationsWorkflow
sidebar_label: deleteReservationsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteReservationsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `deleteReservationsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow deletes one or more reservations.
## Steps
<WorkflowDiagram workflow={{"name":"deleteReservationsWorkflow","steps":[{"type":"step","name":"deleteReservationsStep","description":"This step deletes one or more reservations.","link":"../../../../core_flows.Steps_Reservation/page.mdx#deletereservationsstep","depth":1}]}} />
## Input
<TypeList types={[{"name":"WorkflowInput","type":"`WorkflowInput`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteReservationsWorkflow"/>
@@ -0,0 +1,24 @@
---
slug: /references/medusa-workflows/updateReservationsWorkflow
sidebar_label: updateReservationsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateReservationsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `updateReservationsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow updates one or more reservations.
## Steps
<WorkflowDiagram workflow={{"name":"updateReservationsWorkflow","steps":[{"type":"step","name":"updateReservationsStep","description":"This step updates one or more reservations.","link":"../../../../core_flows.Steps_Reservation/page.mdx#updatereservationsstep","depth":1}]}} />
## Input
<TypeList types={[{"name":"UpdateReservationsWorkflowInput","type":"[UpdateReservationsWorkflowInput](../../../../../types/WorkflowTypes/ReservationWorkflow/interfaces/types.WorkflowTypes.ReservationWorkflow.UpdateReservationsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"updates","type":"[UpdateReservationItemInput](../../../../../types/InventoryTypes/interfaces/types.InventoryTypes.UpdateReservationItemInput/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"[BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"The reserved quantity.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"location_id","type":"`string`","description":"The ID of the associated location.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Allow backorder of the item. If true, it won't check inventory levels before reserving it.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateReservationsWorkflow"/>
## Output
<TypeList types={[{"name":"UpdateReservationsWorkflowOutput","type":"[UpdateReservationsWorkflowOutput](../../../../../types/WorkflowTypes/ReservationWorkflow/types/types.WorkflowTypes.ReservationWorkflow.UpdateReservationsWorkflowOutput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"The associated inventory item's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"[BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"The quantity of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string` \\| `Date`","description":"The deletion date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The associated line item's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Allow backorder of the item. If true, it won't check inventory levels before reserving it.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"The created by of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateReservationsWorkflow"/>
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# createReservationsWorkflowId
`Const` **createReservationsWorkflowId**: `"create-reservations-workflow"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteReservationsByLineItemsWorkflowId
`Const` **deleteReservationsByLineItemsWorkflowId**: `"delete-reservations-by-line-items"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteReservationsWorkflowId
`Const` **deleteReservationsWorkflowId**: `"delete-reservations"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateReservationsWorkflowId
`Const` **updateReservationsWorkflowId**: `"update-reservations-workflow"`
@@ -0,0 +1,49 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# Steps\_Reservation
## createReservationsStep
This step creates one or more reservations.
### Input
<TypeList types={[{"name":"CreateReservationItemInput[]","type":"[CreateReservationItemInput](../../../types/InventoryTypes/interfaces/types.InventoryTypes.CreateReservationItemInput/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CreateReservationItemInput","type":"[CreateReservationItemInput](../../../types/InventoryTypes/interfaces/types.InventoryTypes.CreateReservationItemInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the reservation item to be created.","expandable":false,"children":[{"name":"inventory_item_id","type":"`string`","description":"The ID of the associated inventory item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The ID of the associated location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"[BigNumberInput](../../../types/types/types.BigNumberInput/page.mdx)","description":"The reserved quantity.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The ID of the associated line item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Allow backorder of the item. If true, it won't check inventory levels before reserving it.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"The user or system that created the reservation. Can be any form of identification string.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"An ID associated with an external third-party system that the reservation item is connected to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createReservationsStep"/>
### Output
<TypeList types={[{"name":"ReservationItemDTO[]","type":"[ReservationItemDTO](../../../types/InventoryTypes/interfaces/types.InventoryTypes.ReservationItemDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ReservationItemDTO","type":"[ReservationItemDTO](../../../types/InventoryTypes/interfaces/types.InventoryTypes.ReservationItemDTO/page.mdx)","optional":false,"defaultValue":"","description":"The reservation item details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"The associated inventory item's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"[BigNumberInput](../../../types/types/types.BigNumberInput/page.mdx)","description":"The quantity of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string` \\| `Date`","description":"The deletion date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The associated line item's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Allow backorder of the item. If true, it won't check inventory levels before reserving it.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"The created by of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createReservationsStep"/>
___
## deleteReservationsByLineItemsStep
This step deletes reservations by their associated line items.
### Input
<TypeList types={[{"name":"string[]","type":"`string`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteReservationsByLineItemsStep"/>
___
## deleteReservationsStep
This step deletes one or more reservations.
### Input
<TypeList types={[{"name":"string[]","type":"`string`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteReservationsStep"/>
___
## updateReservationsStep
This step updates one or more reservations.
### Input
<TypeList types={[{"name":"UpdateReservationItemInput[]","type":"[UpdateReservationItemInput](../../../types/InventoryTypes/interfaces/types.InventoryTypes.UpdateReservationItemInput/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"UpdateReservationItemInput","type":"[UpdateReservationItemInput](../../../types/InventoryTypes/interfaces/types.InventoryTypes.UpdateReservationItemInput/page.mdx)","optional":false,"defaultValue":"","description":"The attributes to update in a reservation item.","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"[BigNumberInput](../../../types/types/types.BigNumberInput/page.mdx)","description":"The reserved quantity.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"location_id","type":"`string`","description":"The ID of the associated location.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Allow backorder of the item. If true, it won't check inventory levels before reserving it.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateReservationsStep"/>
### Output
<TypeList types={[{"name":"ReservationItemDTO[]","type":"[ReservationItemDTO](../../../types/InventoryTypes/interfaces/types.InventoryTypes.ReservationItemDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ReservationItemDTO","type":"[ReservationItemDTO](../../../types/InventoryTypes/interfaces/types.InventoryTypes.ReservationItemDTO/page.mdx)","optional":false,"defaultValue":"","description":"The reservation item details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"The associated inventory item's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"[BigNumberInput](../../../types/types/types.BigNumberInput/page.mdx)","description":"The quantity of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string` \\| `Date`","description":"The deletion date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The associated line item's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Allow backorder of the item. If true, it won't check inventory levels before reserving it.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"The created by of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateReservationsStep"/>
@@ -0,0 +1,65 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# Workflows\_Reservation
## createReservationsWorkflow
This workflow creates one or more reservations.
### Steps
<WorkflowDiagram workflow={{"name":"createReservationsWorkflow","steps":[{"type":"step","name":"createReservationsStep","description":"This step creates one or more reservations.","link":"../../core_flows.Steps_Reservation/page.mdx#createreservationsstep","depth":1}]}} />
### Input
<TypeList types={[{"name":"CreateReservationsWorkflowInput","type":"[CreateReservationsWorkflowInput](../../../types/WorkflowTypes/ReservationWorkflow/interfaces/types.WorkflowTypes.ReservationWorkflow.CreateReservationsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"reservations","type":"[CreateReservationItemInput](../../../types/InventoryTypes/interfaces/types.InventoryTypes.CreateReservationItemInput/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"inventory_item_id","type":"`string`","description":"The ID of the associated inventory item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The ID of the associated location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"[BigNumberInput](../../../types/types/types.BigNumberInput/page.mdx)","description":"The reserved quantity.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The ID of the associated line item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Allow backorder of the item. If true, it won't check inventory levels before reserving it.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"The user or system that created the reservation. Can be any form of identification string.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"An ID associated with an external third-party system that the reservation item is connected to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createReservationsWorkflow"/>
### Output
<TypeList types={[{"name":"CreateReservationsWorkflowOutput","type":"[CreateReservationsWorkflowOutput](../../../types/WorkflowTypes/ReservationWorkflow/types/types.WorkflowTypes.ReservationWorkflow.CreateReservationsWorkflowOutput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"The associated inventory item's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"[BigNumberInput](../../../types/types/types.BigNumberInput/page.mdx)","description":"The quantity of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string` \\| `Date`","description":"The deletion date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The associated line item's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Allow backorder of the item. If true, it won't check inventory levels before reserving it.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"The created by of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createReservationsWorkflow"/>
___
## deleteReservationsByLineItemsWorkflow
This workflow deletes reservations by their associated line items.
### Steps
<WorkflowDiagram workflow={{"name":"deleteReservationsByLineItemsWorkflow","steps":[{"type":"step","name":"deleteReservationsByLineItemsStep","description":"This step deletes reservations by their associated line items.","link":"../../core_flows.Steps_Reservation/page.mdx#deletereservationsbylineitemsstep","depth":1}]}} />
### Input
<TypeList types={[{"name":"DeleteReservationByLineItemsWorkflowInput","type":"[DeleteReservationByLineItemsWorkflowInput](../../types/core_flows.DeleteReservationByLineItemsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteReservationsByLineItemsWorkflow"/>
___
## deleteReservationsWorkflow
This workflow deletes one or more reservations.
### Steps
<WorkflowDiagram workflow={{"name":"deleteReservationsWorkflow","steps":[{"type":"step","name":"deleteReservationsStep","description":"This step deletes one or more reservations.","link":"../../core_flows.Steps_Reservation/page.mdx#deletereservationsstep","depth":1}]}} />
### Input
<TypeList types={[{"name":"WorkflowInput","type":"`WorkflowInput`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteReservationsWorkflow"/>
___
## updateReservationsWorkflow
This workflow updates one or more reservations.
### Steps
<WorkflowDiagram workflow={{"name":"updateReservationsWorkflow","steps":[{"type":"step","name":"updateReservationsStep","description":"This step updates one or more reservations.","link":"../../core_flows.Steps_Reservation/page.mdx#updatereservationsstep","depth":1}]}} />
### Input
<TypeList types={[{"name":"UpdateReservationsWorkflowInput","type":"[UpdateReservationsWorkflowInput](../../../types/WorkflowTypes/ReservationWorkflow/interfaces/types.WorkflowTypes.ReservationWorkflow.UpdateReservationsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"updates","type":"[UpdateReservationItemInput](../../../types/InventoryTypes/interfaces/types.InventoryTypes.UpdateReservationItemInput/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"[BigNumberInput](../../../types/types/types.BigNumberInput/page.mdx)","description":"The reserved quantity.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"location_id","type":"`string`","description":"The ID of the associated location.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Allow backorder of the item. If true, it won't check inventory levels before reserving it.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateReservationsWorkflow"/>
### Output
<TypeList types={[{"name":"UpdateReservationsWorkflowOutput","type":"[UpdateReservationsWorkflowOutput](../../../types/WorkflowTypes/ReservationWorkflow/types/types.WorkflowTypes.ReservationWorkflow.UpdateReservationsWorkflowOutput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"The associated inventory item's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"[BigNumberInput](../../../types/types/types.BigNumberInput/page.mdx)","description":"The quantity of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string` \\| `Date`","description":"The deletion date of the reservation item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The associated line item's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Allow backorder of the item. If true, it won't check inventory levels before reserving it.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"The created by of the reservation item.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateReservationsWorkflow"/>
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/steps/associateLocationsWithSalesChannelsStep
sidebar_label: associateLocationsWithSalesChannelsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# associateLocationsWithSalesChannelsStep - Medusa Workflows API Reference
This documentation provides a reference to the `associateLocationsWithSalesChannelsStep`. It belongs to the `@medusajs/core-flows` package.
This step creates links between locations and sales channel records.
## Input
<TypeList types={[{"name":"AssociateLocationsWithSalesChannelsStepInput","type":"[AssociateLocationsWithSalesChannelsStepInput](../../../../interfaces/core_flows.AssociateLocationsWithSalesChannelsStepInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"links","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"sales_channel_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="associateLocationsWithSalesChannelsStep"/>
## Output
<TypeList types={[{"name":"unknown[]","type":"`unknown`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"unknown","type":"`unknown`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="associateLocationsWithSalesChannelsStep"/>
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/steps/associateProductsWithSalesChannelsStep
sidebar_label: associateProductsWithSalesChannelsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# associateProductsWithSalesChannelsStep - Medusa Workflows API Reference
This documentation provides a reference to the `associateProductsWithSalesChannelsStep`. It belongs to the `@medusajs/core-flows` package.
This step creates links between products and sales channel records.
## Input
<TypeList types={[{"name":"AssociateProductsWithSalesChannelsStepInput","type":"[AssociateProductsWithSalesChannelsStepInput](../../../../interfaces/core_flows.AssociateProductsWithSalesChannelsStepInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"links","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"sales_channel_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="associateProductsWithSalesChannelsStep"/>
## Output
<TypeList types={[{"name":"unknown[]","type":"`unknown`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"unknown","type":"`unknown`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="associateProductsWithSalesChannelsStep"/>
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/steps/createDefaultSalesChannelStep
sidebar_label: createDefaultSalesChannelStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# createDefaultSalesChannelStep - Medusa Workflows API Reference
This documentation provides a reference to the `createDefaultSalesChannelStep`. It belongs to the `@medusajs/core-flows` package.
This step creates a default sales channel.
## Input
<TypeList types={[{"name":"CreateDefaultSalesChannelStepInput","type":"[CreateDefaultSalesChannelStepInput](../../../../interfaces/core_flows.CreateDefaultSalesChannelStepInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"data","type":"[CreateSalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.CreateSalesChannelDTO/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createDefaultSalesChannelStep"/>
## Output
<TypeList types={[{"name":"SalesChannelDTO","type":"[SalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locations","type":"[SalesChannelLocationDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelLocationDTO/page.mdx)[]","description":"The locations of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"sales_channel_id","type":"`string`","description":"The associated sales channel's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel","type":"[SalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","description":"The associated sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locations","type":"[SalesChannelLocationDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelLocationDTO/page.mdx)[]","description":"The locations of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createDefaultSalesChannelStep"/>
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/steps/createSalesChannelsStep
sidebar_label: createSalesChannelsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# createSalesChannelsStep - Medusa Workflows API Reference
This documentation provides a reference to the `createSalesChannelsStep`. It belongs to the `@medusajs/core-flows` package.
This step creates one or more sales channels.
## Input
<TypeList types={[{"name":"CreateSalesChannelsStepInput","type":"[CreateSalesChannelsStepInput](../../../../interfaces/core_flows.CreateSalesChannelsStepInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"data","type":"[CreateSalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.CreateSalesChannelDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createSalesChannelsStep"/>
## Output
<TypeList types={[{"name":"SalesChannelDTO[]","type":"[SalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"SalesChannelDTO","type":"[SalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","optional":false,"defaultValue":"","description":"The sales channel details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locations","type":"[SalesChannelLocationDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelLocationDTO/page.mdx)[]","description":"The locations of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"sales_channel_id","type":"`string`","description":"The associated sales channel's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel","type":"[SalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","description":"The associated sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createSalesChannelsStep"/>
@@ -0,0 +1,16 @@
---
slug: /references/medusa-workflows/steps/deleteSalesChannelsStep
sidebar_label: deleteSalesChannelsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteSalesChannelsStep - Medusa Workflows API Reference
This documentation provides a reference to the `deleteSalesChannelsStep`. It belongs to the `@medusajs/core-flows` package.
This step deletes one or more sales channels.
## Input
<TypeList types={[{"name":"string[]","type":"`string`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteSalesChannelsStep"/>
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/steps/detachLocationsFromSalesChannelsStep
sidebar_label: detachLocationsFromSalesChannelsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# detachLocationsFromSalesChannelsStep - Medusa Workflows API Reference
This documentation provides a reference to the `detachLocationsFromSalesChannelsStep`. It belongs to the `@medusajs/core-flows` package.
This step dismisses links between location and sales channel records.
## Input
<TypeList types={[{"name":"DetachLocationsFromSalesChannelsStepInput","type":"[DetachLocationsFromSalesChannelsStepInput](../../../../interfaces/core_flows.DetachLocationsFromSalesChannelsStepInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"links","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"sales_channel_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="detachLocationsFromSalesChannelsStep"/>
## Output
<TypeList types={[{"name":"never[]","type":"`never`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"never","type":"`never`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="detachLocationsFromSalesChannelsStep"/>
@@ -0,0 +1,16 @@
---
slug: /references/medusa-workflows/steps/detachProductsFromSalesChannelsStep
sidebar_label: detachProductsFromSalesChannelsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# detachProductsFromSalesChannelsStep - Medusa Workflows API Reference
This documentation provides a reference to the `detachProductsFromSalesChannelsStep`. It belongs to the `@medusajs/core-flows` package.
This step dismisses links between product and sales channel records.
## Input
<TypeList types={[{"name":"DetachProductsFromSalesChannelsStepInput","type":"[DetachProductsFromSalesChannelsStepInput](../../../../interfaces/core_flows.DetachProductsFromSalesChannelsStepInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"links","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"sales_channel_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="detachProductsFromSalesChannelsStep"/>
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/steps/updateSalesChannelsStep
sidebar_label: updateSalesChannelsStep
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateSalesChannelsStep - Medusa Workflows API Reference
This documentation provides a reference to the `updateSalesChannelsStep`. It belongs to the `@medusajs/core-flows` package.
This step updates sales channels matching the specified filters.
## Input
<TypeList types={[{"name":"UpdateSalesChannelsStepInput","type":"[UpdateSalesChannelsStepInput](../../../../types/core_flows.UpdateSalesChannelsStepInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"selector","type":"[FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Find sales channels by their name or description through this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the sales channel by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| `string`[]","description":"Filter sales channels by their names.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Filter sales channels by whether they're disabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](../../../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps]Line truncated
## Output
<TypeList types={[{"name":"SalesChannelDTO[]","type":"[SalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"SalesChannelDTO","type":"[SalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","optional":false,"defaultValue":"","description":"The sales channel details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locations","type":"[SalesChannelLocationDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelLocationDTO/page.mdx)[]","description":"The locations of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"sales_channel_id","type":"`string`","description":"The associated sales channel's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel","type":"[SalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","description":"The associated sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateSalesChannelsStep"/>
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# associateLocationsWithSalesChannelsStepId
`Const` **associateLocationsWithSalesChannelsStepId**: `"associate-locations-with-sales-channels-step"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# associateProductsWithSalesChannelsStepId
`Const` **associateProductsWithSalesChannelsStepId**: `"associate-products-with-channels"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# createDefaultSalesChannelStepId
`Const` **createDefaultSalesChannelStepId**: `"create-default-sales-channel"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# createSalesChannelsStepId
`Const` **createSalesChannelsStepId**: `"create-sales-channels"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteSalesChannelsStepId
`Const` **deleteSalesChannelsStepId**: `"delete-sales-channels"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# detachLocationsFromSalesChannelsStepId
`Const` **detachLocationsFromSalesChannelsStepId**: `"detach-locations-from-sales-channels"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# detachProductsFromSalesChannelsStepId
`Const` **detachProductsFromSalesChannelsStepId**: `"detach-products-from-sales-channels-step"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateSalesChannelsStepId
`Const` **updateSalesChannelsStepId**: `"update-sales-channels"`
@@ -0,0 +1,24 @@
---
slug: /references/medusa-workflows/createSalesChannelsWorkflow
sidebar_label: createSalesChannelsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# createSalesChannelsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `createSalesChannelsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow creates one or more sales channels.
## Steps
<WorkflowDiagram workflow={{"name":"createSalesChannelsWorkflow","steps":[{"type":"step","name":"createSalesChannelsStep","description":"This step creates one or more sales channels.","link":"../../../../core_flows.Steps_Sales_Channel/page.mdx#createsaleschannelsstep","depth":1}]}} />
## Input
<TypeList types={[{"name":"CreateSalesChannelsWorkflowInput","type":"[CreateSalesChannelsWorkflowInput](../../../../types/core_flows.CreateSalesChannelsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"salesChannelsData","type":"[CreateSalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.CreateSalesChannelDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createSalesChannelsWorkflow"/>
## Output
<TypeList types={[{"name":"SalesChannelDTO[]","type":"[SalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"SalesChannelDTO","type":"[SalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","optional":false,"defaultValue":"","description":"The sales channel details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locations","type":"[SalesChannelLocationDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelLocationDTO/page.mdx)[]","description":"The locations of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"sales_channel_id","type":"`string`","description":"The associated sales channel's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel","type":"[SalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","description":"The associated sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createSalesChannelsWorkflow"/>
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/deleteSalesChannelsWorkflow
sidebar_label: deleteSalesChannelsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteSalesChannelsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `deleteSalesChannelsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow deletes one or more sales channels.
## Steps
<WorkflowDiagram workflow={{"name":"deleteSalesChannelsWorkflow","steps":[{"type":"step","name":"deleteSalesChannelsStep","description":"This step deletes one or more sales channels.","link":"../../../../core_flows.Steps_Sales_Channel/page.mdx#deletesaleschannelsstep","depth":1},{"type":"step","name":"removeRemoteLinkStep","description":"This step deletes linked records of a record.\n\nLearn more in the [Remote Link documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-link#cascade-delete-linked-records)\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#removeremotelinkstep","depth":2}]}} />
## Input
<TypeList types={[{"name":"DeleteSalesChannelsWorkflowInput","type":"[DeleteSalesChannelsWorkflowInput](../../../../types/core_flows.DeleteSalesChannelsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteSalesChannelsWorkflow"/>
@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/linkProductsToSalesChannelWorkflow
sidebar_label: linkProductsToSalesChannelWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# linkProductsToSalesChannelWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `linkProductsToSalesChannelWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow creates or dismisses links between product and sales channel records.
## Steps
<WorkflowDiagram workflow={{"name":"linkProductsToSalesChannelWorkflow","steps":[{"type":"step","name":"associateProductsWithSalesChannelsStep","description":"This step creates links between products and sales channel records.","link":"../../../../core_flows.Steps_Sales_Channel/page.mdx#associateproductswithsaleschannelsstep","depth":1},{"type":"step","name":"detachProductsFromSalesChannelsStep","description":"This step dismisses links between product and sales channel records.","link":"../../../../core_flows.Steps_Sales_Channel/page.mdx#detachproductsfromsaleschannelsstep","depth":2}]}} />
## Input
<TypeList types={[{"name":"LinkWorkflowInput","type":"[LinkWorkflowInput](../../../../../types/CommonTypes/types/types.CommonTypes.LinkWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"add","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remove","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="linkProductsToSalesChannelWorkflow"/>
@@ -0,0 +1,24 @@
---
slug: /references/medusa-workflows/updateSalesChannelsWorkflow
sidebar_label: updateSalesChannelsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateSalesChannelsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `updateSalesChannelsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow updates sales channels matching the specified conditions.
## Steps
<WorkflowDiagram workflow={{"name":"updateSalesChannelsWorkflow","steps":[{"type":"step","name":"updateSalesChannelsStep","description":"This step updates sales channels matching the specified filters.","link":"../../../../core_flows.Steps_Sales_Channel/page.mdx#updatesaleschannelsstep","depth":1}]}} />
## Input
<TypeList types={[{"name":"UpdateSalesChannelsWorkflowInput","type":"[UpdateSalesChannelsWorkflowInput](../../../../types/core_flows.UpdateSalesChannelsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"selector","type":"[FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Find sales channels by their name or description through this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the sales channel by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| `string`[]","description":"Filter sales channels by their names.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Filter sales channels by whether they're disabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](../../../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableSalesChannelProps](../../../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesCLine truncated
## Output
<TypeList types={[{"name":"SalesChannelDTO[]","type":"[SalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"SalesChannelDTO","type":"[SalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","optional":false,"defaultValue":"","description":"The sales channel details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locations","type":"[SalesChannelLocationDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelLocationDTO/page.mdx)[]","description":"The locations of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"sales_channel_id","type":"`string`","description":"The associated sales channel's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel","type":"[SalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","description":"The associated sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateSalesChannelsWorkflow"/>
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# createSalesChannelsWorkflowId
`Const` **createSalesChannelsWorkflowId**: `"create-sales-channels"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteSalesChannelsWorkflowId
`Const` **deleteSalesChannelsWorkflowId**: `"delete-sales-channels"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# linkProductsToSalesChannelWorkflowId
`Const` **linkProductsToSalesChannelWorkflowId**: `"link-products-to-sales-channel"`
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateSalesChannelsWorkflowId
`Const` **updateSalesChannelsWorkflowId**: `"update-sales-channels"`
@@ -0,0 +1,105 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# Steps\_Sales Channel
## associateLocationsWithSalesChannelsStep
This step creates links between locations and sales channel records.
### Input
<TypeList types={[{"name":"AssociateLocationsWithSalesChannelsStepInput","type":"[AssociateLocationsWithSalesChannelsStepInput](../../interfaces/core_flows.AssociateLocationsWithSalesChannelsStepInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"links","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"sales_channel_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="associateLocationsWithSalesChannelsStep"/>
### Output
<TypeList types={[{"name":"unknown[]","type":"`unknown`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"unknown","type":"`unknown`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="associateLocationsWithSalesChannelsStep"/>
___
## associateProductsWithSalesChannelsStep
This step creates links between products and sales channel records.
### Input
<TypeList types={[{"name":"AssociateProductsWithSalesChannelsStepInput","type":"[AssociateProductsWithSalesChannelsStepInput](../../interfaces/core_flows.AssociateProductsWithSalesChannelsStepInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"links","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"sales_channel_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="associateProductsWithSalesChannelsStep"/>
### Output
<TypeList types={[{"name":"unknown[]","type":"`unknown`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"unknown","type":"`unknown`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="associateProductsWithSalesChannelsStep"/>
___
## createDefaultSalesChannelStep
This step creates a default sales channel.
### Input
<TypeList types={[{"name":"CreateDefaultSalesChannelStepInput","type":"[CreateDefaultSalesChannelStepInput](../../interfaces/core_flows.CreateDefaultSalesChannelStepInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"data","type":"[CreateSalesChannelDTO](../../../sales_channel/interfaces/sales_channel.CreateSalesChannelDTO/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createDefaultSalesChannelStep"/>
### Output
<TypeList types={[{"name":"SalesChannelDTO","type":"[SalesChannelDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locations","type":"[SalesChannelLocationDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelLocationDTO/page.mdx)[]","description":"The locations of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"sales_channel_id","type":"`string`","description":"The associated sales channel's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel","type":"[SalesChannelDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","description":"The associated sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locations","type":"[SalesChannelLocationDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelLocationDTO/page.mdx)[]","description":"The locations of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createDefaultSalesChannelStep"/>
___
## createSalesChannelsStep
This step creates one or more sales channels.
### Input
<TypeList types={[{"name":"CreateSalesChannelsStepInput","type":"[CreateSalesChannelsStepInput](../../interfaces/core_flows.CreateSalesChannelsStepInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"data","type":"[CreateSalesChannelDTO](../../../sales_channel/interfaces/sales_channel.CreateSalesChannelDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createSalesChannelsStep"/>
### Output
<TypeList types={[{"name":"SalesChannelDTO[]","type":"[SalesChannelDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"SalesChannelDTO","type":"[SalesChannelDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","optional":false,"defaultValue":"","description":"The sales channel details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locations","type":"[SalesChannelLocationDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelLocationDTO/page.mdx)[]","description":"The locations of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"sales_channel_id","type":"`string`","description":"The associated sales channel's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel","type":"[SalesChannelDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","description":"The associated sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createSalesChannelsStep"/>
___
## deleteSalesChannelsStep
This step deletes one or more sales channels.
### Input
<TypeList types={[{"name":"string[]","type":"`string`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteSalesChannelsStep"/>
___
## detachLocationsFromSalesChannelsStep
This step dismisses links between location and sales channel records.
### Input
<TypeList types={[{"name":"DetachLocationsFromSalesChannelsStepInput","type":"[DetachLocationsFromSalesChannelsStepInput](../../interfaces/core_flows.DetachLocationsFromSalesChannelsStepInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"links","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"sales_channel_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="detachLocationsFromSalesChannelsStep"/>
### Output
<TypeList types={[{"name":"never[]","type":"`never`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"never","type":"`never`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="detachLocationsFromSalesChannelsStep"/>
___
## detachProductsFromSalesChannelsStep
This step dismisses links between product and sales channel records.
### Input
<TypeList types={[{"name":"DetachProductsFromSalesChannelsStepInput","type":"[DetachProductsFromSalesChannelsStepInput](../../interfaces/core_flows.DetachProductsFromSalesChannelsStepInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"links","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"sales_channel_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="detachProductsFromSalesChannelsStep"/>
___
## updateSalesChannelsStep
This step updates sales channels matching the specified filters.
### Input
<TypeList types={[{"name":"UpdateSalesChannelsStepInput","type":"[UpdateSalesChannelsStepInput](../../types/core_flows.UpdateSalesChannelsStepInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"selector","type":"[FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Find sales channels by their name or description through this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the sales channel by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| `string`[]","description":"Filter sales channels by their names.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Filter sales channels by whether they're disabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filLine truncated
### Output
<TypeList types={[{"name":"SalesChannelDTO[]","type":"[SalesChannelDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"SalesChannelDTO","type":"[SalesChannelDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","optional":false,"defaultValue":"","description":"The sales channel details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locations","type":"[SalesChannelLocationDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelLocationDTO/page.mdx)[]","description":"The locations of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"sales_channel_id","type":"`string`","description":"The associated sales channel's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel","type":"[SalesChannelDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","description":"The associated sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateSalesChannelsStep"/>
@@ -0,0 +1,65 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# Workflows\_Sales Channel
## createSalesChannelsWorkflow
This workflow creates one or more sales channels.
### Steps
<WorkflowDiagram workflow={{"name":"createSalesChannelsWorkflow","steps":[{"type":"step","name":"createSalesChannelsStep","description":"This step creates one or more sales channels.","link":"../../core_flows.Steps_Sales_Channel/page.mdx#createsaleschannelsstep","depth":1}]}} />
### Input
<TypeList types={[{"name":"CreateSalesChannelsWorkflowInput","type":"[CreateSalesChannelsWorkflowInput](../../types/core_flows.CreateSalesChannelsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"salesChannelsData","type":"[CreateSalesChannelDTO](../../../sales_channel/interfaces/sales_channel.CreateSalesChannelDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createSalesChannelsWorkflow"/>
### Output
<TypeList types={[{"name":"SalesChannelDTO[]","type":"[SalesChannelDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"SalesChannelDTO","type":"[SalesChannelDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","optional":false,"defaultValue":"","description":"The sales channel details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locations","type":"[SalesChannelLocationDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelLocationDTO/page.mdx)[]","description":"The locations of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"sales_channel_id","type":"`string`","description":"The associated sales channel's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel","type":"[SalesChannelDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","description":"The associated sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createSalesChannelsWorkflow"/>
___
## deleteSalesChannelsWorkflow
This workflow deletes one or more sales channels.
### Steps
<WorkflowDiagram workflow={{"name":"deleteSalesChannelsWorkflow","steps":[{"type":"step","name":"deleteSalesChannelsStep","description":"This step deletes one or more sales channels.","link":"../../core_flows.Steps_Sales_Channel/page.mdx#deletesaleschannelsstep","depth":1},{"type":"step","name":"removeRemoteLinkStep","description":"This step deletes linked records of a record.\n\nLearn more in the [Remote Link documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-link#cascade-delete-linked-records)\n\n","link":"../../core_flows.Steps_Common/page.mdx#removeremotelinkstep","depth":2}]}} />
### Input
<TypeList types={[{"name":"DeleteSalesChannelsWorkflowInput","type":"[DeleteSalesChannelsWorkflowInput](../../types/core_flows.DeleteSalesChannelsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteSalesChannelsWorkflow"/>
___
## linkProductsToSalesChannelWorkflow
This workflow creates or dismisses links between product and sales channel records.
### Steps
<WorkflowDiagram workflow={{"name":"linkProductsToSalesChannelWorkflow","steps":[{"type":"step","name":"associateProductsWithSalesChannelsStep","description":"This step creates links between products and sales channel records.","link":"../../core_flows.Steps_Sales_Channel/page.mdx#associateproductswithsaleschannelsstep","depth":1},{"type":"step","name":"detachProductsFromSalesChannelsStep","description":"This step dismisses links between product and sales channel records.","link":"../../core_flows.Steps_Sales_Channel/page.mdx#detachproductsfromsaleschannelsstep","depth":2}]}} />
### Input
<TypeList types={[{"name":"LinkWorkflowInput","type":"[LinkWorkflowInput](../../../types/CommonTypes/types/types.CommonTypes.LinkWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"add","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remove","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="linkProductsToSalesChannelWorkflow"/>
___
## updateSalesChannelsWorkflow
This workflow updates sales channels matching the specified conditions.
### Steps
<WorkflowDiagram workflow={{"name":"updateSalesChannelsWorkflow","steps":[{"type":"step","name":"updateSalesChannelsStep","description":"This step updates sales channels matching the specified filters.","link":"../../core_flows.Steps_Sales_Channel/page.mdx#updatesaleschannelsstep","depth":1}]}} />
### Input
<TypeList types={[{"name":"UpdateSalesChannelsWorkflowInput","type":"[UpdateSalesChannelsWorkflowInput](../../types/core_flows.UpdateSalesChannelsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"selector","type":"[FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Find sales channels by their name or description through this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the sales channel by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| `string`[]","description":"Filter sales channels by their names.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Filter sales channels by whether they're disabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;T&#62; \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx) \\| [BaseFilterable](../../../sales_channel/interfaces/sales_channel.BaseFilterable/page.mdx)&#60;[FilterableSalesChannelProps](../../../sales_channel/interfaces/sales_channel.FilterableSalesChannelProps/page.mdx)&#62;)[]","description":"An Line truncated
### Output
<TypeList types={[{"name":"SalesChannelDTO[]","type":"[SalesChannelDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"SalesChannelDTO","type":"[SalesChannelDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","optional":false,"defaultValue":"","description":"The sales channel details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locations","type":"[SalesChannelLocationDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelLocationDTO/page.mdx)[]","description":"The locations of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"sales_channel_id","type":"`string`","description":"The associated sales channel's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel","type":"[SalesChannelDTO](../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","description":"The associated sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateSalesChannelsWorkflow"/>
@@ -0,0 +1,8 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# Promotion
## Namespaces
- [Steps\_Promotion](../core_flows.Steps_Promotion/page.mdx)
- [Workflows\_Promotion](../core_flows.Workflows_Promotion/page.mdx)
@@ -0,0 +1,8 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# Reservation
## Namespaces
- [Steps\_Reservation](../core_flows.Steps_Reservation/page.mdx)
- [Workflows\_Reservation](../core_flows.Workflows_Reservation/page.mdx)
@@ -0,0 +1,8 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# Sales Channel
## Namespaces
- [Steps\_Sales Channel](../core_flows.Steps_Sales_Channel/page.mdx)
- [Workflows\_Sales Channel](../core_flows.Workflows_Sales_Channel/page.mdx)