Skip to main content

Loyalty Campaign Object

AttributesDescription
idstringUnique campaign ID, assigned by Voucherify.Example:camp_f7fBbQxUuTN7dI7tGOo5XMDA
namestringLoyalty campaign name.
campaign_typestringType of campaign.Available values: LOYALTY_PROGRAM
typestringDefines 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 publishedAvailable values: AUTO_UPDATE, STATIC | | voucher | See: Loyalty Card | | auto_joinboolean | Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. | | join_onceboolean | If this value is set to true, customers will be able to join the campaign only once. | | use_voucher_metadata_schemaboolean | Flag indicating whether the campaign is to use the voucher’s metadata schema instead of the campaign metadata schema. | | start_datestring | 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_datestring | 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 | See: Validity Timeframe | | validity_day_of_week | See: Validity Day Of Week | | validity_hours | See: Validity Hours | | activity_duration_after_publishingstring | Defines the amount of time the vouchers will be active after publishing. The value is shown in the ISO 8601 format. For example, a voucher with the value of P24D will be valid for a duration of 24 days. | | descriptionstring | An optional field to keep any extra textual information about the campaign such as a campaign description and details. | | vouchers_countinteger | Total number of unique vouchers in campaign. | | activeboolean | 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 | | metadataobject | 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_atstring | 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_atstring | 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_statusstring | Indicates the status of the campaign creation.Available values: DONE, IN_PROGRESS, FAILED, DRAFT, MODIFYING | | vouchers_generation_statusstring | Indicates the status of the campaign’s vouchers.Available values: DONE, IN_PROGRESS, FAILED, DRAFT | | protectedboolean | Indicates whether the resource can be deleted. | | access_settings_assignments | See: Access Settings Campaign Assignments List | | category_idstring | Unique category ID that this campaign belongs to.Example:cat_0b688929a2476386a7 | | categories | See: Category | | loyalty_tiers_expirationobject | Defines the expiration mechanism for loyalty tiers.One of: Balance, Points in Period | | objectstring | The type of the object represented by JSON. This object stores information about the campaign. |

Loyalty Card

AttributesDescription
typestringType of voucher.
loyalty_cardobjectDefines the loyalty card details.Attributes Descriptionpointsinteger Initial loyalty card income in points to be applied to the loyalty card at voucher generation. expiration_rulesobject Defines point expiration rules. Attributes Descriptionperiod_typestring The expiration period. Available values: MONTH period_valueinteger How many periods should pass before the expiration occurs. rounding_typestring 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
redemptionobjectDefines the redemption limits on vouchers.Attributes Descriptionquantityinteger How many times a voucher can be redeemed. A null value means unlimited.
code_configobjectDefines code’s pattern (prefix, suffix, length, charset, etc).Attributes Descriptionlengthstring Number of characters in a generated code (excluding prefix and postfix). charsetstring 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 prefixstring A text appended before the code. postfixstring A text appended after the code. patternstring A pattern for codes where hashes (#) will be replaced with random characters. Overrides length.
is_referral_codebooleanFlag indicating whether this voucher is a referral code; true for campaign type REFERRAL_PROGRAM.

Validity Timeframe

AttributesDescription
durationstringDefines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a duration of PT1H will be valid for a duration of one hour.Example:PT1H
intervalstringDefines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an interval of P2D will be valid every other day.Example:P2D

Validity Day Of Week

Integer array corresponding to the particular days of the week in which the voucher is valid.
  • 0 Sunday
  • 1 Monday
  • 2 Tuesday
  • 3 Wednesday
  • 4 Thursday
  • 5 Friday
  • 6 Saturday

Validity Hours

AttributesDescription
dailyarrayDefines the reccuring period(s) when the resource is active. The periods should not overlap.Array of:Attributes Descriptionstart_timestring Defines the starting hour of validity in the HH:mm format. The resource is inactive before this time. Example: 12:00 days_of_weekarray Integer array corresponding to the particular days of the week in which the resource is valid. 0 Sunday 1 Monday 2 Tuesday 3 Wednesday 4 Thursday 5 Friday 6 Saturday expiration_timestring Defines the ending hour of validity in the HH:mm format. The resource is inactive after this time. Example: 14:00

Access Settings Campaign Assignments List

AttributesDescription
objectstringThe type of the object represented by JSON. Default is list. This object stores information about campaign assignments to areas and storesAvailable values: list
data_refstringIdentifies the name of the attribute that contains the array of campaign assignments.Available values: data
dataarrayContains an array of campaign assignments.Array of Areas and Stores Campain Assignment
totalintegerTotal number of areas and stores to which the campaign is assigned.

Category

AttributesDescription
idstringUnique category ID assigned by Voucherify.
namestringCategory name.
hierarchyintegerCategory hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
objectstringThe type of the object represented by the JSON. This object stores information about the category.Available values: category
created_atstringTimestamp 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_atstringTimestamp 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

Balance

AttributesDescription
qualification_typestringTier 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_dateobjectDefines the conditions for the start date of the tier.Attributes Descriptiontypestring What triggers the tier to be valid for a customer.IMMEDIATE: After reaching the minimum required points. Available values: IMMEDIATE
expiration_dateDefines the conditions for the expiration date of a tier.One of: Balance Drop, Custom

Points in Period

AttributesDescription
qualification_typestringTier 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_periodstringCustomers 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 DefinitionCalendar Month Points collected in one calendar monthJanuary, 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 yearJanuary - DecemberAvailable values: MONTH, QUARTER, HALF_YEAR, YEAR
start_dateobjectDefines the conditions for the start date of the tier.Attributes Descriptiontypestring 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_dateobjectDefines the conditions for the expiration date of a tier.Attributes Descriptiontypestring 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 extendstring 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.

Areas and Stores Campain Assignment

AttributesDescription
idstringUnique identifier of the campaign assignment.Example:arsca_0ef5ee192117ae2416
area_idstringUnique identifier of the area to which the campaign is assigned.Example:ar_0ea6cd7b781b8f857f
all_storesbooleanDetermines if the campaign is assigned to all of the stores in the area, i.e. if an area ID is passed in the access_settings.assign.area_all_stores_ids in the request.
area_store_idstringUnique identifier of the store to which the campaign is assigned.Example:ars_0ec347e2016bed85f4
created_atstringDate and time when the assignment was made. The value is shown in the ISO 8601 format.Example:2024-06-25T19:04:16.260Z
objectstringThe type of the object represented by JSON. This object stores information about the campaign assignment to areas or stores.Available values: area_store_campaign_assignment

Balance Drop

AttributesDescription
typestringWhat 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
typestringWhat 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
extendstringDefines 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.
roundingDefines the rounding mechanism for tier expiration.One of: Calendar Periods, Specific Month

Calendar Periods

AttributesDescription
typestringPeriod 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 | | strategystring | Which portion of the given period should the rounding be applied to.Available values: END |

Specific Month

AttributesDescription
typestringThis mechanism describes a custom rounding for the expiration date.Available values: CUSTOM
strategystringWhich portion of the given period should the rounding be applied to.Available values: END
unitstringDefines the type of unit of time in which the rounding period is counted.Available values: MONTH
valueintegerValue 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 |
⌘I