curl --request POST \
--url https://{cluster}.voucherify.io/v1/loyalties \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"name": "Loyalty Program 4",
"description": "This is a campaign description.",
"auto_join": true,
"join_once": true,
"use_voucher_metadata_schema": true,
"start_date": "2016-10-26T00:00:00Z",
"expiration_date": "2024-10-26T00:00:00Z",
"validity_timeframe": {
"duration": "PT1H",
"interval": "P1D"
},
"validity_day_of_week": [
0,
1,
2,
3,
4,
5
],
"activity_duration_after_publishing": "P24D",
"category_id": "cat_0b6152ce12414820dc",
"vouchers_count": 2,
"voucher": {
"type": "LOYALTY_CARD",
"loyalty_card": {
"points": 0,
"expiration_rules": {
"period_type": "MONTH",
"period_value": 3,
"rounding_type": "END_OF_QUARTER"
}
},
"redemption": {
"quantity": 2
},
"code_config": {
"pattern": "L-CARD-#######"
}
},
"metadata": {
"test": true
},
"type": "STATIC",
"loyalty_tiers_expiration": {
"qualification_type": "BALANCE",
"start_date": {
"type": "IMMEDIATE"
},
"expiration_date": {
"type": "CUSTOM",
"extend": "P3M",
"rounding": {
"type": "MONTH",
"strategy": "END"
}
}
}
}
'{
"id": "camp_wGlqXtnHddb39DvHuuhvvbxi",
"name": "Loyalty Program 4",
"campaign_type": "LOYALTY_PROGRAM",
"type": "STATIC",
"voucher": {
"type": "LOYALTY_CARD",
"loyalty_card": {
"points": 0,
"expiration_rules": {
"period_type": "MONTH",
"period_value": 3,
"rounding_type": "END_OF_QUARTER"
}
},
"redemption": {
"quantity": 2
},
"code_config": {
"length": 7,
"charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
"pattern": "L-CARD-#######"
},
"is_referral_code": false,
"start_date": "2016-10-26T00:00:00.000Z",
"expiration_date": "2024-10-26T00:00:00.000Z",
"validity_timeframe": {
"interval": "P1D",
"duration": "PT1H"
}
},
"auto_join": true,
"join_once": true,
"use_voucher_metadata_schema": true,
"description": "This is a campaign description.",
"start_date": "2016-10-26T00:00:00.000Z",
"expiration_date": "2024-10-26T00:00:00.000Z",
"validity_timeframe": {
"interval": "P1D",
"duration": "PT1H"
},
"validity_day_of_week": [
0,
1,
2,
3,
4,
5
],
"activity_duration_after_publishing": "P24D",
"vouchers_count": 0,
"active": true,
"metadata": {
"test": true
},
"created_at": "2022-11-29T13:10:30.848Z",
"category": "New Customers",
"creation_status": "IN_PROGRESS",
"vouchers_generation_status": "IN_PROGRESS",
"protected": false,
"validation_rules_assignments": {
"object": "list",
"data_ref": "data",
"data": [],
"total": 0
},
"category_id": "cat_0b6152ce12414820dc",
"categories": [
{
"id": "cat_0b6152ce12414820dc",
"name": "New Customers",
"hierarchy": 0,
"created_at": "2022-07-14T20:17:07.657Z",
"object": "category"
}
],
"loyalty_tiers_expiration": {
"qualification_type": "BALANCE",
"start_date": {
"type": "IMMEDIATE"
},
"expiration_date": {
"type": "CUSTOM",
"extend": "P3M",
"rounding": {
"type": "MONTH",
"strategy": "END"
}
}
},
"object": "campaign"
}{
"code": 409,
"key": "duplicate_found",
"message": "Duplicated resource found",
"details": "Duplicated campaign exists with name Loyalty Program 2",
"request_id": "v-0c12951ec58e67577e",
"resource_id": "Loyalty Program 2",
"resource_type": "campaign"
}Create Loyalty Campaign
This endpoint belongs to the legacy loyalty API (/v1/loyalties).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use Loyalty v2.
If you have questions, contact Voucherify support.
Creates a batch of loyalty cards aggregated in a single loyalty campaign. It also allows you to define a custom codes pattern.
All codes are unique across the whole project. Voucherify won’t allow to generate the same codes in any of your campaigns.
This is an asynchronous action, you can’t read or modify a newly created campaign until the code generation is completed. See creation_status field in the loyalty campaign object description.
curl --request POST \
--url https://{cluster}.voucherify.io/v1/loyalties \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"name": "Loyalty Program 4",
"description": "This is a campaign description.",
"auto_join": true,
"join_once": true,
"use_voucher_metadata_schema": true,
"start_date": "2016-10-26T00:00:00Z",
"expiration_date": "2024-10-26T00:00:00Z",
"validity_timeframe": {
"duration": "PT1H",
"interval": "P1D"
},
"validity_day_of_week": [
0,
1,
2,
3,
4,
5
],
"activity_duration_after_publishing": "P24D",
"category_id": "cat_0b6152ce12414820dc",
"vouchers_count": 2,
"voucher": {
"type": "LOYALTY_CARD",
"loyalty_card": {
"points": 0,
"expiration_rules": {
"period_type": "MONTH",
"period_value": 3,
"rounding_type": "END_OF_QUARTER"
}
},
"redemption": {
"quantity": 2
},
"code_config": {
"pattern": "L-CARD-#######"
}
},
"metadata": {
"test": true
},
"type": "STATIC",
"loyalty_tiers_expiration": {
"qualification_type": "BALANCE",
"start_date": {
"type": "IMMEDIATE"
},
"expiration_date": {
"type": "CUSTOM",
"extend": "P3M",
"rounding": {
"type": "MONTH",
"strategy": "END"
}
}
}
}
'{
"id": "camp_wGlqXtnHddb39DvHuuhvvbxi",
"name": "Loyalty Program 4",
"campaign_type": "LOYALTY_PROGRAM",
"type": "STATIC",
"voucher": {
"type": "LOYALTY_CARD",
"loyalty_card": {
"points": 0,
"expiration_rules": {
"period_type": "MONTH",
"period_value": 3,
"rounding_type": "END_OF_QUARTER"
}
},
"redemption": {
"quantity": 2
},
"code_config": {
"length": 7,
"charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
"pattern": "L-CARD-#######"
},
"is_referral_code": false,
"start_date": "2016-10-26T00:00:00.000Z",
"expiration_date": "2024-10-26T00:00:00.000Z",
"validity_timeframe": {
"interval": "P1D",
"duration": "PT1H"
}
},
"auto_join": true,
"join_once": true,
"use_voucher_metadata_schema": true,
"description": "This is a campaign description.",
"start_date": "2016-10-26T00:00:00.000Z",
"expiration_date": "2024-10-26T00:00:00.000Z",
"validity_timeframe": {
"interval": "P1D",
"duration": "PT1H"
},
"validity_day_of_week": [
0,
1,
2,
3,
4,
5
],
"activity_duration_after_publishing": "P24D",
"vouchers_count": 0,
"active": true,
"metadata": {
"test": true
},
"created_at": "2022-11-29T13:10:30.848Z",
"category": "New Customers",
"creation_status": "IN_PROGRESS",
"vouchers_generation_status": "IN_PROGRESS",
"protected": false,
"validation_rules_assignments": {
"object": "list",
"data_ref": "data",
"data": [],
"total": 0
},
"category_id": "cat_0b6152ce12414820dc",
"categories": [
{
"id": "cat_0b6152ce12414820dc",
"name": "New Customers",
"hierarchy": 0,
"created_at": "2022-07-14T20:17:07.657Z",
"object": "category"
}
],
"loyalty_tiers_expiration": {
"qualification_type": "BALANCE",
"start_date": {
"type": "IMMEDIATE"
},
"expiration_date": {
"type": "CUSTOM",
"extend": "P3M",
"rounding": {
"type": "MONTH",
"strategy": "END"
}
}
},
"object": "campaign"
}{
"code": 409,
"key": "duplicate_found",
"message": "Duplicated resource found",
"details": "Duplicated campaign exists with name Loyalty Program 2",
"request_id": "v-0c12951ec58e67577e",
"resource_id": "Loyalty Program 2",
"resource_type": "campaign"
}Authorizations
Scopes
Body
Specify the loyalty campaign details.
Legacy loyalty. Request body schema for POST /loyalties.
Defines whether the campaign can be updated with new vouchers after campaign creation or if the campaign consists of generic (standalone) vouchers.
AUTO_UPDATE: the campaign is dynamic, i.e. vouchers will generate based on set criteriaSTATIC: vouchers need to be manually publishedSTANDALONE: the campaign is a generic (standalone) one with a single voucher for public use (only for discount and gift card campaigns)
AUTO_UPDATE, STATIC, STANDALONE Assigns or unassigns an area or store to the campaign.
NOTE: this object can be sent if the Areas and Stores enterprise feature is enabled. Contact Voucherify Sales to learn more.
Show child attributes
Show child attributes
Response
Returns a campaign object with its settings but without the loyalty card codes.
Legacy loyalty. Response body schema for POST /loyalties.
Lists 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
Show child attributes

