Publications Create Response Body
Response body schema for POSTv1/publication
and GET v1/publications/create
.
One of:
Publications Create Voucher Response Body, Publications Create Vouchers Response Body
Publications Create Voucher Response Body
Response body schema for POSTv1/publication
and GET v1/publications/create
.
All of:
- Publications Create Base Response Body
-
Attributes Description voucher See: Voucher
Publications Create Vouchers Response Body
Response body schema for POSTv1/publication
and GET v1/publications/create
.
All of:
- Publications Create Base Response Body
-
Attributes Description vouchers array
Contains the unique voucher codes that was assigned by Voucherify.
Publications Create Base Response Body
Attributes | Description |
---|---|
idstring | Unique publication ID, assigned by Voucherify.Example:pub_BbjAXnmm8e0SIm3zG8qvvFCP0KuLywtp |
objectstring | The type of the object represented by the JSON. This object stores information about the publication .Available values: publication |
created_atstring | Timestamp representing the date and time when the publication was created. The value is shown in the ISO 8601 format.Example:2022-09-23T09:57:00.434Z |
customer_idstring | Unique customer ID of the customer receiving the publication.Example:cust_eWgXlBBiY6THFRJwX45Iakv4 |
tracking_idstring | Customer’s source_id . |
metadataobject | The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format. |
channelstring | How the publication was originated. It can be your own custom channel or an example value provided here.Available values: API |
source_idstring , null | The merchant’s publication ID if it is different from the Voucherify publication ID. It’s an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. |
resultstring | Status of the publication attempt.Available values: SUCCESS |
customer | See: Customer With Summary Loyalty Referrals |
vouchers_idarray | Contains the unique internal voucher ID that was assigned by Voucherify. |
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 Category validation_rules_assignments See: Validation Rules Assignments List
Customer With Summary Loyalty Referrals
All of:-
Customer Response Data
Attributes Description 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. summary Customer Summary loyalty Customer Loyalty referrals Customer Referrals system_metadata object
Object used to store system metadata information. created_at string
Timestamp representing the date and time when the customer was created. The value is shown in the ISO 8601 format.Example:2022-08-30T06:32:07.380Z updated_at string
Timestamp representing the date and time when the customer was updated. The value is shown in the ISO 8601 format.Example:2022-08-31T06:32:07.380Z assets object
Contains information about the customer’s cockpit.Attributes Descriptioncockpit_urlstring Customer’s cockpit URL address. object string
The type of the object represented by JSON.Available values: customer
- Customer Base
Voucher Base
Attributes | Description |
---|---|
idstring | Assigned by the Voucherify API, identifies the voucher.Example:v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV |
codestring | A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters.Example:WVPblOYX |
campaignstring | A unique campaign name, identifies the voucher’s parent campaign.Example:Gift Card Campaign |
campaign_idstring | Assigned by the Voucherify API, identifies the voucher’s parent campaign.Example:camp_FNYR4jhqZBM9xTptxDGgeNBV |
categorystring | Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint. |
category_idstring | Unique category ID assigned by Voucherify.Example:cat_0bb343dee3cdb5ec0c |
typestring | Defines the type of the voucher.Available values: GIFT_VOUCHER , DISCOUNT_VOUCHER , LOYALTY_CARD |
discount | See: Discount |
giftobject | Object representing gift parameters. Child attributes are present only if type is GIFT_VOUCHER . Defaults to null .Attributes Descriptionamountinteger
Total gift card income over the lifetime of the card. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for 100.00.

Example:

10000


subtracted\_amountinteger 

Total amount of subtracted credits over the gift card lifetime. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for 100.00.
balanceinteger
Available funds. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for $100.00.
Example:
500
effectstring
Defines how the credits are applied to the customer’s order.
Available values: APPLY_TO_ORDER, APPLY_TO_ITEMS |
loyalty_cardobject | Object representing loyalty card parameters. Child attributes are present only if type is LOYALTY_CARD . Defaults to null .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.
pending_pointsinteger
Shows the number of pending points that will be added to the loyalty card when they are activated automatically or manually.
expired_pointsinteger
Shows the total number of expired points over the lifetime of the loyalty card.
subtracted_pointsinteger
Shows the total number of subtracted points over the lifetime of the loyalty card. |
start_datestring | 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_datestring | 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 |
activeboolean , 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_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. | | assets | See: Voucher Assets | | is_referral_codeboolean
,null
| Flag indicating whether this voucher is a referral code;true
for campaign typeREFERRAL_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 | | referrer_idstring
| Unique identifier of the referring person.Example:cust_Vzck5i8U3OhcEUFY6MKhN9Rv | | objectstring
| The type of the object represented by JSON. Default isvoucher
. | | publishobject
| 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.Attributes 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 | | 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 |
Category
Attributes | Description |
---|---|
idstring | Unique category ID assigned by Voucherify. |
namestring | Category name. |
hierarchyinteger | Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value. |
objectstring | The type of the object represented by the JSON. This object stores information about the category.Available values: category |
created_atstring | 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_atstring | 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 |
---|---|
objectstring | The type of the object represented by JSON. This object stores information about validation rules assignments.Available values: list |
data_refstring | Identifies the name of the attribute that contains the array of validation rules assignments.Available values: data |
dataarray | Contains array of validation rules assignments.Array of Business Validation Rule Assignment |
totalinteger | Total number of validation rules assignments. |
Customer Summary
Attributes | Description |
---|---|
redemptions | See: Customer Summary Redemptions |
orders | See: Customer Summary Orders |
Customer Loyalty
Attributes | Description |
---|---|
pointsinteger | Customer’s loyalty points minus expired for all loyalty cards which the customer has. |
referred_customersinteger | Total number of customers referred by the customer. |
campaignsobject | Contains campaigns with details about point balances and how many customers were referred by the customer.Attributes Description[propertyName]object Contains details about the point balances left on loyalty cards and the number of referred customers in each campaign. Attributes Descriptionpointsinteger Remaining point balance in campaign. loyalty_tierstring Customer’s loyalty tier within the campaign. Example: ltr_UJ5Q54Q0OvEhua87Qfv2Ki5x referred_customersinteger Number of customers referred by the customer in campaign. |
Customer Referrals
Attributes | Description |
---|---|
totalinteger | Total number of times this customer received a referral, i.e. was referred by another customer. |
campaignsarray | Contains an array of campaigns that served as the source of a referral for the customer.Array of:### Customer Referrals Campaigns ItemAttributes Descriptioncampaign_idstring Unique campaign ID, assigned by Voucherify. Example: camp_rRsfatlwN7unSeUIJDCYedal referrer_idstring Unique referrer ID, assigned by Voucherify. This is the customer ID of a customer that is referring this customer. Example: cust_sehkNIi8Uq2qQuRqSr7xn4Zi related_object_idstring Related object id Example: r_0b9d4cc4aa164dd073 related_object_typestring Related object type, i.e. redemption. datestring Timestamp representing the date and time when the customer was referred in ISO 8601 format. Example: 2022-08-30T10:19:39.196Z |
Customer Base
Attributes | Description |
---|---|
namestring | Customer’s first and last name. |
descriptionstring | An arbitrary string that you can attach to a customer object. |
emailstring | Customer’s email address. |
phonestring | Customer’s phone number. This parameter is mandatory when you try to send out codes to customers via an SMS channel. |
birthdaystring | Deprecated . |
birthdatestring | Customer’s birthdate; format YYYY-MM-DD. |
addressobject , null | Customer’s address.Attributes Descriptioncitystring City statestring State line_1string First line of address. line_2string Second line of address. countrystring Country. postal_codestring Postal code. |
metadataobject | 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. |
Discount
Contains information about discount. One of: Amount, Unit, Unit Multiple, Percent, FixedValidity Timeframe
Attributes | Description |
---|---|
durationstring | 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.Example:PT1H |
intervalstring | 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.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 |
---|---|
dailyarray | Defines 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 |
Voucher Assets
Attributes | Description |
---|---|
qrobject | 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 |
Business Validation Rule Assignment
Attributes | Description |
---|---|
idstring | The unique identifier for a assignment |
rule_idstring | The unique identifier for a rule |
related_object_idstring | The unique identifier for a related object |
related_object_typestring | The type of related object |
created_atstring | 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_atstring | Timestamp representing the date and time when the object was last updated in ISO 8601 format.Example:2022-03-09T11:19:04.819Z |
objectstring | The type of the object represented by JSON.Available values: validation_rules_assignment |
validation_statusstring | The validation status of the assignmentAvailable values: VALID , PARTIALLY_VALID , INVALID |
validation_omitted_rulesarray | The list of omitted rules |
Customer Summary Redemptions
Attributes | Description |
---|---|
total_redeemedinteger | Total number of redemptions made by the customer. |
total_failedinteger | Total number of redemptions that failed. |
total_succeededinteger | Total number of redemptions that succeeded. |
total_rolled_backinteger | Total number of redemptions that were rolled back for the customer. |
total_rollback_failedinteger | Total number of redemption rollbacks that failed. |
total_rollback_succeededinteger | Total number of redemption rollbacks that succeeded. |
giftobject | Summary of gift card credits.Attributes Descriptionredeemed_amountinteger Total amount of gift card credits redeemed by customer. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for 100.00.


amount\_to\_gointeger 

Remaining gift card balance across all gift cards. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for 100.00. |
loyalty_cardobject | Summary of loyalty points.Attributes Descriptionredeemed_pointsinteger Total number of loyalty points redeemed by the customer. points_to_gointeger Sum of remaining available point balance across all loyalty cards. |
Customer Summary Orders
Attributes | Description |
---|---|
total_amountinteger | The total amount spent by the customer. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for $100.00 . |
total_countinteger | Total number of orders made by the customer. |
average_amountinteger | Average amount spent on orders. total_amount ÷ total_count . The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for $100.00 . |
last_order_amountinteger | Amount spent on last order. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for $100.00 . |
last_order_datestring | Timestamp representing the date and time of the customer’s last order in ISO 8601 format.Example:2022-08-30T11:51:08.029Z |
Amount
Attributes | Description |
---|---|
typestring | Defines the type of the voucher.Available values: AMOUNT |
amount_offnumber | 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_formulastring | Formula used to dynamically calculate the discount. |
aggregated_amount_limitinteger | Maximum discount amount per order. |
effect | Defines how the discount is applied to the customer’s order.Discount Amount Vouchers Effect Types |
is_dynamicboolean | Flag indicating whether the discount was calculated using a formula. |
Unit
Attributes | Description |
---|---|
typestring | Discount type.Available values: UNIT |
unit_offinteger | Number of units to be granted a full value discount. |
unit_off_formulastring | 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_typestring | 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_dynamicboolean | Flag indicating whether the discount was calculated using a formula. |
Unit Multiple
Attributes | Description |
---|---|
typestring | Discount type.Available values: UNIT |
effectstring | Defines how the discount is applied to the customer’s order.Available values: ADD_MANY_ITEMS |
unitsarray | Array of One Unit |
Percent
Attributes | Description |
---|---|
typestring | Defines the type of the voucher.Available values: PERCENT |
percent_offnumber | The percent discount that the customer will receive. |
percent_off_formulastring | Formula used to dynamically calculate the discount. |
amount_limitnumber | 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_limitinteger | Maximum discount amount per order. |
effect | Defines how the discount is applied to the customer’s order.Discount Percent Vouchers Effect Types |
is_dynamicboolean | Flag indicating whether the discount was calculated using a formula. |
Fixed
Attributes | Description |
---|---|
typestring | Defines the type of the voucher.Available values: FIXED |
fixed_amountnumber | 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_formulastring | 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_dynamicboolean | 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 |
---|---|
idstring | Unique product ID, assigned by Voucherify. |
source_idstring | Product’s source ID. |
namestring | Product name. |
Simple Sku Discount Unit
Attributes | Description |
---|---|
idstring | Unique SKU ID, assigned by Voucherify. |
source_idstring | Product variant’s source ID. |
namestring | Sku name |
One Unit
Attributes | Description |
---|---|
unit_offnumber | Number of units to be granted a full value discount. |
unit_off_formulastring | Formula used to dynamically calculate the number of units. |
effectstring | Defines how the unit is added to the customer’s order.Available values: ADD_NEW_ITEMS , ADD_MISSING_ITEMS |
unit_typestring | 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