Skip to main content
PUT
/
v1
/
rewards
/
{rewardId}
curl --request PUT \
--url https://{cluster}.voucherify.io/v1/rewards/{rewardId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '{
"name": "Digital - Gift Card Reward",
"metadata": {
"Type": "Gift"
},
"parameters": {
"campaign": {
"id": "camp_hC2GdqYtOmTT45zfhib62cK1",
"balance": 3000
}
}
}'
{
  "id": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm",
  "name": "Get a Comic Book",
  "type": "MATERIAL",
  "parameters": {
    "product": {
      "id": "prod_0b15f6b9f650c16990",
      "sku_id": "sku_0b1621b319d248b79f"
    }
  },
  "stock": "2",
  "redeemed": null,
  "attributes": {
    "image_url": "{{internalVoucherifyURL}}",
    "description": "Comic book"
  },
  "created_at": "2022-08-25T10:00:12.794Z",
  "updated_at": "2022-08-25T10:06:30.655Z",
  "metadata": {
    "Type": "Physical product"
  },
  "object": "reward"
}

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

Define the parameters to be updated for the reward.

  • Digital Reward
  • Material Reward
  • Pay with Points Reward

Request body schema for PUT v1/rewards/{rewardId}. Request body schema for updating a digital reward using PUT v1/rewards/{rewardId}.

name
string

Reward name.

parameters
object

Configure a digital (CAMPAIGN) reward. These can be in the form of discount coupons, gift card credits, or loyalty point credits.

metadata
object

The metadata object stores all custom attributes assigned to the reward. A set of key/value pairs that you can attach to a reward object. It can be useful for storing additional information about the reward in a structured format.

Response

Returns an updated reward object.

Response body schema for PUT v1/rewards/{rewardId}.

id
string
required

Unique reward ID, assigned by Voucherify.

Example:

"rew_nIy4gHpQHle2c3pNMwuj7G6j"

name
string
required

Reward name.

stock
integer | null
required

Configurable for material rewards. The number of units of the product that you want to share as reward.

redeemed
integer | null
required

Defines the number of already invoked (successful) reward redemptions.

metadata
object
required

The metadata object stores all custom attributes assigned to the reward. A set of key/value pairs that you can attach to a reward object. It can be useful for storing additional information about the reward in a structured format.

type
enum<string>
required

Reward type.

Available options:
CAMPAIGN,
COIN,
MATERIAL
created_at
string<date-time>
required

Timestamp representing the date and time when the reward 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 was updated. The value is shown in the ISO 8601 format.

Example:

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

object
enum<string>
default:reward
required

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

Available options:
reward
attributes
object

These properties are configurable for material rewards.

parameters
object

Defines how the reward is generated.

  • Digital
  • Pay with Points
  • Material
I