Campaigns
Create
To create a discount campaign, we use CreateDiscountCampaign.
Example request:
{
"Name": "", // required
"Description": "", // optional
"BackendSystemID": "",
"BackendID": "", // optional
"StartDate": "01-01-20xx", // optional
"EndDate": "01-01-20xx", // optional
"KeepDiscountsWithinCampaignTimespan": "trueorfalse", // optional - When set to true, discount linked to the campaign are forced into the timeframe (start/end time) of the campaign. The start/end time of the discounts under the campaign aren’t mutable anymore and the campaign start time will become required. If there is already a start/end time in the discounts, this will be overwritten by the value of the campaign
"CurrencyID": "insertcurrency", // optional - This is the base currency of the campaign. Discount linked to the campaign can be of a different currency. If the currency is set, the backend will keep track of the total discount given on the campaign. The currency can no longer be modified when a discount within the campaign is used.
"Budget": "a value", // optional - Input here can be a decimal value which in turn indicates the campaign budget.
"DeactivateDiscountsWhenBudgetIsReached": "trueorfalse", // optional - The value indicates if the discount(s) within the campaign need to be deactivated once the budget of the campaign is reached or not.
}
This service returns the CampaignID
for your new discount campaign.
Get
To see your newly created discount, call GetDiscountCampaignByID using the ID that was returned from CreateDiscountCampaign
.
Example request and response:
{
"ID": 3 // required
}
{
"ID": 3,
"Name": "The People's Discount",
"Description": "The people's discount",
"StartDate": "2023-01-01T00:00:00Z",
"EndDate": "2024-01-01T00:00:00Z",
"KeepDiscountsWithinCampaignTimespan": true,
"BackendSystemID": "the_peoples_discount",
"BackendID": "the_peoples_discount_1",
"CurrencyID": "eur",
"DeactivateDiscountsWhenBudgetIsReached": false,
"TotalDiscountGiven": 0
}
List
To list an overview of all discount campaigns, call ListDiscountCampaigns. The call will return the following properties:
{
"PageConfig": {
"Filter": {
"Name": "", // optional
"Description": "", // optional
"BackendSystemID": "", // optional
"BackendID": "", // optional
"StartDate": "01-01-2020", // optional
"EndDate": "01-01-2020", // optional
"CurrencyID":"EUR", // optional - it represents the base currency of the campaign
"Budget":"a numerical value", //optional - represents the campaign budget via a monetary/numerical value
"BudgetProgress":"a numerical value" //optional - indicates the budget progress in percentage. The percentage used
}
}
}
Update
Discount campaigns can be updated using UpdateDiscountCampaign. ID
is required and unchangeable, everything else can be modified/updated.
{
"ID": 0, // required
"Name": "", // required
"Description": "", // optional
"BackendSystemID": "",
"BackendID": "", // optional
"StartDate": "01-01-20xx", // optional
"EndDate": "01-01-20xx", // optional
"KeepDiscountsWithinCampaignTimespan": "trueorfalse", // optional - When set to true, discount linked to the campaign are forced into the timeframe (start/end time) of the campaign. The start/end time of the discounts under the campaign aren’t mutable anymore and the campaign start time will become required. If there is already a start/end time in the discounts, this will be overwritten by the value of the campaign
"CurrencyID": "insertcurrency", // optional - This is the base currency of the campaign. Discount linked to the campaign can be of a different currency. If the currency is set, the backend will keep track of the total discount given on the campaign. The currency can no longer be modified when a discount within the campaign is used.
"Budget": "a value", // optional - Input here can be a decimal value which in turn indicates the campaign budget.
"DeactivateDiscountsWhenBudgetIsReached": "trueorfalse", // optional - The value indicates if the discount(s) within the campaign need to be deactivated once the budget of the campaign is reached or not.
}
if valid, the service will return {}
.
Delete
To delete a discount campaign, we use DeleteDiscountCampaign. When setting ArchiveRelatedDiscounts
to true, all discounts that are attached to this campaign will also be deleted.
{
"ID": 0, // required
"ArchiveRelatedDiscounts": false
}