❗️ Deprecated
This endpoint represents the deprecated version of the API responsible for voucher validation, and we do not recommend using it. The new Stackable Discounts API introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint.
To verify a voucher code given by a customer, you can use this method. It is designed for a server side integration, which means that is accessible only through private keys.
❗️ Important
This endpoint supports the validation of a single promo code. If you need to validate more than one incentive, you can use the Stackable discounts API. The stacking discounts API lets you validate up to 30 incentives per call. Before integrating Voucherify, choose which validation endpoint you prefer to use.
Voucherify also gives the possibility to create a gift card, which allows using credits to fulfill the order. A user can specify how many credits he wants to use from the gift card. The available balance of credits is counted based on policy rules attached to the Gift Voucher definition.
This operation returns information about the validity of the code. Moreover, it returns a hashed source identifier which can be used as a tracking ID in future calls.
If a validation session is established, then the session details will be returned as well. Read more about sessions here.
Voucher validation might fail because of one of these reasons:
voucher not found - voucher doesn’t exist or was deletedvoucher expired - voucher is out of start date - expiration date time framevoucher is disabled - learn more about a disabled vouchercustomer does not match segment rules - learn more customer trackingorder does not match validation rules - learn more about validation rulesThe access token received from the authorization server in the OAuth 2.0 flow.
A code that identifies the voucher.
"2CpRCE2c"
Specify the voucher validation context using the request body parameters.
Request schema model for validating a voucher using POST v1/vouchers/{code}/validate.
Customer's information.
Order information.
Schema model for session lock object. The session object is required to establish a session between multiple parallel validation and redemption requests. If you only send the type parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a validation session.
Returns information whether the voucher is valid in the context of the parameter values provided in the request body.
Response body schema for POST v1/vouchers/{code}/validate.
Indicates whether the voucher is valid within the context of the parameters provided in the request body.
Voucher code.
Contains list of items that qualify in the scope of the discount. These are definitions of included products, SKUs, and product collections. These can be discounted.
Contains list of items that do not qualify in the scope of the discount. These are definitions of excluded products, SKUs, and product collections. These CANNOT be discounted.
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.
Hashed order source ID.
Voucher's parent campaign name.
Voucher's parent campaign's unique ID.
Contains information about discount.
Gift object response
Contains the cost of reward in points.
Contains information about the reward that is being validated.
Order information.
Schema model for session lock object. The session object contains information about the session key that was used to establish a session between multiple parallel validation and redemption requests.
Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is inactive before this date.
Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is inactive after this date.