Skip to main content
POST
/
v1
/
rewards
/
{rewardId}
/
assignments
Create Reward Assignment
curl --request POST \
  --url https://{cluster}.voucherify.io/v1/rewards/{rewardId}/assignments \
  --header 'Authorization: Bearer <token>' \
  --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
    }
  }
}'
{
"id": "rewa_cqD2XE5x8LcD2c1FLlvqikti",
"reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY",
"related_object_id": "camp_OTuGGP90PivbvROsRvfM65El",
"related_object_type": "campaign",
"parameters": {
"loyalty": {
"points": 39
}
},
"created_at": "2022-08-24T13:44:42.610Z",
"updated_at": null,
"object": "reward_assignment"
}

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required
Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

rewardId
string
required

A unique reward ID.

Example:

"rew_2erjvECLs92GYzKbak3QkyTV"

Body

application/json

Provide the campaign ID of the campaign to which the reward is to be assigned and define the cost of the reward in terms of loyalty points.

  • Rewards Assignments Create Request Body
  • Pay with Points Reward

Request body schema for POST v1/rewards/{rewardID}/assignments.

campaign
string
required

The campaign ID of the campaign to which the reward is to be assigned.

parameters
object
required

Defines the cost of the reward.

Response

Returns a reward assignment object.

Response body schema for POST v1/rewards/{rewardId}/assignments/.

id
string
required

Unique reward assignment ID, assigned by Voucherify.

Example:

"rewa_PbIRoMXpwe5QhobW4JKu0VjH"

reward_id
string
required

Associated reward ID.

Example:

"rew_C7wS9eHFDN4CIbXI5PpLSkGY"

created_at
string<date-time>
required

Timestamp representing the date and time when the reward assignment was created. The value is shown in the ISO 8601 format.

Example:

"2022-08-11T14:49:22.586Z"

updated_at
string<date-time> | null
required

Timestamp representing the date and time when the reward assignment was updated. The value is shown in the ISO 8601 format.

Example:

"2022-08-11T16:01:34.885Z"

object
enum<string>
default:reward_assignment
required

The type of the object represented by the JSON. This object stores information about the reward assignment.

Available options:
reward_assignment

Related object ID to which the reward was assigned.

Example:

"camp_wciTvaOfYmAa3EmIIW3QpXXZ"

Related object type to which the reward was assigned.

Available options:
campaign
parameters
object

Defines the cost of the reward.

I