Create the campaign
Codjo starts with Create a discount campaign. The campaign is created as a draft, with no tier yet, so nothing applies to sales. He gives it a name and chooses:- Activation mode:
automatic, where the discount applies by itself, orcode, where the customer gives a code. A code is required in code mode and refused in automatic mode. It is stored in capitals and must be unique among the company’s campaigns. - Discount type:
percentageorfixed. - Application scope:
orderfor the whole order, orstockablesfor chosen product units. - Tier basis: whether the tiers are measured on the whole order or only on the eligible products.
- Access mode:
public, the default, orrestricted. See Choose who gets a campaign. - Combination policy:
exclusiveorstackable. - Dates: a start date is required. The end date, when given, must be after it. A date without an offset is read in the company time zone.
- Limits (optional): a usage limit, a pool limit and a limit per customer.
Set tiers, conditions and products
While the campaign is a draft, Codjo prepares three lists. Each one replaces the previous list entirely.- Set campaign discount tiers: each tier has a minimum amount, for example 100,000 FCFA, and two tiers cannot share a minimum. A percentage campaign needs a percentage on each tier, and a percentage tier may also cap the discount. A fixed campaign needs a fixed amount on each tier. Tiers can also be replaced while the campaign is paused.
- Set campaign conditions: the only condition type is
minimum_amount, which needs an amount above zero. An empty list removes all conditions. - Set campaign target products: accepted only when the scope is
stockables, and needed before such a campaign can be activated. The list cannot be empty, and each identifier must be unique and exist in the organization’s catalogue.
Move the campaign through its life
- Activate a discount campaign puts it live. It needs at least one tier, and a
stockablescampaign needs at least one target product. - Pause a discount campaign stops it from applying to new orders. Codjo can activate it again later.
- Return campaign to draft lets him rework it. Its discounts stop applying.
- Archive a discount campaign retires it and keeps its history. An archived campaign cannot be edited unless it is returned to draft.
- Delete a discount campaign removes it permanently. Only a draft or archived campaign can be deleted.
Check a code and follow usage
Before Fifamè promises a discount to a bar, she tests the code with Check a discount code, giving the basket and, if known, the customer. She sees whether the code is eligible, the reasons if it is not, and what the discount would be. Nothing is applied and no usage is recorded. An unknown code is not an error: she sees “not eligible” with the reasoncode_unknown.
To see where and by whom the campaign was used, she opens List campaign usages. List discount campaigns can be filtered by status, activation mode, discount type, scope, access mode or combination policy, and View a discount campaign shows one campaign with its settings.
To limit a campaign to some customers, see Choose who gets a campaign.
The rules
- A campaign belongs to one company.
- Conditions and target products can be replaced only while the campaign is a draft. Tiers only while it is a draft or paused.
- An archived campaign is read-only until it is returned to draft.
- A campaign with a start date and an end date: the end must be after the start.
All the actions of this topic
- Check a discount code: Previews whether a discount code can be used for a basket and customer, and what the discount would be, without applying it or recording any usage. A valid request always gets a 200 answer with eligible, reasons and would_be.
- List discount campaigns: Shows the company discount campaigns, filterable by status.
- Create a discount campaign: Creates a new discount campaign (automatic or by code) in draft, ready to be configured before going live.
- View a discount campaign: Shows one discount campaign with its settings.
- Edit a discount campaign: Changes the name, code, limits or dates of a discount campaign.
- Delete a discount campaign: Deletes a draft or archived discount campaign that was never used by an order.
- Set campaign discount tiers: Replaces the discount levels (thresholds and amounts) of a campaign.
- Set campaign target products: Replaces the list of products or units the campaign applies to.
- Set campaign conditions: Replaces the conditions a sale must meet for the campaign to apply.
- Activate a discount campaign: Puts a campaign live so discounts start applying to sales.
- Pause a discount campaign: Temporarily stops a live campaign from applying discounts.
- Archive a discount campaign: Retires a campaign while keeping its history; it can no longer be edited unless it is returned to draft.
- Return campaign to draft: Moves a campaign back to draft so it can be reworked.
- List campaign usages: Shows where and by whom a discount campaign has been used.