โ๏ธ Deprecated
This endpoint represents the deprecated version of the API responsible for qualification, and we do not recommend using it. The new Qualifications API introduces additional features and improvements while maintaining backward compatibility. 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.
Display vouchers qualified to the given customer and context (e.g., order, loyalty reward). Checks up to 50 generic (standalone) vouchers.
๐ Prevailing assumption You data is synced with Voucherify.
A propertyโs value that does not meet a validation rule requirement will disqualify that particular voucher and it will not be listed in the results.
As a sample use case, you can imagine a requirement of displaying coupons available for the customer below the shopping cart. The customer can choose and apply the proposed voucher.
The verification logic wonโt run against coupons from bulk unique code campaigns. For campaigns with multiple unique codes, you should run a dedicated function for searching and identifying qualified campaigns.
๐ Query parameters let you sort and filter the returned vouchers
Customize your response:
- If you only care about verifying a customer, use
audienceRulesOnlyset totrue.- If you want to limit the number of vouchers to be returned from the entire pool of eligible vouchers, set a
limit. This will return vouchers sorted by-created_at, by default beginning with the most recent vouchers listed at the top.- If you have a preference on the sorting order of the returned vouchers, you can use
orderto customize your response.
You have the option of sending customer data via the dedicated customer object in the request body or a nested customer object within the order object.
You can either pass a customer id (Voucherify system generated),
a source_id (your own unique internal customer identifier e.g., email, database ID, CRM id),
a combination of the remaining parameters in the customer object,
a combination of customer id and remaining parameters excluding source_id, or
a combination of source_id and remaining parameters excluding id
For the latter two options, if you pass the source_id or the id with the other parameters, the logic will run independently for parameters explicitly passed in the request body versus those not explicitly passed in the request body. For parameters not explicitly listed in the payload, the verification will be against the data stored for that customer in the system. On the other hand, for any parameter values explicitly passed in the payload, the logic will ignore those stored in the system and will use the new values provided in the qualification request body.
The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard. Read more.
You can either pass an order id (Voucherify system generated),
a source_id (your own unique internal order identifier),
a combination of the remaining parameters in the order object,
a combination of order id and remaining parameters excluding source_id, or
a combination of source_id and remaining parameters excluding id
For the latter two options, if you pass the source_id or the id with the other parameters, the logic will run independently for parameters explicitly passed in the request body versus those not explicitly passed in the request body. For parameters not explicitly listed in the payload, the verification will be against the data stored for that order in the system. On the other hand, for any parameter values explicitly passed in the payload, the logic will ignore those stored in the system and will use the new values provided in the qualification request body.
The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard. Read more.
To validate against vouchers with total order amount requirements, make sure to include the total order amount in the order object or alternatively the amount for every order item (the application will then add each amount to get the total and perform the qualification checks). If the total order amount is provided along with the individual itemsโ amounts, the total order amount will take precedence.
| Case | Order-Level Parameter Included | Item-Level Parameter Included | Precedence | Calculation Result | Parameter included in payload accounts for checks against requirements in these validation rules |
|---|---|---|---|---|---|
| 1 | amount | amount | Order-level | Uses order-level amount | - Total order amount |
| 2 | amount | Item-level | Sums each item-level amount | - Total order amount - subtotal of matched items | |
| 3 | pricequantity | Item-level | Multiplies each itemโs (price x quantity) to get item amount and then adds each itemโs amount to get total order amount | - Total order amount - Subtotal of matched items - Unit price of any matching order line - Price of each item/Price of any item | |
| 4 | amount price quantity | Item-level amount | Uses item-level amount for total order amount calculation, ignores (price x quantity) calculation | - Total order amount (uses item amount if provided or price x quantity for items without amount property; amount takes precedence in case all 3 properties are provided for an item)- Subtotal of matched items (uses item amount, takes precedence if all 3 properties are provided)- Unit price of any matching order line - Price of each item/Price of any item | |
| 5 | amount | amount price quantity | Order-level | Uses order-level amount for total order amount | - Total order amount (uses order-level amount). - Subtotal of matched items (see case 4 for details). - Unit price of any matching order line - Price of each item/Price of any item |
The access token received from the authorization server in the OAuth 2.0 flow.
This parameter set to true will ask only for verifying vouchers' validation rules only against conditions applied to audiences' attributes (belonging into segment, customer metadata, customer redemption count). The remaining checks against limits and rules will be omitted during validation.
The number of vouchers to be qualified.
1 <= x <= 50Sorts the results using one of the filtering options, where the dash - means sorting in a descending order.
created_at, -created_at, updated_at, -updated_at, code, -code Should contain given customer and context such as an order.
Request body schema for /vouchers/qualification.
This object stores customer details. You can send this object in the request body to check against vouchers requiring specific customer validation rules to be satisfied. The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the Advanced Rule Builder โ Audience โ Customer segment or Basic Builder โ Customer Activity. Read more.
Tracks purchase transactions. You can send the order in the request body to check against vouchers requiring specific order validation rules to be satisfied. The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the Advanced Rule Builder โ Order structure/Order volume or Basic Builder โ Order. Read more.
A set of key/value pairs that you can send in the request body to check against vouchers requiring redemption metadata validation rules to be satisfied. The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the Advanced Rule Builder โ Advanced โ Redemption metadata satisfy or Basic Builder โ Attributes match โ REDEMPTION METADATA. Read more.
This operation returns the list of valid and active vouchers based on the qualification of given context (e.g., customer profile, redemptions metadata, order).
Response body schema for vouchers/qualification
The type of the object represented by JSON. Default is list.
Identifies the name of the attribute that contains the array of qualified vouchers.
Array of qualified vouchers.
Total valid and active vouchers matching the qualification criteria in given context.
37
Unique qualification ID.
"qfl_nAMVLoxIqSLh9O6YmfoAXRPG"
Timestamp representing the date and time when the qualification was created. The value is shown in the ISO 8601 format.
"2022-02-25T13:32:08.734Z"
Hashed customer source ID.