curl --request GET \
--url https://{cluster}.voucherify.io/v1/loyalties/{campaignId}/members \
--header 'Authorization: Bearer <token>' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>'{
"object": "list",
"data_ref": "vouchers",
"vouchers": [
{
"id": "v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655",
"code": "0PmQ7JQI",
"campaign": "Loyalty Campaign",
"campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic",
"category": null,
"category_id": null,
"categories": [],
"type": "LOYALTY_CARD",
"discount": null,
"gift": null,
"loyalty_card": {
"points": 0,
"balance": 0
},
"start_date": null,
"expiration_date": null,
"validity_timeframe": null,
"validity_day_of_week": null,
"active": true,
"additional_info": null,
"metadata": {},
"assets": {
"qr": {
"id": "U2FsdGVkX19RtPewWeUYb2hiCR6xEhVE3SLdMfCXj3BA/s6uqSwFl2oAKAt9K5dolsdcZcj5Jgaa/YCnKkm63TRuX6OgGJoEggbKMg+wLfCMwBSi4J2v8KXuyqM25wP4r9WAL58Z+z3B1jkALIbjtw==",
"url": "{{internalVoucherifyURL}}"
},
"barcode": {
"id": "U2FsdGVkX1+hrRfaPMHRRX5aGVz2RpurRBjC2brcHcptPs4Od93qZM51vUXZe4DDzfRbnVrP+BfBtF+pyyQpxCeqbQuB/OuSnP/nzec6n0n/gTb9+XcIYLvvxcbnDbYoVdRFQEbcCxKKo4QzDlqIjQ==",
"url": "{{internalVoucherifyURL}}"
}
},
"is_referral_code": false,
"created_at": "2022-04-15T05:48:45.509Z",
"updated_at": "2022-07-01T00:01:57.860Z",
"holder_id": "cust_nk0N1uNQ1YnupAoJGOgvsODC",
"redemption": {
"quantity": null,
"redeemed_quantity": 0,
"redeemed_points": 0,
"object": "list",
"url": "/v1/vouchers/0PmQ7JQI/redemptions?page=1&limit=10"
},
"publish": {
"object": "list",
"count": 1,
"url": "/v1/vouchers/0PmQ7JQI/publications?page=1&limit=10"
},
"object": "voucher"
},
{
"id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF",
"code": "MmFAzfDe",
"campaign": "Loyalty Campaign",
"campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic",
"category": null,
"category_id": "cat_0b6152ce12414820de",
"categories": [],
"type": "LOYALTY_CARD",
"discount": null,
"gift": null,
"loyalty_card": {
"points": 13435,
"balance": 13135,
"next_expiration_date": "2022-11-30",
"next_expiration_points": 12
},
"start_date": null,
"expiration_date": null,
"validity_timeframe": null,
"validity_day_of_week": null,
"active": true,
"additional_info": null,
"metadata": {},
"assets": {
"qr": {
"id": "U2FsdGVkX184kVdWUO/msrLg1G0MRf/Cs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk/dXm/QEJ/sulXKDlUMWf+MN7TRG5LB+wuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ==",
"url": "{{internalVoucherifyURL}}"
},
"barcode": {
"id": "U2FsdGVkX1/RGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW/cXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ==",
"url": "{{internalVoucherifyURL}}"
}
},
"is_referral_code": false,
"created_at": "2022-02-18T14:03:59.954Z",
"updated_at": "2022-11-21T13:49:54.949Z",
"holder_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi",
"redemption": {
"quantity": null,
"redeemed_quantity": 1,
"redeemed_points": 300,
"object": "list",
"url": "/v1/vouchers/MmFAzfDe/redemptions?page=1&limit=10"
},
"publish": {
"object": "list",
"count": 1,
"url": "/v1/vouchers/MmFAzfDe/publications?page=1&limit=10"
},
"object": "voucher"
}
],
"total": 2
}Returns a list of your loyalty cards. The loyalty cards are sorted by creation date, with the most recent loyalty cards appearing first.
curl --request GET \
--url https://{cluster}.voucherify.io/v1/loyalties/{campaignId}/members \
--header 'Authorization: Bearer <token>' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>'{
"object": "list",
"data_ref": "vouchers",
"vouchers": [
{
"id": "v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655",
"code": "0PmQ7JQI",
"campaign": "Loyalty Campaign",
"campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic",
"category": null,
"category_id": null,
"categories": [],
"type": "LOYALTY_CARD",
"discount": null,
"gift": null,
"loyalty_card": {
"points": 0,
"balance": 0
},
"start_date": null,
"expiration_date": null,
"validity_timeframe": null,
"validity_day_of_week": null,
"active": true,
"additional_info": null,
"metadata": {},
"assets": {
"qr": {
"id": "U2FsdGVkX19RtPewWeUYb2hiCR6xEhVE3SLdMfCXj3BA/s6uqSwFl2oAKAt9K5dolsdcZcj5Jgaa/YCnKkm63TRuX6OgGJoEggbKMg+wLfCMwBSi4J2v8KXuyqM25wP4r9WAL58Z+z3B1jkALIbjtw==",
"url": "{{internalVoucherifyURL}}"
},
"barcode": {
"id": "U2FsdGVkX1+hrRfaPMHRRX5aGVz2RpurRBjC2brcHcptPs4Od93qZM51vUXZe4DDzfRbnVrP+BfBtF+pyyQpxCeqbQuB/OuSnP/nzec6n0n/gTb9+XcIYLvvxcbnDbYoVdRFQEbcCxKKo4QzDlqIjQ==",
"url": "{{internalVoucherifyURL}}"
}
},
"is_referral_code": false,
"created_at": "2022-04-15T05:48:45.509Z",
"updated_at": "2022-07-01T00:01:57.860Z",
"holder_id": "cust_nk0N1uNQ1YnupAoJGOgvsODC",
"redemption": {
"quantity": null,
"redeemed_quantity": 0,
"redeemed_points": 0,
"object": "list",
"url": "/v1/vouchers/0PmQ7JQI/redemptions?page=1&limit=10"
},
"publish": {
"object": "list",
"count": 1,
"url": "/v1/vouchers/0PmQ7JQI/publications?page=1&limit=10"
},
"object": "voucher"
},
{
"id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF",
"code": "MmFAzfDe",
"campaign": "Loyalty Campaign",
"campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic",
"category": null,
"category_id": "cat_0b6152ce12414820de",
"categories": [],
"type": "LOYALTY_CARD",
"discount": null,
"gift": null,
"loyalty_card": {
"points": 13435,
"balance": 13135,
"next_expiration_date": "2022-11-30",
"next_expiration_points": 12
},
"start_date": null,
"expiration_date": null,
"validity_timeframe": null,
"validity_day_of_week": null,
"active": true,
"additional_info": null,
"metadata": {},
"assets": {
"qr": {
"id": "U2FsdGVkX184kVdWUO/msrLg1G0MRf/Cs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk/dXm/QEJ/sulXKDlUMWf+MN7TRG5LB+wuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ==",
"url": "{{internalVoucherifyURL}}"
},
"barcode": {
"id": "U2FsdGVkX1/RGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW/cXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ==",
"url": "{{internalVoucherifyURL}}"
}
},
"is_referral_code": false,
"created_at": "2022-02-18T14:03:59.954Z",
"updated_at": "2022-11-21T13:49:54.949Z",
"holder_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi",
"redemption": {
"quantity": null,
"redeemed_quantity": 1,
"redeemed_points": 300,
"object": "list",
"url": "/v1/vouchers/MmFAzfDe/redemptions?page=1&limit=10"
},
"publish": {
"object": "list",
"count": 1,
"url": "/v1/vouchers/MmFAzfDe/publications?page=1&limit=10"
},
"object": "voucher"
}
],
"total": 2
}The access token received from the authorization server in the OAuth 2.0 flow.
Unique campaign ID of the loyalty program.
"camp_rRsfatlwN7unSeUIJDCYedal"
Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.
1 <= x <= 100Which page of results to return. The lowest value is 1.
1 <= x <= 100A tracking identifier of a customer who is the holder of the vouchers. It can be an id generated by Voucherify or the source_id. Remember to use the proper URL escape codes if the source_id contains special characters.
"cust_nk0N1uNQ1YnupAoJGOgvsODC"
A filter on the list based on the object created_at field. The value is a dictionary with the following options: before, after. A date value must be presented in ISO 8601 format (2016-11-16T14:14:31Z or 2016-11-16). An example: [created_at][before]=2017-09-08T13:52:18.227Z
Show child attributes
Timestamp representing the date and time before the voucher was created. The value is shown in the ISO 8601 format.
"2021-12-22T10:13:06.487Z"
Timestamp representing the date and time after the voucher was created. The value is shown in the ISO 8601 format.
"2021-12-22T10:13:06.487Z"
A filter on the list based on the object updated_at field. The value is a dictionary with the following options: before, after. A date value must be presented in ISO 8601 format (2016-11-16T14:14:31Z or 2016-11-16). An example: [updated_at][before]=2017-09-08T13:52:18.227Z
Show child attributes
Timestamp representing the date and time before the voucher was updated. The value is shown in the ISO 8601 format.
"2021-12-22T10:13:06.487Z"
Timestamp representing the date and time after the voucher was updated. The value is shown in the ISO 8601 format.
"2021-12-22T10:13:06.487Z"
Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.
created_at, -created_at, updated_at, -updated_at, code, -code "2CpRCE2c"
Returns a list of loyalty cards within a campaign.
Response body schema for GET v1/loyalties/{campaignId}/members.
The type of the object represented by JSON. This object stores information about members in a dictionary.
Identifies the name of the attribute that contains the array of voucher objects.
vouchers Contains array of voucher objects representing loyalty cards, in other words, loyalty program members.
Show child attributes
Assigned by the Voucherify API, identifies the voucher.
"v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV"
A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters.
"WVPblOYX"
A unique campaign name, identifies the voucher's parent campaign.
"Loyalty campaign"
Assigned by the Voucherify API, identifies the voucher's parent campaign.
"camp_FNYR4jhqZBM9xTptxDGgeNBV"
Tag defining the category that this voucher belongs to.
Unique category ID assigned by Voucherify.
"cat_0bb343dee3cdb5ec0c"
Defines the type of the voucher.
LOYALTY_CARD Object representing loyalty card parameters. Child attributes are present only if type is LOYALTY_CARD. Defaults to null.
Show child attributes
Total number of points added to the loyalty card over its lifespan.
7000
Points available for reward redemption. This is calculated as follows: balance = points - expired_points - subtracted_points - redemption.redeemed_points.
6970
The next closest date when the next set of points are due to expire.
"2023-05-30"
The amount of points that are set to expire next.
Shows the number of pending points that will be added to the loyalty card when they are activated automatically or manually.
Shows the total number of expired points over the lifetime of the loyalty card.
Shows the total number of subtracted points over the lifetime of the loyalty card.
Activation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is inactive before this date.
"2021-12-01T00:00:00.000Z"
Expiration timestamp defines when the code expires in ISO 8601 format. Voucher is inactive after this date.
"2021-12-31T00:00:00.000Z"
Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.
Show child attributes
Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a duration of PT1H will be valid for a duration of one hour.
"PT1H"
Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an interval of P2D will be valid every other day.
"P2D"
Integer array corresponding to the particular days of the week in which the voucher is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Determines the hours of validity, e.g. to create a happy hours scenario.
Show child attributes
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Show child attributes
Defines the starting hour of validity in the HH:mm format. The resource is inactive before this time.
"12:00"
Integer array corresponding to the particular days of the week in which the resource is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Defines the ending hour of validity in the HH:mm format. The resource is inactive after this time.
"14:00"
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 voucherfalse indicates an inactive voucherAn optional field to keep any extra textual information about the code such as a code description and details.
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.
Stores links to images of QR and barcode that correspond to an encrypted voucher code.
Show child attributes
Stores Quick Response (QR) representation of encrypted code.
Show child attributes
Encrypted voucher code ID.
"U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK+t4pp7U7oFzjGJzj9q/bmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg+BaZk5QwXMf8k/OzSlOEVybpwSq+AiqPoNtjeuqtIgkDyvT6Q=="
URL to QR code
Optional: Attach query parameters to base URL to customize the image of the encrypted voucher code.
size: integer value from 1 to 100format: string, either png (default) or svg"https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK%2Bt4pp7U7oFzjGJzj9q%2FbmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg%2BBaZk5QwXMf8k%2FOzSlOEVybpwSq%2BAiqPoNtjeuqtIgkDyvT6Q%3D%3D"
Stores barcode representation of encrypted code.
Show child attributes
Encrypted voucher code ID.
"U2FsdGVkX19eJhGfWwUrH9+tulBkON+AnMktic+N6CVWzZ9+fHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ+kJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6/pFs61apEn9SJx32ttCF6d3oxKISQQ=="
URL to barcode
Optional: Attach query parameters to base URL to customize the image of the encrypted voucher code.
size: integer value from 1 to 100format: string, either png (default) or svg"https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D"
This is always false for loyalty members.
Timestamp representing the date and time when the voucher was created. The value is shown in the ISO 8601 format.
"2021-12-22T10:13:06.487Z"
Timestamp representing the date and time when the voucher was last updated in ISO 8601 format.
"2021-12-22T10:14:45.316Z"
Unique identifier of the customer who owns the voucher.
"cust_eWgXlBBiY6THFRJwX45Iakv4"
The type of the object represented by JSON. Default is voucher.
This object stores a summary of publish events: an events counter and an endpoint which can be called to return details of each event. A publication is required for loyalty cards and referral codes. This object gets updated whenever a voucher has been published. Publication means assigning a code to a particular customer. Typically, a publication is made by distributing your codes to your customers, e.g. through Export to MailChimp or
| Required | Optional |
|---|---|
type:LOYALTY_CARD | type:DISCOUNT_VOUCHER |
is_referral_code:true | type:GIFT_VOUCHER |
Show child attributes
The type of the object represented is by default list. To get this list, you need to make a call to the endpoint returned in the url attribute.
Publication event counter.
0
The endpoint where this list of publications can be accessed using a GET method. /v1/vouchers/{voucher_code}/publications
"/v1/vouchers/WVPblOYX/publications?page=1&limit=10"
Stores a summary of redemptions that have been applied to the voucher.
Show child attributes
How many times a voucher can be redeemed. A null value means unlimited.
How many times a voucher has already been redeemed.
1
Total loyalty points redeemed.
100000
The type of the object represented is by default list. To get this list, you need to make a call to the endpoint returned in the url attribute.
The endpoint where this list of redemptions can be accessed using a GET method. /v1/vouchers/{voucher_code}/redemptions
"/v1/vouchers/WVPblOYX/redemptions?page=1&limit=10"
Total number of voucher objects.
Was this page helpful?