curl --request PUT \
--url https://{cluster}.voucherify.io/v1/loyalties/{campaignId} \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"description": "This is a campaign description. Updated",
"auto_join": false,
"join_once": false,
"start_date": "2013-10-26T00:00:00Z",
"expiration_date": "2025-10-26T00:00:00Z",
"validity_timeframe": {
"duration": "PT2H",
"interval": "P2D"
},
"validity_day_of_week": [
0,
1,
2,
3,
4,
5,
6
],
"activity_duration_after_publishing": "P25D",
"category_id": "cat_0b6152ce12414820dd",
"loyalty_card": {
"points": 1,
"expiration_rules": {
"period_type": "MONTH",
"period_value": 4,
"rounding_type": "END_OF_YEAR"
}
},
"metadata": {
"test": false
},
"type": "AUTO_UPDATE",
"loyalty_tiers_expiration": {
"qualification_type": "BALANCE",
"start_date": {
"type": "IMMEDIATE"
},
"expiration_date": {
"type": "CUSTOM",
"extend": "P4M",
"rounding": {
"type": "CUSTOM",
"unit": "MONTH",
"value": 1
}
}
}
}
'{
"id": "camp_wGlqXtnHddb39DvHuuhvvbxi",
"name": "Loyalty Program 4",
"campaign_type": "LOYALTY_PROGRAM",
"type": "AUTO_UPDATE",
"voucher": {
"type": "LOYALTY_CARD",
"loyalty_card": {
"points": 1,
"expiration_rules": {
"period_type": "MONTH",
"period_value": 4,
"rounding_type": "END_OF_YEAR"
}
},
"redemption": {
"quantity": 2
},
"code_config": {
"length": 7,
"charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
"pattern": "L-CARD-#######"
},
"is_referral_code": false,
"start_date": "2013-10-26T00:00:00.000Z",
"expiration_date": "2025-10-26T00:00:00.000Z",
"validity_timeframe": {
"interval": "P2D",
"duration": "PT2H"
}
},
"auto_join": false,
"join_once": false,
"use_voucher_metadata_schema": true,
"description": "This is a campaign description. Updated",
"start_date": "2013-10-26T00:00:00.000Z",
"expiration_date": "2025-10-26T00:00:00.000Z",
"validity_timeframe": {
"interval": "P2D",
"duration": "PT2H"
},
"validity_day_of_week": [
0,
1,
2,
3,
4,
5,
6
],
"activity_duration_after_publishing": "P25D",
"vouchers_count": 2,
"active": true,
"metadata": {
"test": false
},
"created_at": "2022-11-29T13:10:30.848Z",
"updated_at": "2022-11-29T14:08:30.655Z",
"category": "Lorem_Ipsum",
"creation_status": "MODIFYING",
"vouchers_generation_status": "MODIFYING",
"protected": false,
"validation_rules_assignments": {
"object": "list",
"data_ref": "data",
"data": [],
"total": 0
},
"category_id": "cat_0b6152ce12414820dd",
"categories": [
{
"id": "cat_0b6152ce12414820dd",
"name": "Lorem_Ipsum",
"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": "P4M",
"rounding": {
"type": "CUSTOM",
"strategy": "END",
"unit": "MONTH",
"value": 1
}
}
},
"object": "campaign"
}{
"code": 400,
"key": "resource_protected",
"message": "Resource is protected",
"details": "Resource campaign with id camp_oazbyS2Y3SxKLCh9yQ3pqFr6 is protected and cannot be modified",
"request_id": "v-0f7548b67cc7ed8dff",
"resource_id": "camp_oazbyS2Y3SxKLCh9yQ3pqFr6",
"resource_type": "campaign"
}{
"code": 403,
"key": "forbidden",
"message": "Forbidden",
"details": "Resource campaign with id camp_7u3ZPLSByANMXjBkAs4kT2nS is not accessible in given context",
"request_id": "v-0f005192bfce923bb7",
"resource_id": "camp_7u3ZPLSByANMXjBkAs4kT2nS",
"resource_type": "campaign"
}Update 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.
Updates a loyalty campaign.
Fields other than those specified in the allowed request body payload won’t be modified (even if provided they are silently skipped). Any parameters not provided will be left unchanged.
This method will update the loyalty cards which have not been published or redeemed yet.
curl --request PUT \
--url https://{cluster}.voucherify.io/v1/loyalties/{campaignId} \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"description": "This is a campaign description. Updated",
"auto_join": false,
"join_once": false,
"start_date": "2013-10-26T00:00:00Z",
"expiration_date": "2025-10-26T00:00:00Z",
"validity_timeframe": {
"duration": "PT2H",
"interval": "P2D"
},
"validity_day_of_week": [
0,
1,
2,
3,
4,
5,
6
],
"activity_duration_after_publishing": "P25D",
"category_id": "cat_0b6152ce12414820dd",
"loyalty_card": {
"points": 1,
"expiration_rules": {
"period_type": "MONTH",
"period_value": 4,
"rounding_type": "END_OF_YEAR"
}
},
"metadata": {
"test": false
},
"type": "AUTO_UPDATE",
"loyalty_tiers_expiration": {
"qualification_type": "BALANCE",
"start_date": {
"type": "IMMEDIATE"
},
"expiration_date": {
"type": "CUSTOM",
"extend": "P4M",
"rounding": {
"type": "CUSTOM",
"unit": "MONTH",
"value": 1
}
}
}
}
'{
"id": "camp_wGlqXtnHddb39DvHuuhvvbxi",
"name": "Loyalty Program 4",
"campaign_type": "LOYALTY_PROGRAM",
"type": "AUTO_UPDATE",
"voucher": {
"type": "LOYALTY_CARD",
"loyalty_card": {
"points": 1,
"expiration_rules": {
"period_type": "MONTH",
"period_value": 4,
"rounding_type": "END_OF_YEAR"
}
},
"redemption": {
"quantity": 2
},
"code_config": {
"length": 7,
"charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
"pattern": "L-CARD-#######"
},
"is_referral_code": false,
"start_date": "2013-10-26T00:00:00.000Z",
"expiration_date": "2025-10-26T00:00:00.000Z",
"validity_timeframe": {
"interval": "P2D",
"duration": "PT2H"
}
},
"auto_join": false,
"join_once": false,
"use_voucher_metadata_schema": true,
"description": "This is a campaign description. Updated",
"start_date": "2013-10-26T00:00:00.000Z",
"expiration_date": "2025-10-26T00:00:00.000Z",
"validity_timeframe": {
"interval": "P2D",
"duration": "PT2H"
},
"validity_day_of_week": [
0,
1,
2,
3,
4,
5,
6
],
"activity_duration_after_publishing": "P25D",
"vouchers_count": 2,
"active": true,
"metadata": {
"test": false
},
"created_at": "2022-11-29T13:10:30.848Z",
"updated_at": "2022-11-29T14:08:30.655Z",
"category": "Lorem_Ipsum",
"creation_status": "MODIFYING",
"vouchers_generation_status": "MODIFYING",
"protected": false,
"validation_rules_assignments": {
"object": "list",
"data_ref": "data",
"data": [],
"total": 0
},
"category_id": "cat_0b6152ce12414820dd",
"categories": [
{
"id": "cat_0b6152ce12414820dd",
"name": "Lorem_Ipsum",
"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": "P4M",
"rounding": {
"type": "CUSTOM",
"strategy": "END",
"unit": "MONTH",
"value": 1
}
}
},
"object": "campaign"
}{
"code": 400,
"key": "resource_protected",
"message": "Resource is protected",
"details": "Resource campaign with id camp_oazbyS2Y3SxKLCh9yQ3pqFr6 is protected and cannot be modified",
"request_id": "v-0f7548b67cc7ed8dff",
"resource_id": "camp_oazbyS2Y3SxKLCh9yQ3pqFr6",
"resource_type": "campaign"
}{
"code": 403,
"key": "forbidden",
"message": "Forbidden",
"details": "Resource campaign with id camp_7u3ZPLSByANMXjBkAs4kT2nS is not accessible in given context",
"request_id": "v-0f005192bfce923bb7",
"resource_id": "camp_7u3ZPLSByANMXjBkAs4kT2nS",
"resource_type": "campaign"
}Authorizations
Scopes
Path Parameters
Body
Specify the new values for the parameters that you would like to update for the given loyalty campaign.
Legacy loyalty. Request body schema for PUT /loyalties/{campaignId}.
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
Defines whether the campaign can be updated with new vouchers after campaign creation.
AUTO_UPDATE: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method).STATIC: vouchers need to be manually published.
If the type of the campaign is STANDALONE, the type cannot be changed. Also, the type cannot be changed to STANDALONE.
AUTO_UPDATE, STATIC Response
Returns the loyalty campaign object if the update succeeded.
Legacy loyalty. Response body schema for PUT /loyalties/{campaignId}.
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

