v1

latestOpenAPI 3.0.1MIT2026-07-263151,3912.3 MB
Loyalties

Add Member

This method assigns a loyalty card to a customer. It selects a loyalty card suitable for publication, adds a publish entry, and returns the published voucher.

A voucher is suitable for publication when it's active and hasn't been published yet.

📘 Auto-update campaign

In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use auto-update campaign.

post/v1/loyalties/{campaignId}/members

Request body

voucherstring

Code of voucher being published.

source_idstring

The merchant's publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. If source_id is provided only 1 voucher can be published per request.

metadataobject

The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format.

channelstring

Specify the distribution channel.

Response

Returns the voucher object that was published to the customer provided in the request payload.

idstring

Assigned by the Voucherify API, identifies the voucher.

codestring

A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters.

campaignstring

A unique campaign name, identifies the voucher's parent campaign.

campaign_idstring

Assigned by the Voucherify API, identifies the voucher's parent campaign.

categorystring

Tag defining the category that this voucher belongs to.

category_idstring

Unique category ID assigned by Voucherify.

type'LOYALTY_CARD'

Defines the type of the voucher.

discountobject nullable
giftobject nullable
start_datestring date-time

Activation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is inactive before this date.

expiration_datestring date-time

Expiration timestamp defines when the code expires in ISO 8601 format. Voucher is inactive after this date.

validity_day_of_weekinteger[]

Integer array corresponding to the particular days of the week in which the voucher is valid.

  • 0 Sunday
  • 1 Monday
  • 2 Tuesday
  • 3 Wednesday
  • 4 Thursday
  • 5 Friday
  • 6 Saturday
activeboolean nullable

A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the start_date and expiration_date.

  • true indicates an active voucher
  • false indicates an inactive voucher
additional_infostring

An optional field to keep any extra textual information about the code such as a code description and details.

metadataobject

The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format.

is_referral_codeboolean nullable

This is always false for loyalty members.

created_atstring date-time

Timestamp representing the date and time when the voucher was created. The value is shown in the ISO 8601 format.

updated_atstring date-time

Timestamp representing the date and time when the voucher was last updated in ISO 8601 format.

holder_idstring

Unique identifier of the customer who owns the voucher.

objectstring

The type of the object represented by JSON. Default is voucher.

Example response

{
  "id": "v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV",
  "code": "WVPblOYX",
  "campaign": "Loyalty campaign",
  "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV",
  "category_id": "cat_0bb343dee3cdb5ec0c",
  "loyalty_card": {
    "points": 7000,
    "balance": 6970,
    "next_expiration_date": "2023-05-30"
  },
  "start_date": "2021-12-01T00:00:00.000Z",
  "expiration_date": "2021-12-31T00:00:00.000Z",
  "validity_timeframe": {
    "duration": "PT1H",
    "interval": "P2D"
  },
  "validity_hours": {
    "daily": [
      {
        "start_time": "12:00",
        "expiration_time": "14:00"
      }
    ]
  },
  "assets": {
    "qr": {
      "id": "U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK+t4pp7U7oFzjGJzj9q/bmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg+BaZk5QwXMf8k/OzSlOEVybpwSq+AiqPoNtjeuqtIgkDyvT6Q==",
      "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK%2Bt4pp7U7oFzjGJzj9q%2FbmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg%2BBaZk5QwXMf8k%2FOzSlOEVybpwSq%2BAiqPoNtjeuqtIgkDyvT6Q%3D%3D"
    },
    "barcode": {
      "id": "U2FsdGVkX19eJhGfWwUrH9+tulBkON+AnMktic+N6CVWzZ9+fHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ+kJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6/pFs61apEn9SJx32ttCF6d3oxKISQQ==",
      "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D"
    }
  },
  "created_at": "2021-12-22T10:13:06.487Z",
  "updated_at": "2021-12-22T10:14:45.316Z",
  "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4",
  "publish": {
    "url": "/v1/vouchers/WVPblOYX/publications?page=1&limit=10"
  },
  "redemption": {
    "redeemed_quantity": 1,
    "redeemed_points": 100000,
    "url": "/v1/vouchers/WVPblOYX/redemptions?page=1&limit=10"
  }
}