Loyalty Campaign Object

Loyalty Campaign Object

AttributesDescription
id
string

Unique campaign ID, assigned by Voucherify.

Example:

camp_f7fBbQxUuTN7dI7tGOo5XMDA

name
string

Loyalty campaign name.

campaign_type
string

Type of campaign.

Available values: LOYALTY_PROGRAM
type
string

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
voucherSee: Loyalty Card
auto_join
boolean

Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled.

join_once
boolean

If this value is set to true, customers will be able to join the campaign only once.

use_voucher_metadata_schema
boolean

Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema.

start_date
string

Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is inactive before this date.

Example:

2022-09-20T00:00:00.000Z

expiration_date
string

Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is inactive after this date.

Example:

2022-09-30T00:00:00.000Z

validity_timeframe
object

Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.

AttributesDescription
interval
string

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
string

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
array

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
string

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.

description
string

An optional field to keep any extra textual information about the campaign such as a campaign description and details.

vouchers_count
integer

Total number of unique vouchers in campaign.

active
boolean

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
object

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
string

Timestamp representing the date and time when the campaign was created. The value is shown in the ISO 8601 format.

Example:

2021-12-01T08:00:50.038Z

updated_at
string

Timestamp representing the date and time when the voucher was updated. The value is shown in the ISO 8601 format.

Example:

2022-09-20T09:18:19.623Z

creation_status
string

Indicates the status of the campaign creation.

Available values: DONE, IN_PROGRESS, FAILED, DRAFT, MODIFYING
vouchers_generation_status
string

Indicates the status of the campaign's vouchers.

Available values: DONE, IN_PROGRESS, FAILED, DRAFT
protected
boolean

Indicates whether the resource can be deleted.

category_id
string

Unique category ID that this campaign belongs to.

Example:

cat_0b688929a2476386a7

categoriesSee: Category
loyalty_tiers_expiration
object

Defines the expiration mechanism for loyalty tiers.

One of: Balance, Points in Period
object
string

The type of the object represented by JSON. This object stores information about the campaign.

Loyalty Card

AttributesDescription
type
string

Type of voucher.

loyalty_card
object

Defines the loyalty card details.

AttributesDescription
points
integer

Initial loyalty card income in points to be applied to the loyalty card at voucher generation.

expiration_rules
object

Defines point expiration rules.

AttributesDescription
period_type
string

The expiration period.

Available values: MONTH
period_value
integer

How many periods should pass before the expiration occurs.

rounding_type
string

Round up expiration till the end of the given period type.

Available values: END_OF_MONTH, END_OF_QUARTER, END_OF_HALF_YEAR, END_OF_YEAR, PARTICULAR_MONTH
redemption
object

Defines the redemption limits on vouchers.

AttributesDescription
quantity
integer

How many times a voucher can be redeemed. A null value means unlimited.

code_config
object

Defines code's pattern (prefix, suffix, length, charset, etc).

AttributesDescription
length
string

Number of characters in a generated code (excluding prefix and postfix).

charset
string

Characters that can appear in the code.

Examples:

  • Alphanumeric: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Alphabetic: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Alphabetic Lowercase: abcdefghijklmnopqrstuvwxyz
  • Alphabetic Uppercase: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  • Numbers: 0123456789
  • Custom: a custom character set
prefix
string

A text appended before the code.

postfix
string

A text appended after the code.

pattern
string

A pattern for codes where hashes (#) will be replaced with random characters. Overrides length.

is_referral_code
boolean

Flag indicating whether this voucher is a referral code; true for campaign type REFERRAL_PROGRAM.

Category

AttributesDescription
id
string

Unique category ID assigned by Voucherify.

name
string

Category name.

hierarchy
integer

Category hierarchy.

object
string

The type of the object represented by the JSON. This object stores information about the category.

Available values: category
created_at
string

Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.

Example:

2022-07-14T10:45:13.156Z

updated_at
string

Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.

Example:

2022-08-16T10:52:08.094Z

stacking_rules_type
string

The type of the stacking rule eligibility.

Available values: JOINT, EXCLUSIVE

Balance

AttributesDescription
qualification_type
string

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
object

Defines the conditions for the start date of the tier.

AttributesDescription
type
string

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.

One of: Balance Drop, Custom

Points in Period

AttributesDescription
qualification_type
string

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
string

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.

PeriodDefinition
Calendar MonthPoints collected in one calendar month
January, February, March, etc.
Calendar QuarterPoints collected in the quarter
- January - March
- April - June
- July - September
- October - December
Calendar Half-yearPoints collected in the half-year
- January - June
- July - December
Calendar YearPoints collected in one calendar year
January - December
Available values: MONTH, QUARTER, HALF_YEAR, YEAR
start_date
object

Defines the conditions for the start date of the tier.

AttributesDescription
type
string

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
object

Defines the conditions for the expiration date of a tier.

AttributesDescription
type
string

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
string

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.

Balance Drop

AttributesDescription
type
string

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

AttributesDescription
type
string

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
string

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.

One of: Calendar Periods, Specific Month

Calendar Periods

AttributesDescription
type
string

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
string

Which portion of the given period should the rounding be applied to.

Available values: END

Specific Month

AttributesDescription
type
string

This mechanism describes a custom rounding for the expiration date.

Available values: CUSTOM
strategy
string

Which portion of the given period should the rounding be applied to.

Available values: END
unit
string

Defines the type of unit of time in which the rounding period is counted.

Available values: MONTH
value
integer

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