curl --request POST \
--url https://{cluster}.voucherify.io/v1/loyalties/{campaignId}/rewards \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
[
{
"reward": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm",
"parameters": {
"loyalty": {
"points": 2
}
}
},
{
"reward": "rew_z35ffKoH0tCcck8EL56p6SIs",
"parameters": {
"loyalty": {
"points": 2
}
}
}
]
'[
{
"id": "rewa_Iw9VopmlLm0topBG17ZH1gp5",
"reward_id": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm",
"related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
"related_object_type": "campaign",
"parameters": {
"loyalty": {
"points": 2
}
},
"created_at": "2022-11-28T18:54:19.747Z",
"updated_at": null,
"object": "reward_assignment"
},
{
"id": "rewa_tAFZ7cHiTwZyOg1QaWHt6yYv",
"reward_id": "rew_z35ffKoH0tCcck8EL56p6SIs",
"related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
"related_object_type": "campaign",
"parameters": {
"loyalty": {
"points": 2
}
},
"created_at": "2022-11-28T18:54:19.747Z",
"updated_at": null,
"object": "reward_assignment"
}
]{
"code": 409,
"key": "duplicate_found",
"message": "Duplicated resource found",
"details": "Duplicated reward_assignment exists with id rewa_50O40FgyojhUiZAs3vDQbKiC",
"request_id": "v-0c11a10ed2ce676da9",
"resource_id": "rewa_50O40FgyojhUiZAs3vDQbKiC",
"resource_type": "reward_assignment"
}Create Loyalty Campaign Reward Assignment
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.
Add rewards to a loyalty campaign.
A LOYALTY_POINTS reward cannot be assigned to a campaign. Use POST v1/rewards/{rewardId}/assignments with related_object_type referral_tier instead.
curl --request POST \
--url https://{cluster}.voucherify.io/v1/loyalties/{campaignId}/rewards \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
[
{
"reward": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm",
"parameters": {
"loyalty": {
"points": 2
}
}
},
{
"reward": "rew_z35ffKoH0tCcck8EL56p6SIs",
"parameters": {
"loyalty": {
"points": 2
}
}
}
]
'[
{
"id": "rewa_Iw9VopmlLm0topBG17ZH1gp5",
"reward_id": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm",
"related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
"related_object_type": "campaign",
"parameters": {
"loyalty": {
"points": 2
}
},
"created_at": "2022-11-28T18:54:19.747Z",
"updated_at": null,
"object": "reward_assignment"
},
{
"id": "rewa_tAFZ7cHiTwZyOg1QaWHt6yYv",
"reward_id": "rew_z35ffKoH0tCcck8EL56p6SIs",
"related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
"related_object_type": "campaign",
"parameters": {
"loyalty": {
"points": 2
}
},
"created_at": "2022-11-28T18:54:19.747Z",
"updated_at": null,
"object": "reward_assignment"
}
]{
"code": 409,
"key": "duplicate_found",
"message": "Duplicated resource found",
"details": "Duplicated reward_assignment exists with id rewa_50O40FgyojhUiZAs3vDQbKiC",
"request_id": "v-0c11a10ed2ce676da9",
"resource_id": "rewa_50O40FgyojhUiZAs3vDQbKiC",
"resource_type": "reward_assignment"
}Authorizations
Scopes
Path Parameters
Body
Define the cost of the rewards in loyalty points.
- Loyalties Rewards Create Assignment Item Digital Or Material Request Body
- Loyalties Rewards Create Assignment Item Coin Request Body
Request item for assigning a digital or material reward to a legacy loyalty campaign.
Response
Returns a list of reward assignment objects.
Response body schema for POST v1/v1/loyalties/{campaignId}/rewards.
Related object type to which the reward was assigned. Use campaign for legacy loyalty campaign rewards. Use referral_tier for LOYALTY_POINTS rewards that credit a v2/loyalties (loyalty hub) card from a referral tier. A LOYALTY_POINTS reward can only be assigned to a referral tier.
campaign, referral_tier 
