An optional field to keep any extra textual information about the campaign such as a campaign description and details.
campaign_type
Type of campaign.
Available values: LOYALTY_PROGRAM, GIFT_VOUCHERS, DISCOUNT_COUPONS, PROMOTION, REFERRAL_PROGRAM, LUCKY_DRAW
type
Defines whether the campaign can be updated with new vouchers after campaign creation.
AUTO_UPDATE: the campaign is dynamic, i.e. vouchers will generate based on set criteria
STATIC: vouchers need to be manually published
Available values: AUTO_UPDATE, STATIC
voucher
Any of:
Discount Voucher
Attributes
Description
Example
type
Type of voucher.
discount
Defines the voucher discount type and details.
One of:
Amount
Attributes
Description
Example
type
Applies an amount discount.
amount_off
Amount taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. In case of the amount being calculated by the formula, i.e. the amount_off_formula parameter is present in the amount definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the amount off.
100
amount_off_formula
Formula used to calculate the discount.
effect
Defines how the discount is applied to the customer's order
Available values: APPLY_TO_ORDER, APPLY_TO_ITEMS, APPLY_TO_ITEMS_PROPORTIONALLY, APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY, APPLY_TO_ITEMS_BY_QUANTITY
Percentage
Attributes
Description
Example
type
Applies a percentage discount.
amount_limit
Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600.
percent_off
Percent taken off the subtotal amount. In case of the percent being calculated by the formula, i.e. the percent_off_formula parameter is present in the percent definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the percent off.
percent_off_formula
Formula used to calculate the discount.
effect
Defines how the discount is applied to the customer's order.
Available values: APPLY_TO_ORDER, APPLY_TO_ITEMS
Fixed
Attributes
Description
Example
type
Sets a fixed total on cart or item(s) and then calculates the discount to apply.
fixed_amount
Set a fixed valued for an order total or price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. In case of the fixed amount being calculated by the formula, i.e. the fixed_amount_formula parameter is present in the fixed amount definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.
1000
fixed_amount_formula
Formula used to calculate the discounted price of an item or a new order total.
effect
Effect
Definition
APPLY_TO_ORDER
Sets the order total amount to the value of the fixed amount. The discount value is calculated dynamically during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. For example, if the fixed amount is set to equal $10 and the order amount equals $25, then the calculated discount will be $15.
APPLY_TO_ITEMS
Sets a new price on items. The total discount amount is dynamically calculated during the redemption and it's a difference between the initial item price and the fixed amount. During the redemption, prices for items will change only if the new price is lower than the original price. If the new product price you set is different from the product price in a collection, then the new product price will be passed during the redemption. If a prodct is in more than one collection, the price is always changed to the lowest price. The new price for products with several SKUs will force the price change for SKUs if their original price is higher than the new price.
Available values: APPLY_TO_ORDER, APPLY_TO_ITEMS
Unit, single item
Attributes
Description
Example
type
Applies a full value discount to item(s).
unit_off
Number of units to be granted a full value discount. In case of the unit being calculated by the formula, i.e. the unit_off_formula parameter is present in the unit definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the unit value.
1
unit_off_formula
Formula used to calculate the number of units.
unit_type
The product deemed as free, chosen from the product inventory (e.g. time, items).
prod_f1r5Tpr0DuC7
effect
Defines how the unit is added to the customer's order.
Available values: ADD_NEW_ITEMS, ADD_MISSING_ITEMS
Unit, multiple items
Attributes
Description
Example
type
Applies a full value discount to item(s).
effect
Defines the effect for adding multiple item types.
units
Array of objects defining items to be offered for free. Each item type can have a different discount effect assigned.
Array of:
Attributes
Description
Example
unit_off
Number of units to be granted a full value discount. In case of the unit being calculated by the formula, i.e. the unit_off_formula parameter is present in the unit definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the unit value.
1
unit_off_formula
Formula used to calculate the number of units.
unit_type
The product deemed as free, chosen from the product inventory (e.g. time, items).
prod_f1r5Tpr0DuC7
effect
Defines how the unit is added to the customer's order.
Available values: ADD_NEW_ITEMS, ADD_MISSING_ITEMS
Shipping
Attributes
Description
Example
type
Applies a full value discount to item(s).
unit_off
Subtracts 1 shipping item from the subtotal.
unit_type
The shipping product deemed as free.
effect
Defines how the unit is added to the customer's order.
redemption
Defines the redemption limits on vouchers.
Attributes
Description
Example
quantity
How many times a voucher can be redeemed. A null value means unlimited.
A pattern for codes where hashes (#) will be replaced with random characters. Overrides length.
is_referral_code
Indicates whether the voucher is a referral code; this is true for campaign type REFERRAL_PROGRAM.
Gift Card
Attributes
Description
Example
type
Type of voucher.
gift
Defines the gift card details.
Attributes
Description
Example
amount
Initial gift card income to be applied to the gift card at voucher generation. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.
effect
Defines how the credits are applied to the customer's order.
Available values: APPLY_TO_ORDER, APPLY_TO_ITEMS
redemption
Defines the redemption limits on vouchers.
Attributes
Description
Example
quantity
How many times a voucher can be redeemed. A null value means unlimited.
A pattern for codes where hashes (#) will be replaced with random characters. Overrides length.
is_referral_code
Indicates whether the voucher is a referral code; this is true for campaign type REFERRAL_PROGRAM.
auto_join
Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled.
join_once
If this value is set to true, customers will be able to join the campaign only once.
use_voucher_metadata_schema
Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema.
validity_timeframe
Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.start_daterequired when including the validity_timeframe.
Attributes
Description
Example
interval
Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an interval of P2D will be active every other day.
duration
Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a duration of P1D will be valid for a duration of one day.
validity_day_of_week
Integer array corresponding to the particular days of the week in which the campaign is valid.
0 Sunday
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday
activity_duration_after_publishing
Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a duration of P24D will be valid for a duration of 24 days.
vouchers_count
Total number of unique vouchers in campaign.
start_date
Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is inactive before this date.
2022-09-20T00:00:00.000Z
expiration_date
Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is inactive after this date.
2022-09-30T00:00:00.000Z
active
A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the start_date and expiration_date.
true indicates an active campaign
false indicates an inactive campaign
metadata
The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format.
created_at
Timestamp representing the date and time when the campaign was created in ISO 8601 format.
2021-12-01T08:00:50.038Z
updated_at
Timestamp representing the date and time when the voucher was updated in ISO 8601 format.
2022-09-20T09:18:19.623Z
category
Unique category name.
creation_status
Indicates the status of the campaign creation.
Available values: DONE, IN_PROGRESS, FAILED, DRAFT, MODIFYING
vouchers_generation_status
Indicates the status of the campaign's vouchers.
Available values: DONE, IN_PROGRESS, FAILED, DRAFT
protected
Indicates whether the resource can be deleted.
category_id
Unique category ID that this campaign belongs to.
cat_0b688929a2476386a7
categories
object
The type of object represented by JSON. This object stores information about the campaign.
referral_program
Defines the referee reward and the way a referral is triggered. Context: REFERRAL_PROGRAM.
Attributes
Description
Example
conversion_event_type
How a referral is triggered.
Available values: redemption, custom_event
custom_event
Contains details about the custom event.
Attributes
Description
Example
id
Unique custom event ID.
ms_fi47Dcu5T0m3v3nT5ch3ma
name
Custom event name.
referee_reward
Defines the referee reward.
Attributes
Description
Example
related_object_parent
Details of the resource from which the reward originates.
Attributes
Description
Example
id
Unique ID of the reward source.
name
Name of the reward source.
object
Type of resource represented by the source of the reward.
type
Type of reward.
Available values: LOYALTY_CARD, GIFT_VOUCHER
amount
The number of points to add to a loyalty card or credits to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.
promotion
loyalty_tiers_expiration
Defines the expiration mechanism for loyalty tiers.
Any of:
Balance
Attributes
Description
Example
qualification_type
Tier qualification.
BALANCE: Points balance is based on the customer's current points balance. Customers qualify for the tier if their points balance is in the points range of the tier.
Available values: BALANCE
start_date
Defines the conditions for the start date of the tier.
Attributes
Description
Example
type
What triggers the tier to be valid for a customer. IMMEDIATE: After reaching the minimum required points.
Available values: IMMEDIATE
expiration_date
Defines the conditions for the expiration date of a tier.
Any of:
Balance Drop
Attributes
Description
Example
type
What triggers the tier to expire for a customer. BALANCE_DROP: Tier expires when the points balance drops below the required range of the tier.
Available values: BALANCE_DROP
Custom
Attributes
Description
Example
type
What triggers the tier to expire for a customer. CUSTOM: Tier expires after a certain time period passes following the instance the points balance drops below the required range of the tier.
Available values: CUSTOM
extend
Defines the amount of time the tier will remain active in ISO 8601 format. The expiration date counter starts at the moment when the customer reaches the minimum required points that are required to be in the tier. For example, a tier with a duration of P3M will be valid for a duration of 3 months.
rounding
Defines the rounding mechanism for tier expiration.
Any of:
Calendar Periods
Attributes
Description
Example
type
Period to which the expiration will be rounded to.
MONTH: The expiration date will be rounded to the end of the month.
QUARTER: The expiration date will be rounded to the end of the quarter.
HALF_YEAR: The expiration date will be rounded to the half year.
YEAR: The expiration date will be rounded to the end of the year.
Available values: MONTH, QUARTER, HALF_YEAR, YEAR
strategy
Which portion of the given period should the rounding be applied to.
Available values: END
Specific Month
Attributes
Description
Example
type
This mechanism describes a custom rounding for the expiration date.
Available values: CUSTOM
strategy
Which portion of the given period should the rounding be applied to.
Available values: END
unit
Defines the type of unit of time in which the rounding period is counted.
Available values: MONTH
value
Value for the unit of time that the rounding applies to. Units for this parameter are defined by the rounding.unit parameter.
0: January
1: February
2: March
3: April
4: May
5: June
6: July
7: August
8: September
9: October
10: November
11: December
Points in Period
Attributes
Description
Example
qualification_type
Tier qualification.
POINTS_IN_PERIOD: A customer qualifies for the tier only if the sum of the accumulated points in a defined time interval reaches the tier threshold.
Available values: POINTS_IN_PERIOD
qualification_period
Customers can qualify for the tier if they collected enough points in a given time period. So, in addition to the customer having to reach a points range, they also need to have collected the points within a set time period.
Period
Definition
Calendar Month
Points collected in one calendar month January, February, March, etc.
Calendar Quarter
Points collected in the quarter - January - March - April - June - July - September - October - December
Calendar Half-year
Points collected in the half-year - January - June - July - December
Calendar Year
Points collected in one calendar year January - December
Available values: MONTH, QUARTER, HALF_YEAR, YEAR
start_date
Defines the conditions for the start date of the tier.
Attributes
Description
Example
type
What triggers the tier to be valid for a customer. IMMEDIATE: After reaching the minimum required points. NEXT_PERIOD: When the next qualification period starts.
Available values: IMMEDIATE, NEXT_PERIOD
expiration_date
Defines the conditions for the expiration date of a tier.
Attributes
Description
Example
type
What triggers the tier to expire for a customer. END_OF_PERIOD: Expire tier at the end of the period. END_OF_NEXT_PERIOD: Expire tier at the end of the next period.
Available values: END_OF_PERIOD, END_OF_NEXT_PERIOD
extend
Extend the expiration by adding extra months or days in ISO 8601 format. The tier will remain active even though it reaches its expiration time period. For example, a tier with a duration of P3M will be valid for an additional duration of 3 months and a tier with a duration of P1D will be valid for an additional duration of 1 day.
Language
URL
Click Try It! to start a request and see the response here!