Benefits
<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 benefit. Exactly one type-specific configuration object (points, points_proportional, material, or digital) is required, matching the type. When status is omitted the benefit is created in DRAFT status. When stock is omitted it defaults to { "type": "UNLIMITED" }.

Referenced resources are validated: the card definition (for points-based types) must exist and - when creating with status: ACTIVE - must be ACTIVE (423 resource_locked otherwise); the product/SKU (for MATERIAL) and campaign (for DIGITAL) must exist, and the campaign type must match the digital benefit type (DISCOUNT_COUPONS or GIFT_VOUCHERS). The benefit name must be unique per project (409 duplicate_found).

post/v2/loyalties/benefits

Request

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

Request body

namestring required

Benefit name. Must be unique within the project.

type'POINTS' | 'POINTS_PROPORTIONAL' | 'MATERIAL' | 'DIGITAL' required

Benefit type. Determines which configuration object is required.

status'DRAFT' | 'ACTIVE'

Initial status of the benefit. Defaults to DRAFT when omitted.

Response

The created benefit

idstring required

Unique benefit ID, prefixed with lben_.

namestring required

Benefit name, unique within the project.

type'POINTS' | 'POINTS_PROPORTIONAL' | 'MATERIAL' | 'DIGITAL' required

Benefit type.

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

Current benefit status. DELETED appears only in the response of the delete endpoint and in activity snapshots.

created_atstring date-time required

Timestamp of when the benefit was created, in ISO 8601 format.

updated_atstring date-time nullable required

Timestamp of the last update, in ISO 8601 format. null when the benefit was never updated.

object'benefit' required

Type of the object. Always benefit.

Changes

    • breaking

      added to the request body allOf list

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • warning

      removed subschema #1 subschema #2 subschema #3 subschema #4 subschema #5 from the request body allOf list

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • info

      added to the response body allOf list for the response status

    • breaking

      added subschema #1 subschema #2 subschema #3 subschema #4 subschema #5 to the request body allOf list

    • warning

      removed from the request body allOf list

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      removed from the response body allOf list for the response status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status