curl --request POST \
--url https://api.voucherify.io/v2/loyalties/rewards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"name": "<string>",
"material": {
"product": {
"id": "<string>"
},
"sku": {
"product_id": "<string>",
"id": "<string>"
}
},
"digital": {
"discount_coupons": {
"campaign_id": "<string>"
},
"gift_vouchers": {
"campaign_id": "<string>",
"balance": 1
}
},
"metadata": {}
}
'{
"id": "<string>",
"name": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"object": "<string>",
"material": {
"product": {
"id": "<string>"
},
"sku": {
"product_id": "<string>",
"id": "<string>"
}
},
"digital": {
"discount_coupons": {
"campaign_id": "<string>"
},
"gift_vouchers": {
"campaign_id": "<string>",
"balance": 1
}
}
}Create a reward
⚠️ BETA endpoint
This is a work-in-progress documentation of a BETA endpoint. The parameters, fields, request and response bodies, and other data may subject to change. If you want to share feedback or improvements, contact Voucherify support or your Technical Account Manager.
Creates a new reward. name and type are required.
Depending on type, either material or digital must be provided (not both).
Referenced campaigns (for digital rewards) or products/SKUs (for material rewards)
must exist.
curl --request POST \
--url https://api.voucherify.io/v2/loyalties/rewards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"name": "<string>",
"material": {
"product": {
"id": "<string>"
},
"sku": {
"product_id": "<string>",
"id": "<string>"
}
},
"digital": {
"discount_coupons": {
"campaign_id": "<string>"
},
"gift_vouchers": {
"campaign_id": "<string>",
"balance": 1
}
},
"metadata": {}
}
'{
"id": "<string>",
"name": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"object": "<string>",
"material": {
"product": {
"id": "<string>"
},
"sku": {
"product_id": "<string>",
"id": "<string>"
}
},
"digital": {
"discount_coupons": {
"campaign_id": "<string>"
},
"gift_vouchers": {
"campaign_id": "<string>",
"balance": 1
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Payload for creating a reward.
Reward display name.
1 - 200Reward type. Determines which sub-configuration is required.
MATERIAL, DIGITAL Initial status. Defaults to DRAFT when omitted.
DRAFT, ACTIVE Required when type is MATERIAL. Must be null/absent when type is DIGITAL.
Show child attributes
Show child attributes
Required when type is DIGITAL. Must be null/absent when type is MATERIAL.
Show child attributes
Show child attributes
Optional key-value metadata.
Response
Created reward.
Reward resource representation.
Unique reward identifier.
Reward display name.
Reward type.
MATERIAL, DIGITAL Current lifecycle status.
ACTIVE, DRAFT, INACTIVE, DELETED Key-value metadata.
ISO 8601 creation timestamp.
ISO 8601 last-update timestamp. Null if never updated.
"reward"Material configuration. Present only when type is MATERIAL.
Show child attributes
Show child attributes
Digital configuration. Present only when type is DIGITAL.
Show child attributes
Show child attributes
Was this page helpful?

