Skip to main content
POST
/
v1
/
rewards
curl --request POST \
--url https://{cluster}.voucherify.io/v1/rewards \
--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",
"type": "CAMPAIGN",
"metadata": {
"Type": "Gift"
},
"parameters": {
"campaign": {
"id": "camp_hC2GdqYtOmTT45zfhib62cK1",
"balance": 3000
}
}
}'
{
  "id": "rew_Crmu3hu2FKZWZIML59AeAs1n",
  "name": "Material Reward",
  "type": "MATERIAL",
  "parameters": {
    "product": {
      "id": "prod_0b15f6b9f650c16990",
      "sku_id": "sku_0b1621b319d248b79f"
    }
  },
  "stock": "2",
  "redeemed": null,
  "attributes": {
    "image_url": "{{internalVoucherifyURL}}",
    "description": "Archie's Series"
  },
  "created_at": "2022-08-25T11:20:58.172Z",
  "updated_at": null,
  "metadata": {
    "Type": "Material"
  },
  "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.

Body

application/json

Define parameters of the new reward.

  • Digital Reward
  • Material Reward
  • Pay with Points Reward

Request body schema for POST v1/rewards. Request body schema for creating a digital reward using POST v1/rewards.

parameters
object
required

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

name
string

Reward name.

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

200 - application/json

Returns a reward object.

Response body schema for POST v1/rewards.

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