Skip to main content
Skip to main content

createCampaigns - Promotion Module Reference

This documentation provides a reference to the createCampaigns method. This belongs to the Promotion Module.

createCampaigns(data, sharedContext?): Promise<CampaignDTO>

This method creates a campaign.

Example

const campaign = await promotionModuleService.createCampaigns(
{
name: "Summer discounts",
campaign_identifier: "G-123456",
starts_at: new Date("2025-06-01"),
ends_at: new Date("2025-09-01"),
budget: {
type: "usage",
limit: 10,
},
}
)

Parameters

dataCreateCampaignDTORequired
The campaign to be created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<CampaignDTO>Required
The created campaign.

createCampaigns(data, sharedContext?): Promise<CampaignDTO[]>

This method creates campaigns.

Example

const campaigns =
await promotionModuleService.createCampaigns([
{
name: "Summer discounts",
campaign_identifier: "G-123456",
starts_at: new Date("2025-06-01"),
ends_at: new Date("2025-09-01"),
budget: {
type: "usage",
limit: 10,
},
},
])

Parameters

dataCreateCampaignDTO[]Required
The campaigns to be created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<CampaignDTO[]>Required
The created campaigns.
Was this section helpful?