Data model description
Attributes | Description | Example | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | Assigned by the Voucherify API, identifies the voucher. | v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV | ||||||||||||||||||||||||||||||||||||
code | A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters. | WVPblOYX | ||||||||||||||||||||||||||||||||||||
campaign | A unique campaign name, identifies the voucher's parent campaign. | Gift Card Campaign | ||||||||||||||||||||||||||||||||||||
campaign_id | Assigned by the Voucherify API, identifies the voucher's parent campaign. | camp_FNYR4jhqZBM9xTptxDGgeNBV | ||||||||||||||||||||||||||||||||||||
category | Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint. | |||||||||||||||||||||||||||||||||||||
category_id | Unique category ID assigned by Voucherify. | cat_0bb343dee3cdb5ec0c | ||||||||||||||||||||||||||||||||||||
categories | Contains details about the category. [object Object] | |||||||||||||||||||||||||||||||||||||
type | Defines the type of voucher. Available values:GIFT_VOUCHER , DISCOUNT_VOUCHER , LOYALTY_CARD | |||||||||||||||||||||||||||||||||||||
discount | One of: Reference to 1_obj_voucher_object_discount_amount Reference to 1_obj_voucher_object_discount_percentage Reference to 1_obj_voucher_object_discount_fixed Reference to [1_obj_voucher_object_discount_unit_one](#unit, single item) Reference to [1_obj_voucher_object_discount_unit_multiple](#unit, multiple items) Reference to 1_obj_voucher_object_discount_shipping | |||||||||||||||||||||||||||||||||||||
gift | Object representing gift parameters. Child attributes are present only if
| |||||||||||||||||||||||||||||||||||||
loyalty_card | Object representing loyalty card parameters. Child attributes are present only if
| |||||||||||||||||||||||||||||||||||||
start_date | 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_date | Expiration timestamp defines when the code expires in ISO 8601 format. Voucher is inactive after this date. | 2021-12-31T00:00:00.000Z | ||||||||||||||||||||||||||||||||||||
validity_timeframe | Set recurrent time periods when the voucher is valid. For example, valid for 1 hour every other day.
| |||||||||||||||||||||||||||||||||||||
validity_day_of_week | Integer array corresponding to the particular days of the week in which the voucher is valid.
0 , 1 , 2 , 3 , 4 , 5 , 6 | |||||||||||||||||||||||||||||||||||||
active | 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
| |||||||||||||||||||||||||||||||||||||
additional_info | An optional field to keep any extra textual information about the code such as a code description and details. | |||||||||||||||||||||||||||||||||||||
metadata | 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. | |||||||||||||||||||||||||||||||||||||
assets | Stores links to images of QR and barcode that correspond to an encrypted voucher code.
| |||||||||||||||||||||||||||||||||||||
is_referral_code | Flag indicating whether this voucher is a referral code. | |||||||||||||||||||||||||||||||||||||
created_at | Timestamp representing the date and time when the voucher was created in ISO 8601 format. | 2021-12-22T10:13:06.487Z | ||||||||||||||||||||||||||||||||||||
updated_at | Timestamp representing the date and time when the voucher was last updated in ISO 8601 format. | 2021-12-22T10:14:45.316Z | ||||||||||||||||||||||||||||||||||||
holder_id | Unique customer ID of voucher owner. | cust_eWgXlBBiY6THFRJwX45Iakv4 | ||||||||||||||||||||||||||||||||||||
validation_rules_assignments | Stores information about validation rules assigned to the voucher.
| |||||||||||||||||||||||||||||||||||||
redemption | Stores a summary of redemptions that have been applied to the voucher.
| |||||||||||||||||||||||||||||||||||||
publish | 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.
| |||||||||||||||||||||||||||||||||||||
object | The type of object represented by JSON. Default is |
Amount
Attributes | Description | Example |
---|---|---|
type | Applies an amount discount. | |
amount_off | 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. In case of the amount being calculated by the formula, i.e. the | 100 |
amount_off_formula | Formula used to calculate the discount. | |
effect | Defines how the discount is applied to the customer's order Available values:APPLY_TO_ORDER , APPLY_TO_ITEMS , APPLY_TO_ITEMS_PROPORTIONALLY , APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY , APPLY_TO_ITEMS_BY_QUANTITY |
Percentage
Attributes | Description | Example |
---|---|---|
type | Applies a percentage discount. | |
amount_limit | 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. | |
percent_off | Percent taken off the subtotal amount. In case of the percent being calculated by the formula, i.e. the | |
percent_off_formula | Formula used to calculate the discount. | |
effect | Defines how the discount is applied to the customer's order. Available values:APPLY_TO_ORDER , APPLY_TO_ITEMS |
Fixed
Attributes | Description | Example | ||||||
---|---|---|---|---|---|---|---|---|
type | Sets a fixed total on cart or item(s) and then calculates the discount to apply. | |||||||
fixed_amount | Set a fixed valued for an order total or price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. In case of the fixed amount being calculated by the formula, i.e. the | 1000 | ||||||
fixed_amount_formula | Formula used to calculate the discounted price of an item or a new order total. | |||||||
effect |
APPLY_TO_ORDER , APPLY_TO_ITEMS |
Unit, single item
Attributes | Description | Example |
---|---|---|
type | Applies a full value discount to item(s). | |
unit_off | Number of units to be granted a full value discount. In case of the unit being calculated by the formula, i.e. the | 1 |
unit_off_formula | Formula used to calculate the number of units. | |
unit_type | The product deemed as free, chosen from the product inventory (e.g. time, items). | prod_f1r5Tpr0DuC7 |
effect | Defines how the unit is added to the customer's order. Available values:ADD_NEW_ITEMS , ADD_MISSING_ITEMS |
Unit, multiple items
Attributes | Description | Example | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
type | Applies a full value discount to item(s). | ||||||||||||||||
effect | Defines the effect for adding multiple item types. | ||||||||||||||||
units | Array of objects defining items to be offered for free. Each item type can have a different discount effect assigned. Array of:
|
Shipping
Attributes | Description | Example |
---|---|---|
type | Applies a full value discount to item(s). | |
unit_off | Subtracts 1 shipping item from the subtotal. | |
unit_type | The shipping product deemed as free. | |
effect | Defines how the unit is added to the customer's order. |