Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
Specify the details of the voucher that you would like to create.
- Create loyalty card with specific code
- Create loyalty card with code config
- Create gift card with specific code
- Create gift card with code config
- Create voucher in a discount campaign with specific code
- Create voucher in a discount campaign with code config
Request body schema for POST v1/vouchers
.
Code that identifies a voucher. The pattern can use all the letters of the English alphabet, Arabic numerals, and special characters. Pass this attribute in the request body to create a distinct code. Otherwise, either use the code_config
object to set the rules that the Voucherify API will use to create a random code, or don't pass any code and Voucherify will generate a random code.
"WVPblOYX"
Defines the type of the voucher.
LOYALTY_CARD
Simplified loyalty card data.
Identifies the voucher's parent campaign using a unique campaign name.
"Gift Card Campaign"
Identifies the voucher's parent campaign using a unique campaign ID assigned by the Voucherify API.
"camp_FNYR4jhqZBM9xTptxDGgeNBV"
The name of the category that this voucher belongs to. Useful when listing vouchers with the List Vouchers endpoint.
Unique identifier assigned by Voucherify to the name of the category that this voucher belongs to. Useful when listing vouchers with the List Vouchers endpoint.
"cat_0b6152ce12414820dc"
Start date defines when the code starts to be active. Activation timestamp is presented in the ISO 8601 format. Voucher is inactive before this date.
"2021-12-01T00:00:00.000Z"
Expiration date defines when the code expires. Expiration timestamp is presented in the ISO 8601 format. Voucher is inactive after this date.
"2021-12-31T00:00:00.000Z"
Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.start_date
required when including the validity_timeframe
.
Integer array corresponding to the particular days of the week in which the voucher is valid.
0
Sunday1
Monday2
Tuesday3
Wednesday4
Thursday5
Friday6
Saturday
Determines the hours of validity, e.g. to create a happy hours scenario.
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 voucherfalse
indicates an inactive voucher
An optional field to keep any extra textual information about the code such as a code description and details.
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.
Array containing the ID of the validation rule associated with the voucher.
Stores the quantity of redemptions that can be applied to the voucher.
Response
Returns a voucher object if the call succeeded.
Response body schema for POST v1/vouchers
and /vouchers/{code}
This is an object representing a voucher with categories and validation rules assignments.
This is an object representing a voucher.
Assigned by the Voucherify API, identifies the voucher.
"v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV"
A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters.
"WVPblOYX"
A unique campaign name, identifies the voucher's parent campaign.
"Gift Card Campaign"
Assigned by the Voucherify API, identifies the voucher's parent campaign.
"camp_FNYR4jhqZBM9xTptxDGgeNBV"
Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint.
Unique category ID assigned by Voucherify.
"cat_0bb343dee3cdb5ec0c"
Defines the type of the voucher.
GIFT_VOUCHER
, DISCOUNT_VOUCHER
, LOYALTY_CARD
Contains information about discount.
- Amount
- Unit
- Unit Multiple
- Percent
- Fixed
Object representing gift parameters. Child attributes are present only if type
is GIFT_VOUCHER
. Defaults to null
.
Object representing loyalty card parameters. Child attributes are present only if type
is LOYALTY_CARD
. Defaults to null
.
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 timestamp defines when the code expires in ISO 8601 format. Voucher is inactive after this date.
"2021-12-31T00:00:00.000Z"
Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.start_date
required when including the validity_timeframe
.
Integer array corresponding to the particular days of the week in which the voucher is valid.
0
Sunday1
Monday2
Tuesday3
Wednesday4
Thursday5
Friday6
Saturday
Determines the hours of validity, e.g. to create a happy hours scenario.
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 voucherfalse
indicates an inactive voucher
An optional field to keep any extra textual information about the code such as a code description and details.
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.
Stores links to images of QR and barcode that correspond to an encrypted voucher code.
Flag indicating whether this voucher is a referral code; true
for campaign type REFERRAL_PROGRAM
.
Timestamp representing the date and time when the voucher was created. The value is shown in the ISO 8601 format.
"2021-12-22T10:13:06.487Z"
Timestamp representing the date and time when the voucher was last updated in ISO 8601 format.
"2021-12-22T10:14:45.316Z"
Unique customer identifier of the redeemable holder. It equals to the customer ID assigned by Voucherify.
"cust_eWgXlBBiY6THFRJwX45Iakv4"
Unique identifier of the referring person.
"cust_Vzck5i8U3OhcEUFY6MKhN9Rv"
The type of the object represented by JSON. Default is voucher
.
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.
Stores a summary of redemptions that have been applied to the voucher.
Contains details about the category.
List of Validation Rules Assignments