---
title: "Validate Voucher (client-side)"
method: GET
path: "/client/v1/validate"
tags: ["Client-side"]
deprecated: true
---

# Validate Voucher (client-side)

`GET /client/v1/validate`

> **Deprecated.**

> ❗️ 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](/api-reference/client-side/validate-stackable-discounts-client-side) 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 customer, you can use this method. It is designed for client side integration which means that is accessible only through public keys. This method is designed to be run directly either in web browsers or mobile apps.

> ❗️ Specifying gift credits and loyalty points
>
> This endpoint does not support specifying the specific amount of gift credits to apply to an order nor the specific amount of loyalty points to an order. It calculates the amount that is available on the card and applies as much credits or points as possible to cover the total amount. 

### Set customer identity (optional)

Voucherify can help you track anonymous customers. Once you integrate Voucherify into your web app and call the validate method, Voucherify will return a tracking ID and the script will store it in a cookie. Each subsequent validate call will use the same tracking ID.

Voucherify tracks a user using a tracking ID to see if the user who is validating vouchers is the same as the one who consuming them. Voucherify does this by setting up an identity for the user. A `tracking_id` will be generated on the server side, unless you specify your own `tracking_id`. In both cases, you will receive the `tracking_id` in the validation response.

The returned `tracking_id` field should be used as the customer `source_id` in subsequent redemption requests. Moreover, the `tracking_id` returned from Validation API is encoded. Voucherify will recognize both values for identifying customer - the one before encryption sent as a query parameter to the **GET** `v1/validate` request, and the version encrypted and returned as part of the validation request.

### Sample workflow

Customer tracking workflow in a nutshell:

**Client-side:**
  * A customer visits your website.
  * A customer validates a voucher code. That triggers a validate request to be sent to Voucherify. In the request, you pass the tracking_id or customer.source_id. As a result, the API call to this endpoint returns an **encoded** `tracking_id`.

**Backend:**
  * Once the customer finishes the checkout process, your website passes the `tracking_id` to your backend during a redemption call. The `tracking_id` is sent as a value assigned to the property *source_id* in a customer object.
  * A customer object is created and within the redemption response, you get a customer `id`.
  * You can use the customer `id` or the customer `source_id` to fetch or modify the customer details.
  
A customer is created (upserted) automatically with a redemption call. Alternatively, you can create a new profile by creating a customer via a dedicated API method. Take a look at the customer object to understand the [entity's structure](/api-reference/customers/customer-object). 



> 📘 Customer identifier
>
> The source id of the customer may either be an already hashed version of the `tracking_id`, which you received in a response from a validation request or a custom ID you predefined (i.e. an email address). Nevertheless, we recommend using identifiers delivered by Voucherify API.




### Examples with Query Parameters

| **Query Parameters** | **Example URL** |
|:---|:---|
| Shortcut - `customer` query param instead of `customer[source_id]` | `https://api.voucherify.io/client/v1/validate?code=sKKFCKLZ&amount=10100&customer=customer_id` |
| Pass `customer`'s and `redemption`'s context `metadata` in query parameters | `https://api.voucherify.io/client/v1/validate?code=sKKFCKLZ&amount=10100&customer=sure_he_is_new&metadata[shop]=1&customer[metadata][propsy]=2&metadata[test]=true` |
| Use `tracking_id` instead of `source_id` | `https://api.voucherify.io/client/v1/validate?code=IKU-mvS-JOG&amount=10100&tracking_id=sure_he_is_new_5&metadata[shop]=1&metadata[test]=true` |

### Reasons why a validation might fail

Voucher validation might fail because of one of these reasons:

* `voucher not found` - voucher doesn't exist or was [deleted](/api-reference/vouchers/delete-voucher)
* `voucher expired` - voucher is out of [start date - expiration date] timeframe
* `voucher is disabled` - learn more about [disabled vouchers](/api-reference/vouchers/disable-voucher)
* `customer does not match segment rules` - learn more about [customer tracking](/api-reference/customers/customer-object)
* `order does not match validation rules` - learn more about [validation rules](/api-reference/validations/validation-object)

## Query parameters

- `code` string
- `tracking_id` string
- `amount` string
- `session_key` string
- `session_ttl` integer
- `session_ttl_unit` 'HOURS' | 'DAYS' | 'MINUTES' | 'SECONDS' | 'MILLISECONDS' | 'MICROSECONDS' | 'NANOSECONDS'
- `metadata` ParameterObject
- `item` object[]
  - `source_id` string — The merchant's product/SKU ID (if it is different from the Voucherify product/SKU ID). It is useful in the integration between multiple systems. It can be an ID from an eCommerce site, a database, or a third-party service.
  - `related_object` string — Used along with the `source_id` property, can be set to either `sku` or `product`.
  - `product_id` string — Unique identifier of the product. It is assigned by Voucherify.
  - `sku_id` string — Unique identifier of the SKU. It is assigned by Voucherify.
  - `quantity` string — The quantity of the particular item in the cart.
  - `price` string — The unit price of the item.
  - `amount` string — The total amount of the order item (`price` * `quantity`).
- `session_type` string
- `customer` union
  - object — Customer source ID and/or customer metadata.
    - `source_id` string — Customer source ID.
    - `metadata` object — 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.
  - string — Unique customer ID assigned by Voucherify, i.e. `cust_eWgXlBBiY6THFRJwX45Iakv4`.
- `order` ParameterOrderMetadata — Order details.
  - `metadata` object — The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format.

## Headers

- `origin` string, hostname, required

## Response `200`

Returns information whether the voucher is valid in the context of the parameter values provided in the query parameters. Moreover, it returns a hashed source identifier which can be used as tracking ID in future calls. If a validation session is established, then the session details will be returned as well. Read more on [validation sessions](/guides/locking-validation-session).

- union
  - union — Response schema model for validating a voucher using **POST** `v1/vouchers/{code}/validate`.
    - 6ResValidateVoucherDiscountCode — Response schema model for validating a discount code using **POST** `v1/vouchers/{code}/validate`.
      - `valid` boolean — Indicates whether the voucher is valid within the context of the parameters provided in the request body.
      - `applicable_to` 6ResApplicableToObject — 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.
        - `data` union[] — Contains array of items to which the discount can apply.
          - union
            - 6ResProductCollection — Contains definition for a product collection.
              - …
            - 6ResProductCollectionUnit — Contains definition for a product collection.
              - …
            - 6ResProductCollectionFixedAmount — Contains definition for a product collection.
              - …
            - 6ResProduct — Contains definition for a product.
              - …
            - 6ResProductUnit — Contains definition for a product.
              - …
            - 6ResProductFixedAmount — Contains definition for a product.
              - …
            - 6ResSku — Contains definition for a product variant.
              - …
            - 6ResSkuUnit — Contains definition for a product variant.
              - …
            - 6ResSkuUnitFixedAmount — Contains definition for a product variant.
              - …
        - `total` integer — Total number of objects defining included products, SKUs, or product collections.
        - `data_ref` string — Identifies the name of the attribute that contains the array of included objects.
        - `object` string — The type of the object represented by JSON. This object stores information about included products, SKUs, or product collections in a dictionary.
      - `inapplicable_to` 6ResInapplicableToObject — 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.
        - `data` union[] — Contains array of items to which the discount cannot apply.
          - union
            - 6ResProductCollectionExcluded — Contains definition for a product collection.
              - …
            - 6ResProductExcluded — Contains definition for a product.
              - …
            - 6ResSkuExcluded — Contains definition for a product variant.
              - …
        - `total` integer — Total number of objects defining excluded products, SKUs, or product collections.
        - `data_ref` string — Identifies the name of the attribute that contains the array of excluded objects.
        - `object` string — The type of the object represented by JSON. This object stores information about excluded products, SKUs, or product collections in a dictionary.
      - `tracking_id` string — Hashed customer source ID.
      - `order` union — This is an object representing an order with calculated discounts applied using the voucher code.
        - 6ObjOrderObjectApplyToOrder — This is an object representing an order with calculated discounts applied using the voucher code.
          - `id` string — Unique order ID, assigned by Voucherify. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
          - `source_id` string — The merchant's order ID if it is different from the Voucherify order ID. It is really useful in case of integration between multiple systems. It can be an order ID from CRM, database or 3rd party service. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
          - `created_at` string, date-time — Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
          - `updated_at` string, date-time — Timestamp representing the date and time when the order was updated. The value is shown in the ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
          - `status` 'CREATED' | 'PAID' | 'CANCELED' | 'FULFILLED' — Order status. This parameter is returned if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body or if you send the request body parameter when defining an order in the request body. This parameter can be passed but it's not required for validation at all. It's used in the redemption process. Normally after the redemption is done, the order is automatically to a `PAID` status. To avoid such default behaviour, the user can pass any of the other status options and it will be set the order status after the redemption instead of the default `PAID`.
          - `amount` integer — Order amount before applying any discount.
          - `discount_amount` integer — Sum of all order-level discounts applied to the order.
          - `total_discount_amount` integer — Sum of all order-level discounts.
          - `total_amount` integer — Order amount after applying all the discounts. `total_amount` = `amount` - `total_discount_amount`
          - `applied_discount_amount` integer — This field shows the order-level discount applied.
          - `total_applied_discount_amount` integer — This field sums up all order-level discounts applied to the order.
          - `items` object[] — Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.
            - `object` string — The type of the object represented by JSON. This object stores information about the `order_item`.
            - `product_id` string — A unique identifier that represents the product and is assigned by Voucherify.
            - `sku_id` string — A unique identifier that represents the SKU and is assigned by Voucherify.
            - `quantity` integer — Quantity of the item in the cart.
            - `amount` integer — Represents a total pre-discount amount of order item (`price` * `quantity`).
            - `price` integer — Unit price of an item. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`.
            - `subtotal_amount` integer — Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. `subtotal_amount`=`amount`-`discount_amount`
            - `product` object — This object stores more information about the related product.
              - …
            - `sku` object — This object stores more information about the related SKU.
              - …
          - `metadata` object — The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format.
          - `customer` object — Object containing information about the customer that is making the purchase.
            - `id` string — Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
            - `object` string — Type of object represented by the `customer` object.
          - `referrer` object — Object containing information about the referrer.
            - `id` string — Unique referrer ID, who referred the customer making the purchase.
            - `object` string — Type of object represented by the `referrer` object.
          - `customer_id` string — Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
          - `referrer_id` string — Unique referrer ID.
          - `object` string — The type of the object represented by JSON. This object stores information about the `order`.
        - 6ObjOrderObjectApplyToItems — This is an object representing an order with calculated discounts applied using the voucher code.
          - `id` string — Unique order ID, assigned by Voucherify. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
          - `source_id` string — The merchant's order ID if it is different from the Voucherify order ID. It is really useful in case of integration between multiple systems. It can be an order ID from CRM, database or 3rd party service. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
          - `created_at` string, date-time — Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
          - `updated_at` string, date-time — Timestamp representing the date and time when the order was updated. The value is shown in the ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
          - `status` 'CREATED' | 'PAID' | 'CANCELED' | 'FULFILLED' — Order status. This parameter is returned if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body or if you send the request body parameter when defining an order in the request body. This parameter can be passed but it's not required for validation at all. It's used in the redemption process. Normally after the redemption is done, the order is automatically to a `PAID` status. To avoid such default behaviour, the user can pass any of the other status options and it will be set the order status after the redemption instead of the default `PAID`.
          - `amount` integer — Order amount before applying any discount.
          - `items_discount_amount` integer — Sum of all product-specific discounts applied. `sum(items, i => i.discount_amount)`
          - `total_discount_amount` integer — Sum of all product-specific discounts applied.
          - `total_amount` integer — Order amount after applying all the discounts. `total_amount` = `amount` - `total_discount_amount`
          - `items_applied_discount_amount` integer — Product-specifc discounts applied to all the items.
          - `total_applied_discount_amount` integer — Product-specific discounts applied in the order.
          - `items` object[] — Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.
            - `object` string — The type of the object represented by JSON. This object stores information about the `order_item`.
            - `product_id` string — A unique identifier that represents the product and is assigned by Voucherify.
            - `sku_id` string — A unique identifier that represents the SKU and is assigned by Voucherify.
            - `quantity` integer — Quantity of the item in the cart.
            - `amount` integer — Represents a total pre-discount amount of order item (`price` * `quantity`).
            - `discount_amount` integer — The item-level discount applied to the item.
            - `applied_discount_amount` integer — The item-level discount applied to the item.
            - `price` integer — Unit price of an item. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`.
            - `subtotal_amount` integer — Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. `subtotal_amount`=`amount`-`discount_amount`
            - `product` object — This object stores more information about the related product.
              - …
            - `sku` object — This object stores more information about the related SKU.
              - …
          - `metadata` object — The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format.
          - `customer` object — Object containing information about the customer that is making the purchase.
            - `id` string — Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
            - `object` string — Type of object represented by the `customer` object.
          - `referrer` object — Object containing information about the referrer.
            - `id` string — Unique referrer ID, who referred the customer making the purchase.
            - `object` string — Type of object represented by the `referrer` object.
          - `customer_id` string — Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
          - `referrer_id` string — Unique referrer ID.
          - `object` string — The type of the object represented by JSON. This object stores information about the `order`.
      - `code` string — Voucher code.
      - `discount` union — Contains information about the discount to be applied to the order.
        - 6ResValidateVoucherDiscountAmount — This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.
          - `type` string — Defines the type of the voucher.
          - `effect` 'APPLY_TO_ORDER' | 'APPLY_TO_ITEMS' | 'APPLY_TO_ITEMS_PROPORTIONALLY' | 'APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY' | 'APPLY_TO_ITEMS_BY_QUANTITY' — Defines how the discount is applied to the customer's order.
          - `amount_off` integer — 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.
        - 6ResValidateVoucherDiscountPercent — This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.
          - `type` string — Defines the type of the voucher.
          - `effect` 'APPLY_TO_ORDER' | 'APPLY_TO_ITEMS' — Defines how the discount is applied to the customer's order.
          - `percent_off` integer — The percent discount that the customer will receive.
          - `amount_limit` integer — 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.
          - `is_dynamic` boolean — Flag indicating whether the discount was calculated using a formula.
        - 6ResValidateVoucherDiscountFixed — This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value. A fixed discounts sets a fixed total on cart or item(s) and then calculates the discount to apply.
          - `type` string — Type of discount.
          - `effect` 'APPLY_TO_ORDER' | 'APPLY_TO_ITEMS' — Defines how the discount is applied to the customer's order. | **Effect** | **Definition** | |---|---| | **APPLY_TO_ORDER** | Sets the order total amount to the value of the fixed amount. The discount value is calculated during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. | | **APPLY_TO_ITEMS** | Sets a new price on items. The total discount amount is calculated during the redemption and it's a difference between the initial item price and the fixed amount. |
          - `fixed_amount` integer — 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.
        - union — This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.
          - 6ResValidateVoucherDiscountUnitProduct — This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.
            - `type` string — Discount type.
            - `effect` 'ADD_MISSING_ITEMS' | 'ADD_NEW_ITEMS' — Defines how the unit is added to the customer's order.
            - `unit_off` integer — Number of units to be granted a full value discount.
            - `unit_type` string — The product deemed as free, chosen from product inventory (e.g. time, items).
            - `product` object — Contains information about the product.
              - …
          - 6ResValidateVoucherDiscountUnitSku — This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.
            - `type` string — Discount type.
            - `effect` 'ADD_MISSING_ITEMS' | 'ADD_NEW_ITEMS' — Defines how the unit is added to the customer's order.
            - `unit_off` integer — Number of units to be granted a full value discount.
            - `unit_type` string — The product variant deemed as free, chosen from product inventory (e.g. time, items).
            - `sku` object — Contains information about the SKU.
              - …
            - `product` object — Contains information about the parent product.
              - …
        - 6ResValidateVoucherDiscountUnitMultiple — This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.
          - `type` string — Discount type.
          - `effect` string — Defines how the discount is applied to the customer's order.
          - `units` union
            - 6ResValidateVoucherDiscountUnitProductMultiple — This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.
              - …
            - 6ResValidateVoucherDiscountUnitSkuMultiple — This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.
              - …
        - 6ResValidateVoucherDiscountShipping — This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.
          - `type` string — Discount type.
          - `effect` string — Defines how the unit is added to the customer's order.
          - `unit_off` integer — Number of units to be granted a full value discount.
          - `unit_type` string — The shipping "product" deemed as free.
          - `product` object — Contains information about the shipping "product".
            - `id` string — Unique shipping "product" ID, assigned by Voucherify.
            - `source_id` string — "Product's" source ID.
            - `name` string — "Product" name.
      - `metadata` object — 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.
      - `start_date` string, date-time — Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is _inactive_ before this date.
      - `expiration_date` string, date-time — Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is _inactive_ after this date.
      - `campaign` string — Voucher's parent campaign name.
      - `campaign_id` string — Voucher's parent campaign's unique ID.
      - `session` 6ResSessionLockDiscountVoucher — 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.
        - `type` string — This session locks the redemption **quantity** by 1.
        - `key` string — The session unique ID assigned by Voucherify or your own unique session ID.
        - `ttl_unit` 'HOURS' | 'DAYS' | 'MINUTES' | 'SECONDS' | 'MILLISECONDS' | 'MICROSECONDS' | 'NANOSECONDS' — Defines the type of unit in which the session time is counted.
        - `ttl` integer — Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter.
    - 6ResValidateVoucherGiftCard — Response schema model for validating a gift card using **POST** `v1/vouchers/{code}/validate`.
      - `valid` boolean — Indicates whether the voucher is valid within the context of the parameters provided in the request body.
      - `applicable_to` 6ResApplicableToObject — 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.
        - `data` union[] — Contains array of items to which the discount can apply.
          - union
            - 6ResProductCollection — Contains definition for a product collection.
              - …
            - 6ResProductCollectionUnit — Contains definition for a product collection.
              - …
            - 6ResProductCollectionFixedAmount — Contains definition for a product collection.
              - …
            - 6ResProduct — Contains definition for a product.
              - …
            - 6ResProductUnit — Contains definition for a product.
              - …
            - 6ResProductFixedAmount — Contains definition for a product.
              - …
            - 6ResSku — Contains definition for a product variant.
              - …
            - 6ResSkuUnit — Contains definition for a product variant.
              - …
            - 6ResSkuUnitFixedAmount — Contains definition for a product variant.
              - …
        - `total` integer — Total number of objects defining included products, SKUs, or product collections.
        - `data_ref` string — Identifies the name of the attribute that contains the array of included objects.
        - `object` string — The type of the object represented by JSON. This object stores information about included products, SKUs, or product collections in a dictionary.
      - `inapplicable_to` 6ResInapplicableToObject — 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.
        - `data` union[] — Contains array of items to which the discount cannot apply.
          - union
            - 6ResProductCollectionExcluded — Contains definition for a product collection.
              - …
            - 6ResProductExcluded — Contains definition for a product.
              - …
            - 6ResSkuExcluded — Contains definition for a product variant.
              - …
        - `total` integer — Total number of objects defining excluded products, SKUs, or product collections.
        - `data_ref` string — Identifies the name of the attribute that contains the array of excluded objects.
        - `object` string — The type of the object represented by JSON. This object stores information about excluded products, SKUs, or product collections in a dictionary.
      - `tracking_id` string — Hashed customer source ID.
      - `order` union — This is an object representing an order with calculated discounts applied using the voucher code.
        - 6ObjOrderObjectApplyToOrder — This is an object representing an order with calculated discounts applied using the voucher code.
          - `id` string — Unique order ID, assigned by Voucherify. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
          - `source_id` string — The merchant's order ID if it is different from the Voucherify order ID. It is really useful in case of integration between multiple systems. It can be an order ID from CRM, database or 3rd party service. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
          - `created_at` string, date-time — Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
          - `updated_at` string, date-time — Timestamp representing the date and time when the order was updated. The value is shown in the ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
          - `status` 'CREATED' | 'PAID' | 'CANCELED' | 'FULFILLED' — Order status. This parameter is returned if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body or if you send the request body parameter when defining an order in the request body. This parameter can be passed but it's not required for validation at all. It's used in the redemption process. Normally after the redemption is done, the order is automatically to a `PAID` status. To avoid such default behaviour, the user can pass any of the other status options and it will be set the order status after the redemption instead of the default `PAID`.
          - `amount` integer — Order amount before applying any discount.
          - `discount_amount` integer — Sum of all order-level discounts applied to the order.
          - `total_discount_amount` integer — Sum of all order-level discounts.
          - `total_amount` integer — Order amount after applying all the discounts. `total_amount` = `amount` - `total_discount_amount`
          - `applied_discount_amount` integer — This field shows the order-level discount applied.
          - `total_applied_discount_amount` integer — This field sums up all order-level discounts applied to the order.
          - `items` object[] — Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.
            - `object` string — The type of the object represented by JSON. This object stores information about the `order_item`.
            - `product_id` string — A unique identifier that represents the product and is assigned by Voucherify.
            - `sku_id` string — A unique identifier that represents the SKU and is assigned by Voucherify.
            - `quantity` integer — Quantity of the item in the cart.
            - `amount` integer — Represents a total pre-discount amount of order item (`price` * `quantity`).
            - `price` integer — Unit price of an item. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`.
            - `subtotal_amount` integer — Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. `subtotal_amount`=`amount`-`discount_amount`
            - `product` object — This object stores more information about the related product.
              - …
            - `sku` object — This object stores more information about the related SKU.
              - …
          - `metadata` object — The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format.
          - `customer` object — Object containing information about the customer that is making the purchase.
            - `id` string — Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
            - `object` string — Type of object represented by the `customer` object.
          - `referrer` object — Object containing information about the referrer.
            - `id` string — Unique referrer ID, who referred the customer making the purchase.
            - `object` string — Type of object represented by the `referrer` object.
          - `customer_id` string — Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
          - `referrer_id` string — Unique referrer ID.
          - `object` string — The type of the object represented by JSON. This object stores information about the `order`.
        - 6ObjOrderObjectApplyToItems — This is an object representing an order with calculated discounts applied using the voucher code.
          - `id` string — Unique order ID, assigned by Voucherify. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
          - `source_id` string — The merchant's order ID if it is different from the Voucherify order ID. It is really useful in case of integration between multiple systems. It can be an order ID from CRM, database or 3rd party service. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
          - `created_at` string, date-time — Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
          - `updated_at` string, date-time — Timestamp representing the date and time when the order was updated. The value is shown in the ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
          - `status` 'CREATED' | 'PAID' | 'CANCELED' | 'FULFILLED' — Order status. This parameter is returned if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body or if you send the request body parameter when defining an order in the request body. This parameter can be passed but it's not required for validation at all. It's used in the redemption process. Normally after the redemption is done, the order is automatically to a `PAID` status. To avoid such default behaviour, the user can pass any of the other status options and it will be set the order status after the redemption instead of the default `PAID`.
          - `amount` integer — Order amount before applying any discount.
          - `items_discount_amount` integer — Sum of all product-specific discounts applied. `sum(items, i => i.discount_amount)`
          - `total_discount_amount` integer — Sum of all product-specific discounts applied.
          - `total_amount` integer — Order amount after applying all the discounts. `total_amount` = `amount` - `total_discount_amount`
          - `items_applied_discount_amount` integer — Product-specifc discounts applied to all the items.
          - `total_applied_discount_amount` integer — Product-specific discounts applied in the order.
          - `items` object[] — Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.
            - `object` string — The type of the object represented by JSON. This object stores information about the `order_item`.
            - `product_id` string — A unique identifier that represents the product and is assigned by Voucherify.
            - `sku_id` string — A unique identifier that represents the SKU and is assigned by Voucherify.
            - `quantity` integer — Quantity of the item in the cart.
            - `amount` integer — Represents a total pre-discount amount of order item (`price` * `quantity`).
            - `discount_amount` integer — The item-level discount applied to the item.
            - `applied_discount_amount` integer — The item-level discount applied to the item.
            - `price` integer — Unit price of an item. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`.
            - `subtotal_amount` integer — Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. `subtotal_amount`=`amount`-`discount_amount`
            - `product` object — This object stores more information about the related product.
              - …
            - `sku` object — This object stores more information about the related SKU.
              - …
          - `metadata` object — The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format.
          - `customer` object — Object containing information about the customer that is making the purchase.
            - `id` string — Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
            - `object` string — Type of object represented by the `customer` object.
          - `referrer` object — Object containing information about the referrer.
            - `id` string — Unique referrer ID, who referred the customer making the purchase.
            - `object` string — Type of object represented by the `referrer` object.
          - `customer_id` string — Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
          - `referrer_id` string — Unique referrer ID.
          - `object` string — The type of the object represented by JSON. This object stores information about the `order`.
      - `code` string — Voucher code.
      - `gift` object — Contains current gift card balance information.
        - `amount` integer — 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`.
        - `balance` integer — Available funds. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`.
        - `effect` 'APPLY_TO_ORDER' | 'APPLY_TO_ITEMS' — Defines how the credits are applied to the customer's order.
      - `metadata` object — 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.
      - `start_date` string, date-time — Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is _inactive_ before this date.
      - `expiration_date` string, date-time — Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is _inactive_ after this date.
      - `campaign` string — Voucher's parent campaign name.
      - `campaign_id` string — Voucher's parent campaign's unique ID.
      - `session` 6ResSessionLockGiftCard — 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.
        - `type` string — This session locks the redemption **quantity** by 1 and the redemption **gift credits** specified within the request.
        - `key` string — The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.
        - `ttl_unit` 'HOURS' | 'DAYS' | 'MINUTES' | 'SECONDS' | 'MILLISECONDS' | 'MICROSECONDS' | 'NANOSECONDS' — Defines the type of unit in which the session time is counted.
        - `ttl` integer — Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter.
    - 6ResValidateVoucherLoyaltyCard — Response schema model for validating a loyalty card using **POST** `v1/vouchers/{code}/validate`.
      - `valid` boolean — Indicates whether the voucher is valid within the context of the parameters provided in the request body.
      - `applicable_to` 6ResApplicableToObject — 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.
        - `data` union[] — Contains array of items to which the discount can apply.
          - union
            - 6ResProductCollection — Contains definition for a product collection.
              - …
            - 6ResProductCollectionUnit — Contains definition for a product collection.
              - …
            - 6ResProductCollectionFixedAmount — Contains definition for a product collection.
              - …
            - 6ResProduct — Contains definition for a product.
              - …
            - 6ResProductUnit — Contains definition for a product.
              - …
            - 6ResProductFixedAmount — Contains definition for a product.
              - …
            - 6ResSku — Contains definition for a product variant.
              - …
            - 6ResSkuUnit — Contains definition for a product variant.
              - …
            - 6ResSkuUnitFixedAmount — Contains definition for a product variant.
              - …
        - `total` integer — Total number of objects defining included products, SKUs, or product collections.
        - `data_ref` string — Identifies the name of the attribute that contains the array of included objects.
        - `object` string — The type of the object represented by JSON. This object stores information about included products, SKUs, or product collections in a dictionary.
      - `inapplicable_to` 6ResInapplicableToObject — 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.
        - `data` union[] — Contains array of items to which the discount cannot apply.
          - union
            - 6ResProductCollectionExcluded — Contains definition for a product collection.
              - …
            - 6ResProductExcluded — Contains definition for a product.
              - …
            - 6ResSkuExcluded — Contains definition for a product variant.
              - …
        - `total` integer — Total number of objects defining excluded products, SKUs, or product collections.
        - `data_ref` string — Identifies the name of the attribute that contains the array of excluded objects.
        - `object` string — The type of the object represented by JSON. This object stores information about excluded products, SKUs, or product collections in a dictionary.
      - `tracking_id` string — Hashed customer source ID.
      - `order` 6ObjOrderObjectApplyToOrder — This is an object representing an order with calculated discounts applied using the voucher code.
        - `id` string — Unique order ID, assigned by Voucherify. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
        - `source_id` string — The merchant's order ID if it is different from the Voucherify order ID. It is really useful in case of integration between multiple systems. It can be an order ID from CRM, database or 3rd party service. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
        - `created_at` string, date-time — Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
        - `updated_at` string, date-time — Timestamp representing the date and time when the order was updated. The value is shown in the ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body.
        - `status` 'CREATED' | 'PAID' | 'CANCELED' | 'FULFILLED' — Order status. This parameter is returned if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body or if you send the request body parameter when defining an order in the request body. This parameter can be passed but it's not required for validation at all. It's used in the redemption process. Normally after the redemption is done, the order is automatically to a `PAID` status. To avoid such default behaviour, the user can pass any of the other status options and it will be set the order status after the redemption instead of the default `PAID`.
        - `amount` integer — Order amount before applying any discount.
        - `discount_amount` integer — Sum of all order-level discounts applied to the order.
        - `total_discount_amount` integer — Sum of all order-level discounts.
        - `total_amount` integer — Order amount after applying all the discounts. `total_amount` = `amount` - `total_discount_amount`
        - `applied_discount_amount` integer — This field shows the order-level discount applied.
        - `total_applied_discount_amount` integer — This field sums up all order-level discounts applied to the order.
        - `items` object[] — Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.
          - `object` string — The type of the object represented by JSON. This object stores information about the `order_item`.
          - `product_id` string — A unique identifier that represents the product and is assigned by Voucherify.
          - `sku_id` string — A unique identifier that represents the SKU and is assigned by Voucherify.
          - `quantity` integer — Quantity of the item in the cart.
          - `amount` integer — Represents a total pre-discount amount of order item (`price` * `quantity`).
          - `price` integer — Unit price of an item. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`.
          - `subtotal_amount` integer — Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. `subtotal_amount`=`amount`-`discount_amount`
          - `product` object — This object stores more information about the related product.
            - `id` string — A unique identifier that represents the product and is assigned by Voucherify.
            - `source_id` string — A unique product identifier from your inventory system.
            - `name` string — Product name.
            - `price` integer — Unit price of a product. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`.
          - `sku` object — This object stores more information about the related SKU.
            - `id` string — A unique identifier that represents the SKU and is assigned by Voucherify.
            - `source_id` string — A unique SKU identifier from your inventory system.
            - `sku` string — SKU name.
            - `price` integer — Unit price of a SKU. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`.
        - `metadata` object — The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format.
        - `customer` object — Object containing information about the customer that is making the purchase.
          - `id` string — Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
          - `object` string — Type of object represented by the `customer` object.
        - `referrer` object — Object containing information about the referrer.
          - `id` string — Unique referrer ID, who referred the customer making the purchase.
          - `object` string — Type of object represented by the `referrer` object.
        - `customer_id` string — Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.
        - `referrer_id` string — Unique referrer ID.
        - `object` string — The type of the object represented by JSON. This object stores information about the `order`.
      - `code` string — Voucher code.
      - `loyalty` object — Contains the cost of reward in points.
        - `points_cost` integer — Number of points that wlil be deducted from loyaty card for the associated reward.
      - `reward` object — Contains information about the reward that is being validated.
        - `id` string — Unique reward ID assigned by Voucherify.
        - `assignment_id` string — Unique reward assignment ID assigned by Voucherify.
        - `points` integer — Number of points applied to the reward.
      - `metadata` object — 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.
      - `start_date` string, date-time — Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is _inactive_ before this date.
      - `expiration_date` string, date-time — Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is _inactive_ after this date.
      - `campaign` string — Voucher's parent campaign name.
      - `campaign_id` string — Voucher's parent campaign's unique ID.
      - `session` 6ResSessionLockLoyaltyCard — 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.
        - `type` string — This session locks the redemption **quantity** by 1 and the redemption **loyalty points** specified within the request.
        - `key` string — The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.
        - `ttl_unit` 'HOURS' | 'DAYS' | 'MINUTES' | 'SECONDS' | 'MILLISECONDS' | 'MICROSECONDS' | 'NANOSECONDS' — Defines the type of unit in which the session time is counted.
        - `ttl` integer — Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter.
  - 6ResValidateVoucherFalse — Response schema for a voucher that is not valid.
    - `valid` boolean — Indicates whether the voucher is valid within the context of the parameters provided in the request body.
    - `reason` string — System generated cause for the voucher being invalid in the context of the provided parameters.
    - `error` object — Detailed failure cause for the invalid voucher if the reason has a translation defined in the Dashboard &rarr; Project Settings &rarr; Error Messages.
      - `message` string — Customized error message.
    - `tracking_id` string — Hashed customer source ID.
    - `code` string — Voucher code.
    - `metadata` object — 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.

## Other responses

- `400` — Returns an error if missing required parameters or tracking IDs come from the same origin.

---

[API](https://skmtc.net/voucherifyio/apis/voucherify-api-async-actions.md) · [All operations](https://skmtc.net/voucherifyio/apis/voucherify-api-async-actions/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/voucherifyio/voucherify-api-async-actions/versions/4982266e0494/schema)
