Voucher Object

Voucher

AttributesDescription
id
string

Assigned by the Voucherify API, identifies the voucher.

Example:

v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV

code
string

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

Example:

WVPblOYX

campaign
string

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

Example:

Gift Card Campaign

campaign_id
string

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

Example:

camp_FNYR4jhqZBM9xTptxDGgeNBV

category
string

Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint.

category_id
string

Unique category ID assigned by Voucherify.

Example:

cat_0bb343dee3cdb5ec0c

categories
array

Contains details about the category.

Array of Category
type
string

Defines the type of the voucher.

Available values: GIFT_VOUCHER, DISCOUNT_VOUCHER, LOYALTY_CARD
discountSee: Discount
gift
object

Object representing gift parameters. Child attributes are present only if type is GIFT_VOUCHER. Defaults to null.

AttributesDescription
amount
integer

Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.

Example:

10000

balance
integer

Available funds. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.

Example:

500

effect
string

Defines how the credits are applied to the customer's order.

Available values: APPLY_TO_ORDER, APPLY_TO_ITEMS
loyalty_card
object

Object representing loyalty card parameters. Child attributes are present only if type is LOYALTY_CARD. Defaults to null.

AttributesDescription
points
integer

Total points incurred over lifespan of loyalty card.

Example:

7000

balance
integer

Points available for reward redemption.

Example:

6970

next_expiration_date
string

The next closest date when the next set of points are due to expire.

Example:

2023-05-30

next_expiration_points
integer

The amount of points that are set to expire next.

start_date
string

Activation 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_date
string

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

Example:

2021-12-31T00:00:00.000Z

validity_timeframe
object

Set recurrent time periods when the voucher is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.

AttributesDescription
duration
string

Defines the amount of time the voucher will be active in ISO 8601 format. For example, a voucher with a duration of PT1H will be valid for a duration of one hour.

Example:

PT1H

interval
string

Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a voucher with an interval of P2D will be active every other day.

Example:

P2D

validity_day_of_week
array

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
active
boolean, null

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_info
string

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

metadata
object

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.

assetsSee: Voucher Assets
is_referral_code
boolean, null

Flag indicating whether this voucher is a referral code; true for campaign type REFERRAL_PROGRAM.

created_at
string

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

Example:

2021-12-22T10:13:06.487Z

updated_at
string

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

Example:

2021-12-22T10:14:45.316Z

holder_id
string

Unique customer ID of voucher owner.

Example:

cust_eWgXlBBiY6THFRJwX45Iakv4

holderSee: Simple Customer
object
string

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

distributions
array
Array of:
deleted
boolean

Flag indicating whether this voucher is deleted.

validation_rules_assignmentsSee: Validation Rules Assignments List
publish
object

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.

RequiredOptional
type:LOYALTY_CARDtype:DISCOUNT_VOUCHER
is_referral_code:truetype:GIFT_VOUCHER
AttributesDescription
object
string

The type of object represented is by default list. To get this list, you need to make a call to the endpoint returned in the url attribute.

count
integer

Publication events counter.

Example:

0

url
string

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

redemption
object

Stores a summary of redemptions that have been applied to the voucher.

AttributesDescription
quantity
integer

How many times a voucher can be redeemed. A null value means unlimited.

redeemed_quantity
integer

How many times a voucher has already been redeemed.

Example:

1

redeemed_amount
integer

Total amount redeemed. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 balance is written as 10000.

Example:

100000

redeemed_points
integer

Total loyalty points redeemed.

Example:

100000

object
string

The type of object represented is by default list. To get this list, you need to make a call to the endpoint returned in the url attribute.

url
string

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

Category

AttributesDescription
id
string

Unique category ID assigned by Voucherify.

name
string

Category name.

hierarchy
integer

Category hierarchy.

object
string

The type of object represented by the JSON. This object stores information about the category.

Available values: category
created_at
string

Timestamp representing the date and time when the category was created in ISO 8601 format.

Example:

2022-07-14T10:45:13.156Z

updated_at
string

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

Example:

2022-08-16T10:52:08.094Z

stacking_rules_type
string

The type of the stacking rule eligibility.

Available values: JOINT, EXCLUSIVE

Discount

Contains information about discount.

One of:

Amount, Unit, Unit Multiple, Percent, Fixed

Voucher Assets

AttributesDescription
qr
object

Stores Quick Response (QR) representation of encrypted code.

AttributesDescription
id
string

Encrypted voucher code ID.

Example:

U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK+t4pp7U7oFzjGJzj9q/bmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg+BaZk5QwXMf8k/OzSlOEVybpwSq+AiqPoNtjeuqtIgkDyvT6Q==

url
string

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

barcode
object

Stores barcode representation of encrypted code.

AttributesDescription
id
string

Encrypted voucher code ID.

Example:

U2FsdGVkX19eJhGfWwUrH9+tulBkON+AnMktic+N6CVWzZ9+fHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ+kJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6/pFs61apEn9SJx32ttCF6d3oxKISQQ==

url
string

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

Simple Customer

AttributesDescription
id
string

The ID of an existing customer that will be linked to redemption in this request.

source_id
string

A unique identifier of the customer who validates a voucher. It can be a customer ID or email from a CRM system, database, or a third-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored.

name
string

Customer's first and last name.

email
string

Customer's email address.

metadata
object

A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments.

object
string

The type of object represented by JSON.

Available values: customer

Validation Rules Assignments List

AttributesDescription
object
string

The type of object represented by JSON. This object stores information about validation rules assignments.

Available values: list
data_ref
string

Identifies the name of the attribute that contains the array of validation rules assignments.

Available values: data
data
array

Contains array of validation rules assignments.

Array of Business Validation Rule Assignment
total
integer

Total number of validation rules assignments.

Amount

AttributesDescription
type
string

Defines the type of the voucher.

Available values: AMOUNT
amount_off
number

Amount taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000.

amount_off_formula
string
aggregated_amount_limit
integer

Maximum discount amount per order.

effect

Defines how the discount is applied to the customer's order.

Discount Amount Vouchers Effect Types
is_dynamic
boolean

Flag indicating whether the discount was calculated using a formula.

Unit

AttributesDescription
type
string

Discount type.

Available values: UNIT
unit_off
integer

Number of units to be granted a full value discount.

unit_off_formula
string
effect

Defines how the unit is added to the customer's order.

Discount Unit Vouchers Effect Types
unit_type
string

The product deemed as free, chosen from product inventory (e.g. time, items).

product

Contains information about the product.

Simple Product Discount Unit
skuSee: Simple Sku Discount Unit
is_dynamic
boolean

Flag indicating whether the discount was calculated using a formula.

Unit Multiple

AttributesDescription
type
string

Discount type.

Available values: UNIT
effect
string

Defines how the discount is applied to the customer's order.

Available values: ADD_MANY_ITEMS
units
array
Array of One Unit

Percent

AttributesDescription
type
string

Defines the type of the voucher.

Available values: PERCENT
percent_off
number

The percent discount that the customer will receive.

percent_off_formula
string
amount_limit
number

Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600.

aggregated_amount_limit
integer

Maximum discount amount per order.

effect

Defines how the discount is applied to the customer's order.

Discount Percent Vouchers Effect Types
is_dynamic
boolean

Flag indicating whether the discount was calculated using a formula.

Fixed

AttributesDescription
type
string

Defines the type of the voucher.

Available values: FIXED
fixed_amount
number

Sets a fixed value for an order total or the item price. The value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. If the fixed amount is calculated by the formula, i.e. the fixed_amount_formula parameter is present in the fixed amount definition, this value becomes the fallback value. As a result, if the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.

fixed_amount_formula
string
effect

Defines how the discount is applied to the customer's order.

Discount Fixed Vouchers Effect Types
is_dynamic
boolean

Flag indicating whether the discount was calculated using a formula.

Business Validation Rule Assignment

AttributesDescription
id
string

The unique identifier for a assignment

rule_id
string

The unique identifier for a rule

related_object_id
string

The unique identifier for a related object

related_object_type
string

The type of related object

created_at
string

Timestamp representing the date and time when the object was created in ISO 8601 format.

Example:

2022-03-09T11:19:04.819Z

updated_at
string

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

Example:

2022-03-09T11:19:04.819Z

object
string

The type of object represented by JSON.

Available values: validation_rules_assignment
validation_status
string

The validation status of the assignment

Available values: VALID, PARTIALLY_VALID, INVALID
validation_omitted_rules
array

The list of omitted rules

Discount Amount Vouchers Effect Types

Available values: APPLY_TO_ORDER, APPLY_TO_ITEMS, APPLY_TO_ITEMS_PROPORTIONALLY, APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY, APPLY_TO_ITEMS_BY_QUANTITY

Discount Unit Vouchers Effect Types

Available values: ADD_MISSING_ITEMS, ADD_NEW_ITEMS, ADD_MANY_ITEMS

Simple Product Discount Unit

AttributesDescription
id
string

Unique product ID, assigned by Voucherify.

source_id
string

Product's source ID.

name
string

Product name.

Simple Sku Discount Unit

AttributesDescription
id
string

Unique SKU ID, assigned by Voucherify.

source_id
string

Product variant's source ID.

name
string

Sku name

One Unit

AttributesDescription
unit_off
number

Number of units to be granted a full value discount.

unit_off_formula
string
effect
string

Defines how the unit is added to the customer's order.

Available values: ADD_NEW_ITEMS, ADD_MISSING_ITEMS
unit_type
string

The product deemed as free, chosen from product inventory (e.g. time, items).

product

Contains information about the product.

Simple Product Discount Unit
sku

Contains information about the sku.

Simple Sku Discount Unit

Discount Percent Vouchers Effect Types

Available values: APPLY_TO_ORDER, APPLY_TO_ITEMS

Discount Fixed Vouchers Effect Types

Available values: APPLY_TO_ORDER, APPLY_TO_ITEMS