Skip to main content

Publications Create Response Body

Response body schema for POST v1/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 POST v1/publication and GET v1/publications/create. All of:
  1. Publications Create Base Response Body
  2. AttributesDescription
    voucherSee: Voucher

Publications Create Vouchers Response Body

Response body schema for POST v1/publication and GET v1/publications/create. All of:
  1. Publications Create Base Response Body
  2. AttributesDescription
    vouchersarrayContains the unique voucher codes that was assigned by Voucherify.

Publications Create Base Response Body

AttributesDescription
idstringUnique publication ID, assigned by Voucherify.Example:pub_BbjAXnmm8e0SIm3zG8qvvFCP0KuLywtp
objectstringThe type of the object represented by the JSON. This object stores information about the publication.Available values: publication
created_atstringTimestamp 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_idstringUnique customer ID of the customer receiving the publication.Example:cust_eWgXlBBiY6THFRJwX45Iakv4
tracking_idstringCustomer’s source_id.
metadataobjectThe 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.
channelstringHow the publication was originated. It can be your own custom channel or an example value provided here.Available values: API
source_idstring, nullThe 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.
resultstringStatus of the publication attempt.Available values: SUCCESS
customerSee: Customer With Summary Loyalty Referrals
vouchers_idarrayContains 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:
  1. Voucher Base
  2. AttributesDescription
    categoriesarrayContains details about the category.Array of Category
    validation_rules_assignmentsSee: Validation Rules Assignments List

Customer With Summary Loyalty Referrals

All of:
  1. Customer Response Data

    AttributesDescription
    idstringThe ID of an existing customer that will be linked to redemption in this request.
    source_idstringA 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.
    summaryCustomer Summary
    loyaltyCustomer Loyalty
    referralsCustomer Referrals
    system_metadataobjectObject used to store system metadata information.
    created_atstringTimestamp 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_atstringTimestamp 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
    assetsobjectContains information about the customer’s cockpit.Attributes Descriptioncockpit_urlstring Customer’s cockpit URL address.
    objectstringThe type of the object represented by JSON.Available values: customer
  2. Customer Base

Voucher Base

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:Gift 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. Useful when listing vouchers using the List Vouchers endpoint.
category_idstringUnique category ID assigned by Voucherify.Example:cat_0bb343dee3cdb5ec0c
typestringDefines the type of the voucher.Available values: GIFT_VOUCHER, DISCOUNT_VOUCHER, LOYALTY_CARD
discountSee: Discount
giftobjectObject 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_cardobjectObject 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_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
activeboolean, nullA 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 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 | | referrer_idstring | Unique identifier of the referring person.Example:cust_Vzck5i8U3OhcEUFY6MKhN9Rv | | objectstring | The type of the object represented by JSON. Default is voucher. | | 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

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

Validation Rules Assignments List

AttributesDescription
objectstringThe type of the object represented by JSON. This object stores information about validation rules assignments.Available values: list
data_refstringIdentifies the name of the attribute that contains the array of validation rules assignments.Available values: data
dataarrayContains array of validation rules assignments.Array of Business Validation Rule Assignment
totalintegerTotal number of validation rules assignments.

Customer Summary

AttributesDescription
redemptionsSee: Customer Summary Redemptions
ordersSee: Customer Summary Orders

Customer Loyalty

AttributesDescription
pointsintegerCustomer’s loyalty points minus expired for all loyalty cards which the customer has.
referred_customersintegerTotal number of customers referred by the customer.
campaignsobjectContains 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

AttributesDescription
totalintegerTotal number of times this customer received a referral, i.e. was referred by another customer.
campaignsarrayContains 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

AttributesDescription
namestringCustomer’s first and last name.
descriptionstringAn arbitrary string that you can attach to a customer object.
emailstringCustomer’s email address.
phonestringCustomer’s phone number. This parameter is mandatory when you try to send out codes to customers via an SMS channel.
birthdaystringDeprecated. Customer’s birthdate; format YYYY-MM-DD.
birthdatestringCustomer’s birthdate; format YYYY-MM-DD.
addressobject, nullCustomer’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.
metadataobjectA 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, Fixed

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

Voucher Assets

AttributesDescription
qrobjectStores 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
barcodeobjectStores 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

AttributesDescription
idstringThe unique identifier for a assignment
rule_idstringThe unique identifier for a rule
related_object_idstringThe unique identifier for a related object
related_object_typestringThe type of related object
created_atstringTimestamp 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_atstringTimestamp representing the date and time when the object was last updated in ISO 8601 format.Example:2022-03-09T11:19:04.819Z
objectstringThe type of the object represented by JSON.Available values: validation_rules_assignment
validation_statusstringThe validation status of the assignmentAvailable values: VALID, PARTIALLY_VALID, INVALID
validation_omitted_rulesarrayThe list of omitted rules

Customer Summary Redemptions

AttributesDescription
total_redeemedintegerTotal number of redemptions made by the customer.
total_failedintegerTotal number of redemptions that failed.
total_succeededintegerTotal number of redemptions that succeeded.
total_rolled_backintegerTotal number of redemptions that were rolled back for the customer.
total_rollback_failedintegerTotal number of redemption rollbacks that failed.
total_rollback_succeededintegerTotal number of redemption rollbacks that succeeded.
giftobjectSummary 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_cardobjectSummary 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

AttributesDescription
total_amountintegerThe 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_countintegerTotal number of orders made by the customer.
average_amountintegerAverage 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_amountintegerAmount spent on last order. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for $100.00.
last_order_datestringTimestamp representing the date and time of the customer’s last order in ISO 8601 format.Example:2022-08-30T11:51:08.029Z

Amount

AttributesDescription
typestringDefines the type of the voucher.Available values: AMOUNT
amount_offnumberAmount 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_formulastringFormula used to dynamically calculate the discount.
aggregated_amount_limitintegerMaximum discount amount per order.
effectDefines how the discount is applied to the customer’s order.Discount Amount Vouchers Effect Types
is_dynamicbooleanFlag indicating whether the discount was calculated using a formula.

Unit

AttributesDescription
typestringDiscount type.Available values: UNIT
unit_offintegerNumber of units to be granted a full value discount.
unit_off_formulastringFormula used to dynamically calculate the number of units.
effectDefines how the unit is added to the customer’s order.Discount Unit Vouchers Effect Types
unit_typestringThe product deemed as free, chosen from product inventory (e.g. time, items).
productContains information about the product.Simple Product Discount Unit
skuSee: Simple Sku Discount Unit
is_dynamicbooleanFlag indicating whether the discount was calculated using a formula.

Unit Multiple

AttributesDescription
typestringDiscount type.Available values: UNIT
effectstringDefines how the discount is applied to the customer’s order.Available values: ADD_MANY_ITEMS
unitsarrayArray of One Unit

Percent

AttributesDescription
typestringDefines the type of the voucher.Available values: PERCENT
percent_offnumberThe percent discount that the customer will receive.
percent_off_formulastringFormula used to dynamically calculate the discount.
amount_limitnumberUpper 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_limitintegerMaximum discount amount per order.
effectDefines how the discount is applied to the customer’s order.Discount Percent Vouchers Effect Types
is_dynamicbooleanFlag indicating whether the discount was calculated using a formula.

Fixed

AttributesDescription
typestringDefines the type of the voucher.Available values: FIXED
fixed_amountnumberSets 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_formulastringFormula used to dynamically calculate the discount.
effectDefines how the discount is applied to the customer’s order.Discount Fixed Vouchers Effect Types
is_dynamicbooleanFlag 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

AttributesDescription
idstringUnique product ID, assigned by Voucherify.
source_idstringProduct’s source ID.
namestringProduct name.

Simple Sku Discount Unit

AttributesDescription
idstringUnique SKU ID, assigned by Voucherify.
source_idstringProduct variant’s source ID.
namestringSku name

One Unit

AttributesDescription
unit_offnumberNumber of units to be granted a full value discount.
unit_off_formulastringFormula used to dynamically calculate the number of units.
effectstringDefines how the unit is added to the customer’s order.Available values: ADD_NEW_ITEMS, ADD_MISSING_ITEMS
unit_typestringThe product deemed as free, chosen from product inventory (e.g. time, items).
productContains information about the product.Simple Product Discount Unit
skuContains 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
I