curl --request PUT \
--url {protocol}://{host}/v2/loyalties/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": "<string>",
"validity_hours": {
"daily": [
{
"days_of_week": [
3
],
"start_time": "09:00",
"end_time": "17:00"
}
]
},
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"material": {
"product": {
"id": "<string>"
},
"sku": {
"product_id": "<string>",
"id": "<string>"
}
},
"digital": {
"discount_coupons": {
"campaign_id": "<string>"
},
"gift_vouchers": {
"campaign_id": "<string>",
"balance": 1
},
"loyalty_card_points": {
"points": 4503599627370496,
"card_definition_id": "<string>"
}
},
"refunds": {},
"costs": [
{
"spending": [
{
"points": 4503599627370496,
"card_definition_id": "<string>"
}
],
"id": "<string>"
}
],
"metadata": {}
}
'{
"id": "<string>",
"name": "<string>",
"validity_hours": {
"daily": [
{
"days_of_week": [
3
],
"start_time": "09:00",
"end_time": "17:00"
}
]
},
"refunds": {},
"costs": [
{
"id": "<string>",
"rules": {
"logic": "<string>"
},
"spending": [
{
"points": 123,
"card_definition_id": "<string>"
}
]
}
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"object": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"material": {
"product": {
"id": "<string>"
},
"sku": {
"product_id": "<string>",
"id": "<string>"
}
},
"digital": {
"discount_coupons": {
"campaign_id": "<string>"
},
"gift_vouchers": {
"campaign_id": "<string>",
"balance": 123
},
"loyalty_card_points": {
"points": 123,
"card_definition_id": "<string>"
}
},
"updated_at": "2023-11-07T05:31:56Z"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}Update 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.
Updates an existing reward. When type is provided as MATERIAL the material
object is required and digital must be null; when type is provided as DIGITAL
the digital object is required and material must be null.
In DRAFT status all properties can be updated. In ACTIVE/INACTIVE status only
the following properties can be updated: name, metadata, refunds,
validity_hours, start_date, end_date, costs.
curl --request PUT \
--url {protocol}://{host}/v2/loyalties/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": "<string>",
"validity_hours": {
"daily": [
{
"days_of_week": [
3
],
"start_time": "09:00",
"end_time": "17:00"
}
]
},
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"material": {
"product": {
"id": "<string>"
},
"sku": {
"product_id": "<string>",
"id": "<string>"
}
},
"digital": {
"discount_coupons": {
"campaign_id": "<string>"
},
"gift_vouchers": {
"campaign_id": "<string>",
"balance": 1
},
"loyalty_card_points": {
"points": 4503599627370496,
"card_definition_id": "<string>"
}
},
"refunds": {},
"costs": [
{
"spending": [
{
"points": 4503599627370496,
"card_definition_id": "<string>"
}
],
"id": "<string>"
}
],
"metadata": {}
}
'{
"id": "<string>",
"name": "<string>",
"validity_hours": {
"daily": [
{
"days_of_week": [
3
],
"start_time": "09:00",
"end_time": "17:00"
}
]
},
"refunds": {},
"costs": [
{
"id": "<string>",
"rules": {
"logic": "<string>"
},
"spending": [
{
"points": 123,
"card_definition_id": "<string>"
}
]
}
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"object": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"material": {
"product": {
"id": "<string>"
},
"sku": {
"product_id": "<string>",
"id": "<string>"
}
},
"digital": {
"discount_coupons": {
"campaign_id": "<string>"
},
"gift_vouchers": {
"campaign_id": "<string>",
"balance": 123
},
"loyalty_card_points": {
"points": 123,
"card_definition_id": "<string>"
}
},
"updated_at": "2023-11-07T05:31:56Z"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique reward identifier, prefixed with lrew_.
^lrew_[a-f0-9]+$Body
Request body for updating a reward.
All properties are optional. When type is provided as
MATERIAL, material is required and digital must be null; when type is
provided as DIGITAL, digital is required and material must be null.
In ACTIVE/INACTIVE status only name, metadata, refunds, validity_hours,
start_date, end_date and costs can be updated.
Display name of the reward.
1 - 200Reward type. Can only be changed while the reward is in DRAFT status.
MATERIAL, DIGITAL Hours during which the reward can be purchased.
Show child attributes
Show child attributes
Date from which the reward is available. Must be an ISO-8601 compliant date.
Date until which the reward is available. Must be an ISO-8601 compliant date.
Material reward definition. Required when type is provided as MATERIAL.
Show child attributes
Show child attributes
Digital reward definition. Required when type is provided as DIGITAL.
Show child attributes
Show child attributes
Refund policy for the reward.
Show child attributes
Show child attributes
Point costs of the reward. Include the id of an existing cost to update it; omit id to create a new cost.
1 - 10 elementsShow child attributes
Show child attributes
Arbitrary key-value metadata attached to the reward, as a free-form object.
Response
The updated reward.
A reward, as returned by the API.
Unique reward identifier, prefixed with lrew_.
^lrew_[a-f0-9]+$Display name of the reward.
Reward type.
MATERIAL, DIGITAL Current lifecycle status of the reward.
ACTIVE, DRAFT, INACTIVE, DELETED Hours during which the reward can be purchased. Always present; defaults to { "type": "ANY_TIME" }.
Show child attributes
Show child attributes
Refund policy. Always present; defaults to { "type": "NONE" }.
Show child attributes
Show child attributes
Point costs of the reward. Empty array when no costs are defined.
Show child attributes
Show child attributes
Arbitrary key-value metadata attached to the reward. Empty object when not set.
Timestamp when the reward was created (ISO-8601).
Object type marker; always reward.
"reward"Date from which the reward is available, or null when not set.
Date until which the reward is available, or null when not set.
Material reward definition. Present only when type is MATERIAL; omitted otherwise.
Show child attributes
Show child attributes
Digital reward definition. Present only when type is DIGITAL; omitted otherwise.
Show child attributes
Show child attributes
Timestamp when the reward was last updated (ISO-8601), or null when never updated.
Was this page helpful?

