curl --request POST \
--url https://{cluster}.voucherify.io/v1/rewards/{rewardId}/assignments \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"campaign": "camp_OTuGGP90PivbvROsRvfM65El",
"parameters": {
"loyalty": {
"points": 39
}
}
}
'Create Reward Assignment
Assigns a reward to a related object.
For legacy loyalty and digital or material rewards, send campaign with a loyalty or referral campaign ID.
For a LOYALTY_POINTS reward (credits a v2/loyalties (loyalty hub) card), send related_object_type referral_tier and related_object_id set to the referral tier ID. A LOYALTY_POINTS reward cannot be assigned to a campaign. Assigning it with campaign (or any non-referral_tier related object) returns 400 with invalid_related_to.
POST /v1/loyalties/{campaignId}/rewards also cannot assign a LOYALTY_POINTS reward to a campaign.
For Loyalty hub program rewards, use /v2/loyalties reward endpoints.
curl --request POST \
--url https://{cluster}.voucherify.io/v1/rewards/{rewardId}/assignments \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"campaign": "camp_OTuGGP90PivbvROsRvfM65El",
"parameters": {
"loyalty": {
"points": 39
}
}
}
'Authorizations
Scopes
Body
For digital, material, and pay-with-points rewards, provide the campaign ID and, when required, the loyalty points cost. For a LOYALTY_POINTS reward, provide related_object_type referral_tier and the referral tier ID.
- Digital Or Material Reward
- Pay with Points Reward
- Loyalty Hub Points Reward
Request body schema for POST v1/rewards/{rewardID}/assignments.
Response
Returns a reward assignment object.
Response body schema for POST v1/rewards/{rewardId}/assignments/.
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 
