Skip to main content

Loyalty Card Object

AttributesDescription
idstringAssigned by the Voucherify API, identifies the voucher.Example:v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV
codestringA code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters.Example:WVPblOYX
campaignstringA unique campaign name, identifies the voucher’s parent campaign.Example:Loyalty Card Campaign
campaign_idstringAssigned by the Voucherify API, identifies the voucher’s parent campaign.Example:camp_FNYR4jhqZBM9xTptxDGgeNBV
categorystringTag defining the category that this voucher belongs to.
category_idstringUnique category ID assigned by Voucherify.Example:cat_0bb343dee3cdb5ec0c
categoriesarrayContains details about the category.Array of Category
typestringDefines the type of the voucher.Available values: LOYALTY_CARD
discountobject, nullObject representing discount parameters. Child attributes are present only if type is DISCOUNT_VOUCHER. Defaults to null.
giftobject, nullObject representing gift parameters. Child attributes are present only if type is GIFT_VOUCHER. Defaults to null.
loyalty_cardobjectObject representing loyalty card parameters. Child attributes are present only if type is LOYALTY_CARD.Attributes Descriptionpointsinteger Total number of points added to the loyalty card over its lifespan. Example: 7000 balanceinteger Points available for reward redemption. This is calculated as follows: balance = points - expired_points - subtracted_points - redemption.redeemed_points. Example: 6970 next_expiration_datestring The next closest date when the next set of points are due to expire. Example: 2023-05-30 next_expiration_pointsinteger The amount of points that are set to expire next.
start_datestringActivation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is inactive before this date.Example:2021-12-01T00:00:00.000Z
expiration_datestringExpiration timestamp defines when the code expires in ISO 8601 format. Voucher is inactive after this date.Example:2021-12-31T00:00:00.000Z
validity_timeframeSee: Validity Timeframe
validity_day_of_weekSee: Validity Day Of Week
validity_hoursSee: Validity Hours
activebooleanA 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. | | assetsobject | Stores links to images of QR and barcode that correspond to an encrypted voucher code.Attributes Descriptionqrobject Stores Quick Response (QR) representation of encrypted code. Attributes Descriptionidstring Encrypted voucher code ID. Example: U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK+t4pp7U7oFzjGJzj9q/bmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg+BaZk5QwXMf8k/OzSlOEVybpwSq+AiqPoNtjeuqtIgkDyvT6Q== urlstring 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 100 format: string, either png (default) or svg Example: https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK%2Bt4pp7U7oFzjGJzj9q%2FbmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg%2BBaZk5QwXMf8k%2FOzSlOEVybpwSq%2BAiqPoNtjeuqtIgkDyvT6Q%3D%3D barcodeobject Stores barcode representation of encrypted code. Attributes Descriptionidstring Encrypted voucher code ID. Example: U2FsdGVkX19eJhGfWwUrH9+tulBkON+AnMktic+N6CVWzZ9+fHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ+kJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6/pFs61apEn9SJx32ttCF6d3oxKISQQ== urlstring 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 100 format: string, either png (default) or svg Example: https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D | | is_referral_codeboolean | Flag indicating whether this voucher is a referral code; true for campaign type REFERRAL_PROGRAM. | | created_atstring | Timestamp representing the date and time when the voucher was created. The value is shown in the ISO 8601 format.Example:2021-12-22T10:13:06.487Z | | updated_atstring | Timestamp representing the date and time when the voucher was last updated in ISO 8601 format.Example:2021-12-22T10:14:45.316Z | | holder_idstring | Unique customer identifier of the redeemable holder. It equals to the customer ID assigned by Voucherify.Example:cust_eWgXlBBiY6THFRJwX45Iakv4 | | redemptionobject | Stores a summary of redemptions that have been applied to the voucher.Attributes Descriptionquantityinteger How many times a voucher can be redeemed. A null value means unlimited. redeemed_quantityinteger How many times a voucher has already been redeemed. Example: 1 redeemed_pointsinteger Total loyalty points redeemed. Example: 100000 objectstring 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. urlstring The endpoint where this list of redemptions can be accessed using a GET method. /v1/vouchers/{voucher_code}/redemptions Example: /v1/vouchers/WVPblOYX/redemptions?page=1&limit=10 | | publishobject | 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 publish voucher API method.Required Optionaltype:LOYALTY_CARD type:DISCOUNT_VOUCHER is_referral_code:true type:GIFT_VOUCHERAttributes Descriptionobjectstring 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. countinteger Publication events counter. Example: 0 urlstring The endpoint where this list of publications can be accessed using a GET method. /v1/vouchers/{voucher_code}/publications Example: /v1/vouchers/WVPblOYX/publications?page=1&limit=10 | | objectstring | The type of the object represented by JSON. Default is voucher. |

Category

AttributesDescription
idstringUnique category ID assigned by Voucherify.
namestringCategory name.
hierarchyintegerCategory hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
objectstringThe type of the object represented by the JSON. This object stores information about the category.Available values: category
created_atstringTimestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.Example:2022-07-14T10:45:13.156Z
updated_atstringTimestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.Example:2022-08-16T10:52:08.094Z

Validity Timeframe

AttributesDescription
durationstringDefines 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.Example:PT1H
intervalstringDefines 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.Example:P2D

Validity Day Of Week

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

Validity Hours

AttributesDescription
dailyarrayDefines the reccuring period(s) when the resource is active. The periods should not overlap.Array of:Attributes Descriptionstart_timestring Defines the starting hour of validity in the HH:mm format. The resource is inactive before this time. Example: 12:00 days_of_weekarray Integer array corresponding to the particular days of the week in which the resource is valid. 0 Sunday 1 Monday 2 Tuesday 3 Wednesday 4 Thursday 5 Friday 6 Saturday expiration_timestring Defines the ending hour of validity in the HH:mm format. The resource is inactive after this time. Example: 14:00
I