curl --request POST \
--url https://{cluster}.voucherify.io/v2/loyalties/rewards/{rewardId}/draft \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>'{
"id": "<string>",
"name": "<string>",
"type": "MATERIAL",
"status": "ACTIVE",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"validity_hours": {
"type": "DAILY",
"daily": [
{
"days_of_week": [
3
],
"start_time": "09:00",
"end_time": "17:00"
}
]
},
"refunds": {
"type": "NONE"
},
"costs": [
{
"id": "<string>",
"tier_rules": {
"type": "NO_REQUIREMENTS",
"any_of": [
{
"tier_structure_id": "<string>",
"tier_ids": [
"<string>"
]
}
]
},
"name": "<string>",
"rules": {
"logic": "<string>"
},
"spending": [
{
"id": "<string>",
"points": 123,
"card_definition_id": "<string>",
"name": "<string>"
}
]
}
],
"purchase_limits": {
"cooldown": {
"type": "NO_COOLDOWN",
"fixed_cooldown": {
"period": {
"value": 2,
"unit": "HOUR"
}
}
},
"frequency": {
"type": "NO_LIMIT",
"limits": [
{
"type": "TIME_BASED",
"period": {
"type": "CURRENT_PERIOD",
"current_period": {
"unit": "DAY"
}
},
"triggers": {
"max": 2
}
}
]
}
},
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"object": "reward",
"material": {
"type": "PRODUCT",
"product": {
"id": "<string>"
},
"sku": {
"product_id": "<string>",
"id": "<string>"
}
},
"digital": {
"type": "DISCOUNT_COUPONS",
"discount_coupons": {
"campaign_id": "<string>"
},
"gift_vouchers": {
"campaign_id": "<string>",
"balance": 123
},
"loyalty_card_points": {
"points": 123,
"card_definition_id": "<string>"
}
}
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 500,
"key": "api_error",
"message": "Something went wrong. Don't worry, your campaigns are still safe and the Voucherify Team has been notified. Check out our Help Center and forums for help, or head back to home."
}Move reward back to draft
This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact Voucherify support or your Technical Account Manager.
Moves the reward back to the DRAFT status. Allowed only from ACTIVE status;
other transitions return 400 invalid_state_transition. A reward assigned to a program that is not in DRAFT cannot be drafted (423 resource_locked, key connected_non_draft_program). This endpoint takes no
request body.
curl --request POST \
--url https://{cluster}.voucherify.io/v2/loyalties/rewards/{rewardId}/draft \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>'{
"id": "<string>",
"name": "<string>",
"type": "MATERIAL",
"status": "ACTIVE",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"validity_hours": {
"type": "DAILY",
"daily": [
{
"days_of_week": [
3
],
"start_time": "09:00",
"end_time": "17:00"
}
]
},
"refunds": {
"type": "NONE"
},
"costs": [
{
"id": "<string>",
"tier_rules": {
"type": "NO_REQUIREMENTS",
"any_of": [
{
"tier_structure_id": "<string>",
"tier_ids": [
"<string>"
]
}
]
},
"name": "<string>",
"rules": {
"logic": "<string>"
},
"spending": [
{
"id": "<string>",
"points": 123,
"card_definition_id": "<string>",
"name": "<string>"
}
]
}
],
"purchase_limits": {
"cooldown": {
"type": "NO_COOLDOWN",
"fixed_cooldown": {
"period": {
"value": 2,
"unit": "HOUR"
}
}
},
"frequency": {
"type": "NO_LIMIT",
"limits": [
{
"type": "TIME_BASED",
"period": {
"type": "CURRENT_PERIOD",
"current_period": {
"unit": "DAY"
}
},
"triggers": {
"max": 2
}
}
]
}
},
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"object": "reward",
"material": {
"type": "PRODUCT",
"product": {
"id": "<string>"
},
"sku": {
"product_id": "<string>",
"id": "<string>"
}
},
"digital": {
"type": "DISCOUNT_COUPONS",
"discount_coupons": {
"campaign_id": "<string>"
},
"gift_vouchers": {
"campaign_id": "<string>",
"balance": 123
},
"loyalty_card_points": {
"points": 123,
"card_definition_id": "<string>"
}
}
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 123,
"key": "<string>",
"message": "<string>",
"details": "<string>",
"request_id": "<string>",
"resource_id": "<string>",
"resource_type": "<string>"
}{
"code": 500,
"key": "api_error",
"message": "Something went wrong. Don't worry, your campaigns are still safe and the Voucherify Team has been notified. Check out our Help Center and forums for help, or head back to home."
}Authorizations
Path Parameters
Identifies the reward. Format lrew_[a-f0-9]+.
^lrew_[a-f0-9]+$Response
The drafted reward.
Response body schema for POST /v2/loyalties/rewards/{rewardId}/draft.
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 Date from which the reward is available, or null when not set.
Date until which the reward is available, or null when not set.
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
Purchase limits. Always present; defaults to { "cooldown": { "type": "NO_COOLDOWN" }, "frequency": { "type": "NO_LIMIT", "limits": [] } }.
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).
Timestamp when the reward was last updated (ISO-8601), or null when never updated.
Object type marker; always reward.
"reward"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

