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>"
}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, type and costs are required. When type is
MATERIAL the material object is required and digital must be null; when
type is DIGITAL the digital object is required and material must be null.
The reward can be created directly in DRAFT (default) or ACTIVE status.
When validity_hours is not provided it defaults to { "type": "ANY_TIME" }.
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>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request body for creating a reward.
When type is MATERIAL, material is required and
digital must be null; when type is DIGITAL, digital is required and
material must be null.
Display name of the reward.
1 - 200Reward type. MATERIAL rewards deliver a product or SKU; DIGITAL rewards deliver discount coupons, gift vouchers or loyalty card points.
MATERIAL, DIGITAL Point costs of the reward. Each cost defines the points to spend on a specific card definition, optionally guarded by rules.
1 - 10 elementsShow child attributes
Show child attributes
Initial status of the reward. Defaults to DRAFT behavior when omitted.
DRAFT, ACTIVE Hours during which the reward can be purchased. Defaults to { "type": "ANY_TIME" } when omitted or null.
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 MATERIAL; must be null when type is DIGITAL.
Show child attributes
Show child attributes
Digital reward definition. Required when type is DIGITAL; must be null when type is MATERIAL.
Show child attributes
Show child attributes
Refund policy for the reward. Defaults to { "type": "NONE" } when omitted.
Show child attributes
Show child attributes
Arbitrary key-value metadata attached to the reward, as a free-form object.
Response
The created 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?

