createPromotionsStep - Medusa Core Workflows Reference
This documentation provides a reference to the createPromotionsStep
. It belongs to the @medusajs/medusa/core-flows
package.
This step creates one or more promotions.
Example#
Input#
CreatePromotionDTO[]
CreatePromotionDTO[]
CreatePromotionDTO[]
CreatePromotionDTO[]code
stringThe code of the promotion.
code
stringThe type of the promotion:
standard
indicates that a promotion is a standard one applied with conditions.
buyget
indicates that a promotion is a "Buy X get Y" promotion.
standard
indicates that a promotion is a standard one applied with conditions.buyget
indicates that a promotion is a "Buy X get Y" promotion.
status
PromotionStatusValuesThe status of the promotion:
draft
indicates that a promotion is currently being prepared
active
indicates that a promotion is active
inactive
indicates that a promotion is no longer active
status
PromotionStatusValuesdraft
indicates that a promotion is currently being preparedactive
indicates that a promotion is activeinactive
indicates that a promotion is no longer active
application_method
CreateApplicationMethodDTOThe associated application method.
application_method
CreateApplicationMethodDTOis_automatic
booleanOptionalWhether the promotion is applied automatically.
is_automatic
booleanOptionalThe rules of the promotion.
The associated campaign.
campaign_id
stringOptionalThe associated campaign's ID.
campaign_id
stringOptionalOutput#
PromotionDTO[]
PromotionDTO[]
PromotionDTO[]
PromotionDTO[]id
stringThe ID of the promotion.
id
stringcode
stringOptionalThe code of the promotion.
code
stringOptionalThe type of the promotion:
standard
indicates that a promotion is a standard one applied with conditions.
buyget
indicates that a promotion is a "Buy X get Y" promotion.
standard
indicates that a promotion is a standard one applied with conditions.buyget
indicates that a promotion is a "Buy X get Y" promotion.
The status of the promotion:
active
promotion is available for user to consume
inactive
promotion is no longer available to the user
draft
promotion is currently being prepared
active
promotion is available for user to consumeinactive
promotion is no longer available to the userdraft
promotion is currently being prepared
is_automatic
booleanOptionalWhether the promotion is applied automatically.
is_automatic
booleanOptionalThe associated application method.
The rules of the promotion.
campaign_id
null | stringOptionalThe associated campaign.
campaign_id
null | stringOptionalThe associated campaign.
Was this page helpful?