A valid request URL is required to generate request examples{
"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>"
}Move a reward back to draft
⚠️ 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.
Moves the reward back to the DRAFT status. Allowed only from ACTIVE status; other transitions are rejected with a conflict error. This endpoint takes no request body.
curl --request POST \
--url {protocol}://{host}/v2/loyalties/rewards/{rewardId}/draft \
--header 'Authorization: Bearer <token>' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>'{
"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]+$Response
The drafted 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?

