curl --request GET \
--url https://{cluster}.voucherify.io/v1/loyalties \
--header 'Authorization: Bearer <token>' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>'{
"object": "list",
"data_ref": "campaigns",
"campaigns": [
{
"id": "camp_eTIsUtuzkRXQT6rsUQqrS5Gw",
"name": "Loyalty Campaign 1",
"campaign_type": "LOYALTY_PROGRAM",
"type": "AUTO_UPDATE",
"voucher": {
"type": "LOYALTY_CARD",
"loyalty_card": {
"points": 0
},
"redemption": {
"quantity": null
},
"code_config": {
"length": 8,
"charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
"pattern": "########"
},
"is_referral_code": false
},
"auto_join": false,
"join_once": false,
"use_voucher_metadata_schema": true,
"description": "This is a campaign description.",
"vouchers_count": 6,
"active": true,
"metadata": {
"Season": "Fall"
},
"created_at": "2022-11-21T13:57:03.712Z",
"updated_at": "2022-11-23T09:59:49.581Z",
"creation_status": "DONE",
"vouchers_generation_status": "DONE",
"protected": false,
"category_id": "cat_0b6152ce12414820dc",
"categories": [],
"object": "campaign"
},
{
"id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
"name": "Loyalty Campaign - Tiers",
"campaign_type": "LOYALTY_PROGRAM",
"type": "AUTO_UPDATE",
"voucher": {
"type": "LOYALTY_CARD",
"loyalty_card": {
"points": 0
},
"redemption": {
"quantity": null
},
"code_config": {
"length": 8,
"charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
"pattern": "########",
"prefix": "LT1-",
"initial_count": 1
},
"is_referral_code": false,
"start_date": "2022-11-01T00:00:00.000Z"
},
"auto_join": false,
"join_once": false,
"use_voucher_metadata_schema": true,
"start_date": "2022-11-01T00:00:00.000Z",
"validity_day_of_week": [
1,
2,
3,
4,
5,
6
],
"vouchers_count": 3,
"active": true,
"metadata": {},
"created_at": "2022-11-09T06:26:52.985Z",
"updated_at": "2022-11-10T08:54:46.136Z",
"creation_status": "DONE",
"vouchers_generation_status": "DONE",
"protected": false,
"category_id": "cat_0b8b5a427a0283c854",
"categories": [],
"loyalty_tiers_expiration": {
"qualification_type": "BALANCE",
"start_date": {
"type": "IMMEDIATE"
},
"expiration_date": {
"type": "CUSTOM",
"extend": "P3M",
"rounding": {
"type": "MONTH",
"strategy": "END"
}
}
},
"object": "campaign"
},
{
"id": "camp_NwO6D0Z0mpZ1CDc380DnPgrW",
"name": "Loyalty Campaign Example",
"campaign_type": "LOYALTY_PROGRAM",
"type": "STATIC",
"voucher": {
"type": "LOYALTY_CARD",
"loyalty_card": {
"points": 0
},
"redemption": {
"quantity": null
},
"code_config": {
"length": 8,
"charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
"pattern": "########",
"initial_count": 1
},
"is_referral_code": false,
"start_date": "2021-12-15T00:00:00.000Z",
"expiration_date": "2021-12-31T00:00:00.000Z",
"validity_timeframe": {
"interval": "P1D",
"duration": "PT1H"
}
},
"auto_join": true,
"join_once": true,
"use_voucher_metadata_schema": true,
"start_date": "2021-12-15T00:00:00.000Z",
"expiration_date": "2021-12-31T00:00:00.000Z",
"validity_timeframe": {
"interval": "P1D",
"duration": "PT1H"
},
"validity_day_of_week": [
3,
4,
5,
6
],
"activity_duration_after_publishing": "P24D",
"vouchers_count": 0,
"active": false,
"metadata": {},
"created_at": "2021-12-15T08:02:52.298Z",
"updated_at": "2021-12-15T08:11:43.808Z",
"creation_status": "DRAFT",
"vouchers_generation_status": "DRAFT",
"protected": false,
"category_id": null,
"categories": [],
"object": "campaign"
}
],
"total": 3
}Returns a list of your loyalty campaigns.
curl --request GET \
--url https://{cluster}.voucherify.io/v1/loyalties \
--header 'Authorization: Bearer <token>' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>'{
"object": "list",
"data_ref": "campaigns",
"campaigns": [
{
"id": "camp_eTIsUtuzkRXQT6rsUQqrS5Gw",
"name": "Loyalty Campaign 1",
"campaign_type": "LOYALTY_PROGRAM",
"type": "AUTO_UPDATE",
"voucher": {
"type": "LOYALTY_CARD",
"loyalty_card": {
"points": 0
},
"redemption": {
"quantity": null
},
"code_config": {
"length": 8,
"charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
"pattern": "########"
},
"is_referral_code": false
},
"auto_join": false,
"join_once": false,
"use_voucher_metadata_schema": true,
"description": "This is a campaign description.",
"vouchers_count": 6,
"active": true,
"metadata": {
"Season": "Fall"
},
"created_at": "2022-11-21T13:57:03.712Z",
"updated_at": "2022-11-23T09:59:49.581Z",
"creation_status": "DONE",
"vouchers_generation_status": "DONE",
"protected": false,
"category_id": "cat_0b6152ce12414820dc",
"categories": [],
"object": "campaign"
},
{
"id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
"name": "Loyalty Campaign - Tiers",
"campaign_type": "LOYALTY_PROGRAM",
"type": "AUTO_UPDATE",
"voucher": {
"type": "LOYALTY_CARD",
"loyalty_card": {
"points": 0
},
"redemption": {
"quantity": null
},
"code_config": {
"length": 8,
"charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
"pattern": "########",
"prefix": "LT1-",
"initial_count": 1
},
"is_referral_code": false,
"start_date": "2022-11-01T00:00:00.000Z"
},
"auto_join": false,
"join_once": false,
"use_voucher_metadata_schema": true,
"start_date": "2022-11-01T00:00:00.000Z",
"validity_day_of_week": [
1,
2,
3,
4,
5,
6
],
"vouchers_count": 3,
"active": true,
"metadata": {},
"created_at": "2022-11-09T06:26:52.985Z",
"updated_at": "2022-11-10T08:54:46.136Z",
"creation_status": "DONE",
"vouchers_generation_status": "DONE",
"protected": false,
"category_id": "cat_0b8b5a427a0283c854",
"categories": [],
"loyalty_tiers_expiration": {
"qualification_type": "BALANCE",
"start_date": {
"type": "IMMEDIATE"
},
"expiration_date": {
"type": "CUSTOM",
"extend": "P3M",
"rounding": {
"type": "MONTH",
"strategy": "END"
}
}
},
"object": "campaign"
},
{
"id": "camp_NwO6D0Z0mpZ1CDc380DnPgrW",
"name": "Loyalty Campaign Example",
"campaign_type": "LOYALTY_PROGRAM",
"type": "STATIC",
"voucher": {
"type": "LOYALTY_CARD",
"loyalty_card": {
"points": 0
},
"redemption": {
"quantity": null
},
"code_config": {
"length": 8,
"charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
"pattern": "########",
"initial_count": 1
},
"is_referral_code": false,
"start_date": "2021-12-15T00:00:00.000Z",
"expiration_date": "2021-12-31T00:00:00.000Z",
"validity_timeframe": {
"interval": "P1D",
"duration": "PT1H"
}
},
"auto_join": true,
"join_once": true,
"use_voucher_metadata_schema": true,
"start_date": "2021-12-15T00:00:00.000Z",
"expiration_date": "2021-12-31T00:00:00.000Z",
"validity_timeframe": {
"interval": "P1D",
"duration": "PT1H"
},
"validity_day_of_week": [
3,
4,
5,
6
],
"activity_duration_after_publishing": "P24D",
"vouchers_count": 0,
"active": false,
"metadata": {},
"created_at": "2021-12-15T08:02:52.298Z",
"updated_at": "2021-12-15T08:11:43.808Z",
"creation_status": "DRAFT",
"vouchers_generation_status": "DRAFT",
"protected": false,
"category_id": null,
"categories": [],
"object": "campaign"
}
],
"total": 3
}The access token received from the authorization server in the OAuth 2.0 flow.
Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.
1 <= x <= 100Which page of results to return. The lowest value is 1.
1 <= x <= 100Includes an expanded categories object in the response. If the Areas and Stores Enterprise feature is enabled, add access_settings_assignments to return assigned areas and stores.
category, access_settings_assignments Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.
created_at, -created_at, updated_at, -updated_at Returns a dictionary with loyalty program objects. The loyalty campaigns are returned sorted by creation date, with the most recent campaigns appearing first.
Response body schema for Get /loyalties.
The type of the object represented by JSON. This object stores information about loyalty campaigns in a dictionary.
Identifies the name of the attribute that contains the array of loyalty campaign objects.
campaigns Contains an array of loyalty campaign objects.
Show child attributes
Unique campaign ID, assigned by Voucherify.
"camp_f7fBbQxUuTN7dI7tGOo5XMDA"
Campaign name.
Type of campaign.
LOYALTY_PROGRAM 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 criteriaSTATIC: vouchers need to be manually publishedAUTO_UPDATE, STATIC Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled.
Always set to true for loyalty campaigns, meaning customers can join the campaign only once. It can't be changed to false.
Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema.
Timestamp representing the date and time when the campaign was created. The value is shown in the ISO 8601 format.
"2021-12-01T08:00:50.038Z"
Indicates the status of the campaign creation.
DONE, IN_PROGRESS, FAILED, DRAFT, MODIFYING Indicates the status of the campaign's voucher generation.
DONE, IN_PROGRESS, FAILED, DRAFT, MODIFYING Indicates whether the resource can be deleted.
Unique category ID that this campaign belongs to.
"cat_0b688929a2476386a7"
Contains details about the category.
Show child attributes
Unique category ID assigned by Voucherify.
Category name.
Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
x >= 0The type of the object represented by the JSON. This object stores information about the category.
category Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.
"2022-07-14T10:45:13.156Z"
Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.
"2022-08-16T10:52:08.094Z"
The type of the object represented by JSON. This object stores information about the campaign.
An optional field to keep any extra textual information about the campaign such as a campaign description and details.
Schema model for a campaign voucher.
Show child attributes
Type of voucher.
LOYALTY_CARD Contains information about the config used for the voucher code. Defines the code's pattern (prefix, postfix, length, charset, etc).
Show child attributes
Number of characters in a generated code (excluding prefix and postfix).
Characters that can appear in the code.
Examples:
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789A pattern for codes where hashes (#) will be replaced with random characters. Overrides length.
A text appended before the code.
A text appended after the code.
Internal value, does not change anything if provided.
Always false for a loyalty card voucher
Defines the voucher loyalty card details.
Show child attributes
The initial number of points to assign to the loyalty card. This is the current loyalty card score i.e. the number of loyalty points on the card.
Defines the loyalty point expiration rule. This expiration rule applies when there are no expiration_rules defined for an earning rule.
Show child attributes
Type of period. Can be set for MONTH or FIXED_DAY_OF_YEAR. MONTH requires the period_value field. FIXED_DAY_OF_YEAR requires the fixed_month and fixed_day fields.
FIXED_DAY_OF_YEAR, MONTH Value of the period. Required for the period_type: MONTH.
Type of rounding of the expiration period. Optional for the period_type: MONTH.
END_OF_MONTH, END_OF_QUARTER, END_OF_HALF_YEAR, END_OF_YEAR, PARTICULAR_MONTH Value of rounding of the expiration period. Required for the rounding_type.
Determines the month when the points expire; 1 is January, 2 is February, and so on. Required for the period_type: FIXED_DAY_OF_YEAR.
1 <= x <= 12Determines the day of the month when the points expire. Required for the period_type: FIXED_DAY_OF_YEAR.
1 <= x <= 31Activation 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 timestamp defines when the campaign expires in ISO 8601 format. Campaign is inactive after this date.
"2022-09-30T00:00:00.000Z"
Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.
Show child attributes
Defines 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.
"PT1H"
Defines 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.
"P2D"
Integer array corresponding to the particular days of the week in which the voucher is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Determines the hours of validity, e.g. to create a happy hours scenario.
Show child attributes
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Show child attributes
Defines the starting hour of validity in the HH:mm format. The resource is inactive before this time.
"12:00"
Integer array corresponding to the particular days of the week in which the resource is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Defines the ending hour of validity in the HH:mm format. The resource is inactive after this time.
"14:00"
Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.
Show child attributes
Defines 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.
"PT1H"
Defines 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.
"P2D"
Integer array corresponding to the particular days of the week in which the voucher is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Determines the hours of validity, e.g. to create a happy hours scenario.
Show child attributes
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Show child attributes
Defines the starting hour of validity in the HH:mm format. The resource is inactive before this time.
"12:00"
Integer array corresponding to the particular days of the week in which the resource is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Defines the ending hour of validity in the HH:mm format. The resource is inactive after this time.
"14:00"
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.
Total number of unique vouchers in campaign.
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 timestamp defines when the campaign expires in ISO 8601 format. Campaign is inactive after this date.
"2022-09-30T00:00:00.000Z"
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 campaignfalse indicates an inactive campaignThe 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.
Timestamp representing the date and time when the campaign was last updated in ISO 8601 format.
"2022-09-20T09:18:19.623Z"
Unique category name.
Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles.
Defines the Loyalty Tiers Expiration.
Show child attributes
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.
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.
BALANCE, POINTS_IN_PERIOD Defines the conditions for the start date of the tier.
Show child attributes
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.
IMMEDIATE, NEXT_PERIOD Defines the conditions for the expiration date of a tier.
Show child attributes
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.
BALANCE_DROP: Tier expires when the points balance drops below the required range of the tier.
CUSTOM: Tier expires after a certain time period passes following the instance the points balance drops below the required range of the tier.
END_OF_PERIOD, END_OF_NEXT_PERIOD, BALANCE_DROP, CUSTOM 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.
Defines the rounding mechanism for tier expiration.
Show child attributes
This mechanism describes a custom rounding for the expiration date.
MONTH, QUARTER, HALF_YEAR, YEAR, CUSTOM This mechanism describes a rounding strategy for the expiration date.
START, END Defines the type of unit of time in which the rounding period is counted.
MONTH Value for the unit of time that the rounding applies to. Units for this parameter are defined by the rounding.unit parameter.
0: January1: February2: March3: April4: May5: June6: July7: August8: September9: October10: November11: DecemberCustomers 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 |
MONTH, QUARTER, HALF_YEAR, YEAR List of Validation Rules Assignments
Show child attributes
The type of the object represented by JSON. This object stores information about validation rules assignments.
list Identifies the name of the attribute that contains the array of validation rules assignments.
data Contains array of validation rules assignments.
Show child attributes
The unique identifier for a assignment
The unique identifier for a rule
The unique identifier for a related object
The type of related object
The type of the object represented by JSON.
validation_rules_assignment Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
"2022-03-09T11:19:04.819Z"
Timestamp representing the date and time when the object was last updated in ISO 8601 format.
"2022-03-09T11:19:04.819Z"
The validation status of the assignment
VALID, PARTIALLY_VALID, INVALID The list of omitted rules
Total number of validation rules assignments.
x >= 0Lists all assignments of the campaign to areas and stores. For GET List Campaigns, this is returned if the expand=access_settings_assignments query parameter is passed in the request. This object is not returned for the GET Campaign summary endpoint.
NOTE: This object is returned only if the Areas and Stores enterprise feature is enabled. Contact Voucherify Sales to learn more.
Show child attributes
The type of the object represented by JSON. Default is list. This object stores information about campaign assignments to areas and stores
list Identifies the name of the attribute that contains the array of campaign assignments.
data Contains an array of campaign assignments.
Show child attributes
Unique identifier of the campaign assignment.
"arsca_0ef5ee192117ae2416"
Unique identifier of the area to which the campaign is assigned.
"ar_0ea6cd7b781b8f857f"
Date and time when the assignment was made. The value is shown in the ISO 8601 format.
"2024-06-25T19:04:16.260Z"
The type of the object represented by JSON. This object stores information about the campaign assignment to areas or stores.
area_store_campaign_assignment Determines 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.
Unique identifier of the store to which the campaign is assigned.
"ars_0ec347e2016bed85f4"
Total number of areas and stores to which the campaign is assigned.
x >= 0Total number of loyalty campaign objects.
Was this page helpful?