Programs

Create program

<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 loyalty program. The program can be created with status DRAFT (default) or ACTIVE. When created as ACTIVE, the program must be connected to at least one active card definition and at least one active earning rule (provided via card_definitions and earning_rules arrays), otherwise the request is rejected with 423 Locked (keys missing_active_card_definition / missing_active_earning_rule). Optionally assigns card definitions, earning rules, rewards and tier structures in the same request.

post/v2/loyalties/programs

Request body

namestring required

Program name.

start_datestring date-time nullable

Program validity start date, in ISO 8601 date-time format.

end_datestring date-time nullable

Program validity end date, in ISO 8601 date-time format.

status'ACTIVE' | 'DRAFT' nullable

Initial program status. Only ACTIVE and DRAFT are allowed at creation. Defaults to DRAFT.

metadataobject nullable

Arbitrary key-value metadata. Validated against the vl_program metadata schema definition of the project. Defaults to {}.

Example request

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

Response

Program created. Response includes the ids of resources assigned during creation.

idstring

Unique program identifier.

namestring

Program name.

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

Program status.

start_datestring date-time nullable

Program validity start date (ISO 8601), or null when not set.

end_datestring date-time nullable

Program validity end date (ISO 8601), or null when not set.

metadataobject

Arbitrary key-value metadata. Defaults to {}.

created_atstring date-time

Creation timestamp (ISO 8601).

updated_atstring date-time nullable

Last update timestamp (ISO 8601), or null when never updated.

object'program'

Object type marker.

Changes

Changed in 2 of the 62 revisions of this API.15518

    • added the optional property to the response with the status

      response-optional-property-added

    • added the optional property to the response with the status

      response-optional-property-added

    • added the optional property to the response with the status

      response-optional-property-added

    • added the optional property to the response with the status

      response-optional-property-added

    • added the optional property to the response with the status

      response-optional-property-added

    • added the optional property to the response with the status

      response-optional-property-added

    • added the optional property to the response with the status

      response-optional-property-added

    • added the optional property to the response with the status

      response-optional-property-added

    • added the optional property to the response with the status

      response-optional-property-added

    • added the optional property to the response with the status

      response-optional-property-added

  • v2341403eb19e51558See the full diff
    • added the new required request property ////

      new-required-request-property

    • added subschema #1 subschema #2 to the /// request property allOf list

      request-property-all-of-added

    • removed from the request property oneOf list

      request-property-one-of-removed

    • the /// request property type changed from integer to object

      request-property-type-changed

    • the response's body type changed from object to no type for status

      response-body-type-changed

    • the response property became optional for the status

      response-property-became-optional

    • the response property became optional for the status

      response-property-became-optional

    • the response property became optional for the status

      response-property-became-optional

    • the response property became optional for the status

      response-property-became-optional

    • the response property became optional for the status

      response-property-became-optional

    • the response property became optional for the status

      response-property-became-optional

    • response property allOf[subschema #2]/card_definitions list-of-types was widened by adding types null to media type application/json of response 200

      response-property-list-of-types-widened

    • response property allOf[subschema #2]/earning_rules list-of-types was widened by adding types null to media type application/json of response 200

      response-property-list-of-types-widened

    • response property allOf[subschema #2]/rewards list-of-types was widened by adding types null to media type application/json of response 200

      response-property-list-of-types-widened

    • response property allOf[subschema #2]/tier_structures list-of-types was widened by adding types null to media type application/json of response 200

      response-property-list-of-types-widened

    • removed the request property ///

      request-property-removed

    • removed the optional property from the response with the status

      response-optional-property-removed

    • removed the optional property from the response with the status

      response-optional-property-removed

    • removed the optional property from the response with the status

      response-optional-property-removed

    • removed the optional property from the response with the status

      response-optional-property-removed

    • added the new optional request property ////

      new-optional-request-property

    • added the new optional request property

      new-optional-request-property

    • added subschema #1 to the request property oneOf list

      request-property-one-of-added

    • added to the response body allOf list for the response status

      response-body-all-of-added

    • removed from the response body allOf list for the response status

      response-body-all-of-removed

    • added the non-success response with the status

      response-non-success-status-added

    • added the non-success response with the status

      response-non-success-status-added

    • added the non-success response with the status

      response-non-success-status-added

    This revision also has 292 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog