This documentation provides a reference to the createCampaigns
method. This belongs to the Promotion Module.
Note: You should only use this methods when implementing complex customizations. For common cases, check out
available workflows instead.
createCampaigns(data, sharedContext?): Promise<CampaignDTO>#
This method creates a campaign.
Example#
1const campaign = await promotionModuleService.createCampaigns(2 {3 name: "Summer discounts",4 campaign_identifier: "G-123456",5 starts_at: new Date("2025-06-01"),6 ends_at: new Date("2025-09-01"),7 budget: {8 type: "usage",9 limit: 10,10 },11 }12)
Parameters#
The campaign to be created.
A context used to share resources, such as transaction manager, between the application and the module.
Returns#
createCampaigns(data, sharedContext?): Promise<CampaignDTO[]>#
This method creates campaigns.
Example#
1const campaigns =2 await promotionModuleService.createCampaigns([3 {4 name: "Summer discounts",5 campaign_identifier: "G-123456",6 starts_at: new Date("2025-06-01"),7 ends_at: new Date("2025-09-01"),8 budget: {9 type: "usage",10 limit: 10,11 },12 },13 ])
Parameters#
The campaigns to be created.
A context used to share resources, such as transaction manager, between the application and the module.
Returns#