curl --request POST \
--url https://api.voucherify.io/v2/loyalties/programs/{programId}/members/{memberId}/rewards/purchases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"reward_id": "<string>"
}
'{
"message": "<string>",
"transaction": {
"id": "<string>",
"card_id": "<string>",
"program_id": "<string>",
"member_id": "<string>",
"card_definition_id": "<string>",
"card_type": "<string>",
"details": {
"reason": "<string>",
"metadata": {},
"rejection": {
"reason": "<string>",
"details": "<string>"
},
"points": {
"total": 123,
"expiration_date": "2023-12-25",
"expiration_type": "<string>",
"date": "2023-12-25",
"type": "<string>"
},
"result": {},
"reward_id": "<string>",
"bucket": {}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Purchase 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.
Initiates a reward purchase for a member. Evaluates the reward cost, checks card balance, and creates a POINTS_SPENT_ON_REWARD transaction in PENDING status.
The operation is asynchronous - the transaction is processed after the response. Returns HTTP 202 Accepted.
Requirements:
- Program must be ACTIVE
- Member must be ACTIVE
- Reward must be assigned to the program with available stock
- Member’s card must have sufficient balance for the reward cost
curl --request POST \
--url https://api.voucherify.io/v2/loyalties/programs/{programId}/members/{memberId}/rewards/purchases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"reward_id": "<string>"
}
'{
"message": "<string>",
"transaction": {
"id": "<string>",
"card_id": "<string>",
"program_id": "<string>",
"member_id": "<string>",
"card_definition_id": "<string>",
"card_type": "<string>",
"details": {
"reason": "<string>",
"metadata": {},
"rejection": {
"reason": "<string>",
"details": "<string>"
},
"points": {
"total": 123,
"expiration_date": "2023-12-25",
"expiration_type": "<string>",
"date": "2023-12-25",
"type": "<string>"
},
"result": {},
"reward_id": "<string>",
"bucket": {}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique program identifier
Unique member identifier
Body
ID of the reward to purchase (must be assigned to the program)
Response
Reward purchase initiated (processed asynchronously)
Result of a reward purchase operation
Was this page helpful?

