Voucher
This is an object representing a voucher with categories and validation rules assignments.
All of:
- Voucher Base
Attributes Description categories
array
Contains details about the category.
Array of Categoryvalidation_rules_assignments
See: Validation Rules Assignments List
Voucher Base
Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | Assigned by the Voucherify API, identifies the voucher. Example: v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV | ||||||||||||||||
code | A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters. Example: WVPblOYX | ||||||||||||||||
campaign | A unique campaign name, identifies the voucher’s parent campaign. Example: Gift Card Campaign | ||||||||||||||||
campaign_id | Assigned by the Voucherify API, identifies the voucher’s parent campaign. Example: 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. Example: cat_0bb343dee3cdb5ec0c | ||||||||||||||||
type | Defines the type of the voucher. Available values:
| ||||||||||||||||
discount | See: Discount | ||||||||||||||||
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. Example: 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. Example: 2021-12-31T00:00:00.000Z | ||||||||||||||||
validity_timeframe | See: Validity Timeframe | ||||||||||||||||
validity_day_of_week | See: Validity Day Of Week | ||||||||||||||||
validity_hours | See: Validity Hours | ||||||||||||||||
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 | See: Voucher Assets | ||||||||||||||||
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. The value is shown in the ISO 8601 format. Example: 2021-12-22T10:13:06.487Z | ||||||||||||||||
updated_at | 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 | Unique customer identifier of the redeemable holder. It equals to the customer ID assigned by Voucherify. Example: cust_eWgXlBBiY6THFRJwX45Iakv4 | ||||||||||||||||
referrer_id | Unique identifier of the referring person. Example: cust_Vzck5i8U3OhcEUFY6MKhN9Rv | ||||||||||||||||
object | The type of the object represented by JSON. Default is
| ||||||||||||||||
publish | Stores a summary of publication events: an event counter and endpoint to return details of each event. Publication is an assignment of a code to a customer, e.g. through a distribution.
| ||||||||||||||||
redemption | Stores a summary of redemptions that have been applied to the voucher.
|
Category
Attributes | Description |
---|---|
id | Unique category ID assigned by Voucherify. |
name | Category name. |
hierarchy | Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value. |
object | The type of the object represented by the JSON. This object stores information about the category. Available values:
|
created_at | Timestamp 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_at | Timestamp 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 |
Validation Rules Assignments List
Attributes | Description |
---|---|
object | The type of the object represented by JSON. This object stores information about validation rules assignments. Available values:
|
data_ref | Identifies the name of the attribute that contains the array of validation rules assignments. Available values:
|
data | Contains array of validation rules assignments. Array of Business Validation Rule Assignment |
total | Total number of validation rules assignments. |
Discount
Contains information about discount.
One of:
Validity Timeframe
Attributes | Description |
---|---|
duration | Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a
Example: PT1H |
interval | Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an
Example: P2D |
Validity Day Of Week
Integer array corresponding to the particular days of the week in which the voucher is valid.
0
Sunday1
Monday2
Tuesday3
Wednesday4
Thursday5
Friday6
Saturday
Validity Hours
Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
daily | Defines the reccuring period(s) when the resource is active. The periods should not overlap. Array of:
|
Voucher Assets
Attributes | Description | ||||||
---|---|---|---|---|---|---|---|
qr | Stores Quick Response (QR) representation of encrypted code.
| ||||||
barcode | Stores barcode representation of encrypted code.
|
Business Validation Rule Assignment
Attributes | Description |
---|---|
id | The unique identifier for a assignment |
rule_id | The unique identifier for a rule |
related_object_id | The unique identifier for a related object |
related_object_type | The type of related object |
created_at | Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format. Example: 2022-03-09T11:19:04.819Z |
updated_at | Timestamp representing the date and time when the object was last updated in ISO 8601 format. Example: 2022-03-09T11:19:04.819Z |
object | The type of the object represented by JSON. Available values:
|
validation_status | The validation status of the assignment Available values:
|
validation_omitted_rules | The list of omitted rules |
Amount
Attributes | Description |
---|---|
type | Defines the type of the voucher. Available values:
|
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. |
amount_off_formula | Formula used to dynamically calculate the discount. |
aggregated_amount_limit | Maximum discount amount per order. |
effect | Defines how the discount is applied to the customer’s order. Discount Amount Vouchers Effect Types |
is_dynamic | Flag indicating whether the discount was calculated using a formula. |
Unit
Attributes | Description |
---|---|
type | Discount type. Available values:
|
unit_off | Number of units to be granted a full value discount. |
unit_off_formula | Formula used to dynamically calculate the number of units. |
effect | Defines how the unit is added to the customer’s order. Discount Unit Vouchers Effect Types |
unit_type | The product deemed as free, chosen from product inventory (e.g. time, items). |
product | Contains information about the product. Simple Product Discount Unit |
sku | See: Simple Sku Discount Unit |
is_dynamic | Flag indicating whether the discount was calculated using a formula. |
Unit Multiple
Attributes | Description |
---|---|
type | Discount type. Available values:
|
effect | Defines how the discount is applied to the customer’s order. Available values:
|
units | Array of One Unit |
Percent
Attributes | Description |
---|---|
type | Defines the type of the voucher. Available values:
|
percent_off | The percent discount that the customer will receive. |
percent_off_formula | Formula used to dynamically calculate the 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. |
aggregated_amount_limit | Maximum discount amount per order. |
effect | Defines how the discount is applied to the customer’s order. Discount Percent Vouchers Effect Types |
is_dynamic | Flag indicating whether the discount was calculated using a formula. |
Fixed
Attributes | Description |
---|---|
type | Defines the type of the voucher. Available values:
|
fixed_amount | 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 | Formula used to dynamically calculate the discount. |
effect | Defines how the discount is applied to the customer’s order. Discount Fixed Vouchers Effect Types |
is_dynamic | Flag indicating whether the discount was calculated using a formula. |
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
Attributes | Description |
---|---|
id | Unique product ID, assigned by Voucherify. |
source_id | Product’s source ID. |
name | Product name. |
Simple Sku Discount Unit
Attributes | Description |
---|---|
id | Unique SKU ID, assigned by Voucherify. |
source_id | Product variant’s source ID. |
name | Sku name |
One Unit
Attributes | Description |
---|---|
unit_off | Number of units to be granted a full value discount. |
unit_off_formula | Formula used to dynamically calculate the number of units. |
effect | Defines how the unit is added to the customer’s order. Available values:
|
unit_type | 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