Rewards
<Info>

<Badge color="gray">Documentation in progress</Badge>

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.

</Info>

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" }.

post/v2/loyalties/rewards

Request

  • Base URL
    https://api.voucherify.io
  • URL
    https://api.voucherify.io/v2/loyalties/rewards
  • Auth
    • API key in header X-App-Id and API key in header X-App-Token
    • or HTTP bearer

Request body

namestring required

Display name of the reward.

type'MATERIAL' | 'DIGITAL' required

Reward type. MATERIAL rewards deliver a product or SKU; DIGITAL rewards deliver discount coupons, gift vouchers or loyalty card points.

status'DRAFT' | 'ACTIVE'

Initial status of the reward. Defaults to DRAFT behavior when omitted.

start_datestring date-time nullable

Date from which the reward is available. Must be an ISO-8601 compliant date.

end_datestring date-time nullable

Date until which the reward is available. Must be an ISO-8601 compliant date.

metadataobject nullable

Arbitrary key-value metadata attached to the reward, as a free-form object.

Example request

{
  "validity_hours": {
    "daily": [
      {
        "start_time": "09:00",
        "end_time": "17:00"
      }
    ]
  }
}

Response

The created reward.

idstring required

Unique reward identifier, prefixed with lrew_.

namestring required

Display name of the reward.

type'MATERIAL' | 'DIGITAL' required

Reward type.

status'ACTIVE' | 'DRAFT' | 'INACTIVE' | 'DELETED' required

Current lifecycle status of the reward.

start_datestring date-time nullable required

Date from which the reward is available, or null when not set.

end_datestring date-time nullable required

Date until which the reward is available, or null when not set.

metadataobject required

Arbitrary key-value metadata attached to the reward. Empty object when not set.

created_atstring date-time required

Timestamp when the reward was created (ISO-8601).

updated_atstring date-time nullable required

Timestamp when the reward was last updated (ISO-8601), or null when never updated.

object'reward' required

Object type marker; always reward.

Example response

{
  "validity_hours": {
    "daily": [
      {
        "start_time": "09:00",
        "end_time": "17:00"
      }
    ]
  }
}

Changes

    • breaking

      added to the ////////////////////// request property allOf list

    • breaking

      the ////////////////////// request property type changed from object to no type

    • warning

      removed the request property ///////////////////////

    • breaking

      added the new required request property ///////////////////////

    • breaking

      the ////////////////////// request property type changed from no type to object

    • warning

      removed from the ////////////////////// request property allOf list