> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voucherify.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Examine Voucher Qualification

> 
> ❗️ Deprecated  
>
> This endpoint represents the deprecated version of the API responsible for qualification, and we do not recommend using it. The new [Qualifications API](/api-reference/qualifications/check-eligibility) 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.

 ## How does this endpoint work? 

 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.

 ## What's excluded? 

 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](/api-reference/campaigns/examine-campaign-qualification) for searching and identifying qualified campaigns.

 ## Customizing the response

> 📘 Query parameters let you sort and filter the returned vouchers
>
> Customize your response:
> - If you only care about verifying a customer, use `audienceRulesOnly` set to `true`. 
>- 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 `order` to customize your response.

 ## Sending the request body payload


 ## Customer

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.
 ### Available options:

 - 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`

 #### Note:

 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](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard. [Read more](/personalize/create-validation-rules). 

## Order

  ### Available options:

 - 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`

 #### Note:

 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](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard. [Read more](/personalize/create-validation-rules).

## Guidelines:

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  <br />- subtotal of matched items |
| **3** |  | `price`<br />`quantity` | 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<br />- Subtotal of matched items<br />- Unit price of any matching order line<br />- Price of each item/Price of any item |
| **4** |  | `amount`  <br />`price`    <br />`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)<br />- Subtotal of matched items (uses item `amount`, takes precedence if all 3 properties are provided)<br />- Unit price of any matching order line<br />- Price of each item/Price of any item |
| **5** | `amount` | `amount`  <br />`price`  <br />`quantity` | Order-level  | Uses order-level `amount` for total order `amount` | - Total order amount (uses order-level `amount`). <br />- Subtotal of matched items (see case **4** for details). <br />- Unit price of any matching order line  <br />- Price of each item/Price of any item |



## OpenAPI

````yaml /openapi/vouchers.json post /v1/vouchers/qualification
openapi: 3.0.1
info:
  title: Voucherify API - Vouchers
  version: v2018-08-01
  description: >-
    Voucherify promotion engine REST API. Please see
    https://docs.voucherify.io/docs for more details.
  contact:
    name: Voucherify Team
    url: https://www.voucherify.io/contact-support
    email: support@voucherify.io
  termsOfService: https://www.voucherify.io/legal/subscription-agreement
  license:
    name: MIT
    url: https://github.com/voucherifyio/voucherify-js-sdk/blob/main/LICENSE
servers:
  - url: https://{cluster}.voucherify.io
    description: Base URL
    variables:
      cluster:
        default: api
        enum:
          - api
          - us1.api
          - as1.api
          - download
          - us1.download
          - as1.download
security: []
paths:
  /v1/vouchers/qualification:
    post:
      tags:
        - Vouchers
      summary: Examine Voucher Qualification
      description: >-

        > ❗️ Deprecated  

        >

        > This endpoint represents the deprecated version of the API responsible
        for qualification, and we do not recommend using it. The new
        [Qualifications API](/api-reference/qualifications/check-eligibility)
        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.

         ## How does this endpoint work? 

         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.

         ## What's excluded? 

         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](/api-reference/campaigns/examine-campaign-qualification) for searching and identifying qualified campaigns.

         ## Customizing the response

        > 📘 Query parameters let you sort and filter the returned vouchers

        >

        > Customize your response:

        > - If you only care about verifying a customer, use `audienceRulesOnly`
        set to `true`. 

        >- 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 `order` to customize your response.

         ## Sending the request body payload


         ## Customer

        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.
         ### Available options:

         - 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`

         #### Note:

         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](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard. [Read more](/personalize/create-validation-rules). 

        ## Order

          ### Available options:

         - 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`

         #### Note:

         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](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard. [Read more](/personalize/create-validation-rules).

        ## Guidelines:


        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  <br />- subtotal of matched items |

        | **3** |  | `price`<br />`quantity` | 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<br
        />- Subtotal of matched items<br />- Unit price of any matching order
        line<br />- Price of each item/Price of any item |

        | **4** |  | `amount`  <br />`price`    <br />`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)<br />- Subtotal of matched items
        (uses item `amount`, takes precedence if all 3 properties are
        provided)<br />- Unit price of any matching order line<br />- Price of
        each item/Price of any item |

        | **5** | `amount` | `amount`  <br />`price`  <br />`quantity` |
        Order-level  | Uses order-level `amount` for total order `amount` | -
        Total order amount (uses order-level `amount`). <br />- Subtotal of
        matched items (see case **4** for details). <br />- Unit price of any
        matching order line  <br />- Price of each item/Price of any item |
      operationId: examine-vouchers-qualification
      parameters:
        - $ref: '#/components/parameters/audienceRulesOnly'
        - schema:
            $ref: '#/components/schemas/ParameterLimitExamineVouchersQualification'
          in: query
          name: limit
          description: The number of vouchers to be qualified.
        - schema:
            $ref: '#/components/schemas/ParameterOrderExamineVouchersQualification'
          in: query
          name: order
          description: >-
            Sorts the results using one of the filtering options, where the dash
            `-` means sorting in a descending order.
      requestBody:
        required: true
        description: Should contain given customer and context such as an order.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/1_req_vouchers_qualification'
            examples:
              Example:
                value:
                  customer:
                    source_id: source-id
                    metadata:
                      key: value
                  order:
                    amount: 10000
                    items:
                      - product_id: product-id
                        quantity: '1'
                        price: 10000
                        related_object: product
                        product:
                          metadata:
                            key: value
                  metadata:
                    key: value
              Qualify product using product_id:
                value:
                  customer:
                    id: cust_J1CDUdbqn5Exva8ASWk1Fq0j
                    source_id: firstname.lastname@mycompany.com
                    name: FirstName LastName
                    email: firstname.lastname@mycompany.com
                    phone: string
                    address:
                      city: New York
                      country: United States of America
                      postal_code: '10001'
                      state: NY
                    metadata: {}
                    birthdate: YYYY-MM-DD
                  order:
                    id: ord_gqj1QYW2j2A1E3Ula2YjdPf4
                    source_id: string
                    amount: 10000
                    items:
                      - source_id: product_1234
                        product_id: prod_0a9f9aeddb019a42db
                        amount: 10000
                        quantity: 1
                        price: 10000
                        metadata: {}
                        related_object: product
                        product:
                          source_id: product_1234
                          name: Phone
                          price: 10000
                          metadata: {}
                    customer:
                      id: cust_J1CDUdbqn5Exva8ASWk1Fq0j
                      source_id: firstname.lastname@mycompany.com
                      name: FirstName LastName
                      email: firstname.lastname@mycompany.com
                      phone: string
                      address:
                        city: New York
                        country: United States of America
                        postal_code: '10001'
                        state: NY
                      metadata: {}
                      birthdate: YYYY-MM-DD
                    referrer: {}
                    metadata: string
                  reward:
                    points: 0
                    assignment_id: string
                    id: string
                  metadata: {}
              Qualify product using source_id:
                value:
                  customer:
                    id: cust_J1CDUdbqn5Exva8ASWk1Fq0j
                    source_id: firstname.lastname@mycompany.com
                    name: FirstName LastName
                    email: firstname.lastname@mycompany.com
                    phone: string
                    address:
                      city: New York
                      country: United States of America
                      postal_code: '10001'
                      state: NY
                    metadata: {}
                    birthdate: YYYY-MM-DD
                  order:
                    id: ord_gqj1QYW2j2A1E3Ula2YjdPf4
                    source_id: string
                    amount: 10000
                    items:
                      - source_id: product_1234
                        product_id: prod_0a9f9aeddb019a42db
                        amount: 10000
                        quantity: 1
                        price: 10000
                        metadata: {}
                        related_object: product
                        product:
                          source_id: product_1234
                          name: Phone
                          price: 10000
                          metadata: {}
                    customer:
                      id: cust_J1CDUdbqn5Exva8ASWk1Fq0j
                      source_id: firstname.lastname@mycompany.com
                      name: FirstName LastName
                      email: firstname.lastname@mycompany.com
                      phone: string
                      address:
                        city: New York
                        country: United States of America
                        postal_code: '10001'
                        state: NY
                      metadata: {}
                      birthdate: YYYY-MM-DD
                    referrer: {}
                    metadata: string
                  reward:
                    points: 0
                    assignment_id: string
                    id: string
                  metadata: {}
              Qualify SKU using sku_id:
                value:
                  customer:
                    id: cust_J1CDUdbqn5Exva8ASWk1Fq0j
                    source_id: firstname.lastname@mycompany.com
                    name: FirstName LastName
                    email: firstname.lastname@mycompany.com
                    phone: string
                    address:
                      city: New York
                      country: United States of America
                      postal_code: '10001'
                      state: NY
                    metadata: {}
                    birthdate: YYYY-MM-DD
                  order:
                    id: ord_gqj1QYW2j2A1E3Ula2YjdPf4
                    source_id: string
                    amount: 10000
                    items:
                      - source_id: product_1234
                        product_id: prod_0a9f9aeddb019a42db
                        amount: 10000
                        quantity: 1
                        price: 10000
                        metadata: {}
                        related_object: product
                        product:
                          source_id: product_1234
                          name: Phone
                          price: 10000
                          metadata: {}
                    customer:
                      id: cust_J1CDUdbqn5Exva8ASWk1Fq0j
                      source_id: firstname.lastname@mycompany.com
                      name: FirstName LastName
                      email: firstname.lastname@mycompany.com
                      phone: string
                      address:
                        city: New York
                        country: United States of America
                        postal_code: '10001'
                        state: NY
                      metadata: {}
                      birthdate: YYYY-MM-DD
                    referrer: {}
                    metadata: string
                  reward:
                    points: 0
                    assignment_id: string
                    id: string
                  metadata: {}
              Qualify SKU using source_id:
                value:
                  customer:
                    id: cust_J1CDUdbqn5Exva8ASWk1Fq0j
                    source_id: firstname.lastname@mycompany.com
                    name: FirstName LastName
                    email: firstname.lastname@mycompany.com
                    phone: string
                    address:
                      city: New York
                      country: United States of America
                      postal_code: '10001'
                      state: NY
                    metadata: {}
                    birthdate: YYYY-MM-DD
                  order:
                    id: ord_gqj1QYW2j2A1E3Ula2YjdPf4
                    source_id: string
                    amount: 10000
                    items:
                      - source_id: product_1234
                        product_id: prod_0a9f9aeddb019a42db
                        amount: 10000
                        quantity: 1
                        price: 10000
                        metadata: {}
                        related_object: product
                        product:
                          source_id: product_1234
                          name: Phone
                          price: 10000
                          metadata: {}
                    customer:
                      id: cust_J1CDUdbqn5Exva8ASWk1Fq0j
                      source_id: firstname.lastname@mycompany.com
                      name: FirstName LastName
                      email: firstname.lastname@mycompany.com
                      phone: string
                      address:
                        city: New York
                        country: United States of America
                        postal_code: '10001'
                        state: NY
                      metadata: {}
                      birthdate: YYYY-MM-DD
                    referrer: {}
                    metadata: string
                  reward:
                    points: 0
                    assignment_id: string
                    id: string
                  metadata: {}
              Qualify redemption metadata:
                value:
                  customer:
                    id: cust_J1CDUdbqn5Exva8ASWk1Fq0j
                    source_id: firstname.lastname@mycompany.com
                    name: FirstName LastName
                    email: firstname.lastname@mycompany.com
                    phone: string
                    address:
                      city: New York
                      country: United States of America
                      postal_code: '10001'
                      state: NY
                    metadata: {}
                    birthdate: YYYY-MM-DD
                  order:
                    id: ord_gqj1QYW2j2A1E3Ula2YjdPf4
                    source_id: string
                    amount: 10000
                    items:
                      - source_id: product_1234
                        product_id: prod_0a9f9aeddb019a42db
                        amount: 10000
                        quantity: 1
                        price: 10000
                        metadata: {}
                        related_object: product
                        product:
                          source_id: product_1234
                          name: Phone
                          price: 10000
                          metadata: {}
                    customer:
                      id: cust_J1CDUdbqn5Exva8ASWk1Fq0j
                      source_id: firstname.lastname@mycompany.com
                      name: FirstName LastName
                      email: firstname.lastname@mycompany.com
                      phone: string
                      address:
                        city: New York
                        country: United States of America
                        postal_code: '10001'
                        state: NY
                      metadata: {}
                      birthdate: YYYY-MM-DD
                    referrer: {}
                    metadata: string
                  reward:
                    points: 0
                    assignment_id: string
                    id: string
                  metadata: {}
              Qualify order line item metadata:
                value:
                  customer:
                    id: cust_J1CDUdbqn5Exva8ASWk1Fq0j
                    source_id: firstname.lastname@mycompany.com
                    name: FirstName LastName
                    email: firstname.lastname@mycompany.com
                    phone: string
                    address:
                      city: New York
                      country: United States of America
                      postal_code: '10001'
                      state: NY
                    metadata: {}
                    birthdate: YYYY-MM-DD
                  order:
                    id: ord_gqj1QYW2j2A1E3Ula2YjdPf4
                    source_id: string
                    amount: 10000
                    items:
                      - source_id: product_1234
                        product_id: prod_0a9f9aeddb019a42db
                        amount: 10000
                        quantity: 1
                        price: 10000
                        metadata: {}
                        related_object: product
                        product:
                          source_id: product_1234
                          name: Phone
                          price: 10000
                          metadata: {}
                    customer:
                      id: cust_J1CDUdbqn5Exva8ASWk1Fq0j
                      source_id: firstname.lastname@mycompany.com
                      name: FirstName LastName
                      email: firstname.lastname@mycompany.com
                      phone: string
                      address:
                        city: New York
                        country: United States of America
                        postal_code: '10001'
                        state: NY
                      metadata: {}
                      birthdate: YYYY-MM-DD
                    referrer: {}
                    metadata: string
                  reward:
                    points: 0
                    assignment_id: string
                    id: string
                  metadata: {}
      responses:
        '200':
          description: >-
            This operation returns the list of valid and active vouchers based
            on the qualification of given context (e.g., customer profile,
            redemptions metadata, order).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/1_res_vouchers_qualification'
      deprecated: true
      security:
        - X-App-Id: []
          X-App-Token: []
        - X-Voucherify-OAuth:
            - api
            - vouchers
components:
  parameters:
    audienceRulesOnly:
      name: audienceRulesOnly
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/ParameterBoolean'
      description: >-
        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.
  schemas:
    ParameterLimitExamineVouchersQualification:
      type: integer
      maximum: 50
      minimum: 1
    ParameterOrderExamineVouchersQualification:
      type: string
      enum:
        - created_at
        - '-created_at'
        - updated_at
        - '-updated_at'
        - code
        - '-code'
    1_req_vouchers_qualification:
      title: Vouchers Qualification Request Body
      type: object
      description: Request body schema for /vouchers/qualification.
      properties:
        customer:
          $ref: '#/components/schemas/1_req_obj_vouchers_qualification_customer'
        order:
          type: object
          description: >-
            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](/api-reference/validation-rules/create-validation-rules)
            endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr;
            _Order structure/Order volume_ or _Basic Builder_ &rarr; _Order_.
            [Read more](/personalize/create-validation-rules).
          properties:
            id:
              type: string
              description: >-
                The ID of an existing order in Voucherify's system that will be
                linked to the redemption of this request. This ID was assigned
                by the Voucherify API. You can send the order id in the request
                body to check against vouchers requiring specific order
                validation rules to be satisfied.
              example: ord_gqj1QYW2j2A1E3Ula2YjdPf4
            source_id:
              type: string
              description: >-
                The merchant's order ID if it is different from the Voucherify
                order ID. It is really useful in case of an integration between
                multiple systems. It can be an order ID from a CRM system,
                database or 3rd-party service.
            amount:
              type: integer
              minimum: 0
              description: >-
                Pre-discount order amount represents the total amount of order
                items' amounts (sum of each item's `amount` property). You can
                send the total order amount or the amount of each item
                individually in the request body to check against vouchers
                requiring specific total order amount validation rules to be
                satisfied. The qualification runs against rules that are defined
                through the [Create Validation
                Rules](/api-reference/validation-rules/create-validation-rules)
                endpoint or via the Dashboard; in the _Advanced Rule Builder_
                &rarr; _Order volume_ &rarr; _Total amount_ 


                The value is multiplied by 100 to represent 2 decimal places.
                For example `10000 cents` for `$100.00`.
              example: 10000
            items:
              type: array
              description: >-
                List of Order Items constituting the order. Order items can be
                defined either by `product_id` or `sku_id`. For every item, you
                must define the quantity.
              items:
                oneOf:
                  - $ref: >-
                      #/components/schemas/1_req_obj_vouchers_qualification_product
                  - $ref: '#/components/schemas/1_req_obj_vouchers_qualification_sku'
                  - $ref: >-
                      #/components/schemas/1_req_obj_vouchers_qualification_product_using_product_id
                  - $ref: >-
                      #/components/schemas/1_req_obj_vouchers_qualification_product_using_source_id
            customer:
              $ref: '#/components/schemas/1_req_obj_vouchers_qualification_customer'
            referrer:
              description: The person who referred the customer to make the order.
              type: object
            metadata:
              type: object
              description: >-
                A set of key/value pairs that you can send in the request body
                to check against vouchers requiring **order** metadata
                validation rules to be satisfied. The qualification runs against
                rules that are defined through the [Create Validation
                Rules](/api-reference/validation-rules/create-validation-rules)
                endpoint or via the Dashboard; in the _Advanced Rule Builder_
                &rarr; _Order structure_ &rarr; _Order metadata satisfy_ or
                _Basic Builder_ &rarr; _Attributes match_ &rarr; _ORDER
                METADATA_. [Read more](/personalize/create-validation-rules).
        reward:
          type: object
          properties:
            points:
              type: integer
            assignment_id:
              type: string
            id:
              type: string
        metadata:
          type: object
          description: >-
            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](/api-reference/validation-rules/create-validation-rules)
            endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr;
            _Advanced_ &rarr; _Redemption metadata satisfy_ or _Basic Builder_
            &rarr; _Attributes match_ &rarr; _REDEMPTION METADATA_. [Read
            more](/personalize/create-validation-rules).
    1_res_vouchers_qualification:
      title: Vouchers Qualification Response Body
      type: object
      description: Response body schema for vouchers/qualification
      properties:
        object:
          type: string
          default: list
          description: The type of the object represented by JSON. Default is `list`.
        data_ref:
          type: string
          default: data
          description: >-
            Identifies the name of the attribute that contains the array of
            qualified vouchers.
        data:
          type: array
          description: Array of qualified vouchers.
          items:
            allOf:
              - $ref: '#/components/schemas/Voucher'
              - $ref: >-
                  #/components/schemas/1_res_obj_vouchers_qualification_applicable_to
              - $ref: >-
                  #/components/schemas/1_res_obj_vouchers_qualification_inapplicable_to
        total:
          type: integer
          example: 37
          description: >-
            Total valid and active vouchers matching the qualification criteria
            in given context. 
        id:
          type: string
          example: qfl_nAMVLoxIqSLh9O6YmfoAXRPG
          description: Unique qualification ID.
        created_at:
          type: string
          example: '2022-02-25T13:32:08.734Z'
          description: >-
            Timestamp representing the date and time when the qualification was
            created. The value is shown in the ISO 8601 format.
          format: date-time
        tracking_id:
          type: string
          description: Hashed customer source ID.
    ParameterBoolean:
      type: boolean
    1_req_obj_vouchers_qualification_customer:
      title: Customer Object
      type: object
      description: >-
        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](/api-reference/validation-rules/create-validation-rules) endpoint
        or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Audience_
        &rarr; _Customer segment_ or _Basic Builder_ &rarr; _Customer Activity_.
        [Read more](/personalize/create-validation-rules). 
      properties:
        id:
          type: string
          description: >-
            The ID of an existing customer that will be linked to the redemption
            in this request. This ID was assigned by the Voucherify API.
          example: cust_J1CDUdbqn5Exva8ASWk1Fq0j
        source_id:
          type: string
          description: >-
            A unique customer identifier. This is a tracking identifier of a
            user that is validating a voucher. The `source_id` is built based on
            your internal id (e.g., email, database ID). If you also pass a
            customer ID, the source ID will be ignored. Otherwise, if you do not
            pass a customer ID, the source ID you provide must either be a
            token, like the one returned in the original voucher validation
            method done by a specific customer, or a string identifying the
            customer (e.g., email, database ID, CRM ID).
          example: firstname.lastname@mycompany.com
        name:
          type: string
          description: >-
            First and Last Name. You can send the name in the request body to
            check against vouchers requiring specific name validation rules to
            be satisfied.
          example: FirstName LastName
        email:
          type: string
          description: >-
            You can send the email in the request body to check against vouchers
            requiring specific email validation rules to be satisfied.
          example: firstname.lastname@mycompany.com
        phone:
          type: string
          minLength: 1
          maxLength: 30
          pattern: ^[-+.() 0-9]
          description: >-
            You can send the phone in the request body to check against vouchers
            requiring specific phone validation rules to be satisfied.
        address:
          type: object
          description: >-
            A set of key/value pairs which describes the address. You can send
            the address in the request body to check against vouchers requiring
            specific address validation rules to be satisfied.
          properties:
            city:
              type: string
              description: >-
                You can send the city in the request body to check against
                vouchers requiring specific city validation rules to be
                satisfied.
              example: New York
            country:
              type: string
              description: >-
                You can send the country in the request body to check against
                vouchers requiring specific country validation rules to be
                satisfied.
              example: United States of America
            postal_code:
              type: string
              description: >-
                You can send the postal code in the request body to check
                against vouchers requiring specific postal code validation rules
                to be satisfied.
              example: '10001'
            state:
              type: string
              description: >-
                You can send the state in the request body to check against
                vouchers requiring specific state validation rules to be
                satisfied.
              example: NY
        metadata:
          type: object
          description: >-
            A set of key/value pairs that you can send in the request body to
            check against vouchers requiring **customer** metadata validation
            rules to be satisfied. The qualification runs against rules that are
            defined through the [Create Validation
            Rules](/api-reference/validation-rules/create-validation-rules)
            endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr;
            _Audience_ &rarr; _Customer metadata satisfy_. [Read
            more](/personalize/create-validation-rules).
        birthdate:
          type: string
          example: '2022-01-01'
          format: date
          description: >-
            You can send the birthdate in the request body to check against
            vouchers requiring specific birthdate validation rules to be
            satisfied.
    1_req_obj_vouchers_qualification_product:
      title: Product Item
      type: object
      description: >-
        Schema model for a product item. You can send this object in the request
        body to check against vouchers requiring specific product validation
        rules to be satisfied. The qualification runs against rules that are
        defined through the [Create Validation
        Rules](/api-reference/validation-rules/create-validation-rules) endpoint
        or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order
        structure/Order volume_ or _Basic Builder_ &rarr; _Order_. [Read
        more](/personalize/create-validation-rules).
      properties:
        source_id:
          type: string
          description: >-
            A unique product identifier from your inventory system. __Requires__
            the `related_object` property to be defined. 

             The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order Structure_ &rarr; _Every order item/Any order item/None of the order items_ &rarr; _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](/personalize/validation-rules-reference).
          example: product_1234
        product_id:
          type: string
          description: >-
            A unique identifier that represents the product and is assigned by
            Voucherify.
          example: prod_0a9f9aeddb019a42db
        amount:
          type: integer
          description: >-
            Represents a total pre-discount amount of order item (`price` *
            `quantity`). You can send the total item amount to check against
            vouchers requiring specific order amount validation rules to be
            satisfied.

             The qualification runs against rules that are defined through the [Create Validation Rules](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order volume_ &rarr; _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ &rarr; _Order structure_ &rarr; _Every order item/Any order item_ &rarr; _Subtotal of matched items_.  

            The value is multiplied by 100 to represent 2 decimal places. For
            example `10000 cents` for `$100.00`.
          example: 10000
        quantity:
          type: integer
          description: >-
            Quantity of the item in the cart. 


            The qualification runs against rules that are defined through the
            [Create Validation
            Rules](/api-reference/validation-rules/create-validation-rules)
            endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr;
            _Order Volume_ &rarr; _Items quantity_. The qualification adds the
            individual quantities of the items and checks whether the sum meets
            the limits set by _Items quantity_ validation rule. Another
            validation rule against which the qualification does the checks is
            defined in the _Advanced Rule Builder_ &rarr; _Order Structure_
            &rarr; _Every order item/Any order item_ &rarr; _Quantity of matched
            items_. [Read more](/personalize/validation-rules-reference).
          example: 1
        price:
          type: integer
          description: >-
            Unit price of an item. [This is not true in the case of using
            sourceid what was the case that this happened.]This `price` property
            takes precedence. If you provide a value at this level, then a price
            property defined once again in the `related_object` will be ignored.
            If this property will not be defined here, then the `price` property
            in the `related_object` will be used in the qualification.

             The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order Structure_ &rarr; _Every order item/Any order item_ &rarr; _Unit Price of any matching order line_ and also _Order Volume_ &rarr; _Price of each item/Price of any item_. [Read more](/personalize/validation-rules-reference).

             The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`.
          example: 10000
        metadata:
          type: object
          description: >-
            A set of key/value pairs that you can send in the request body to
            check against vouchers requiring **order line item** metadata
            validation rules to be satisfied.

             The qualification runs against rules that are defined through the [Create Validation Rules](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order structure_ &rarr; _Every order item/Any order item_ &rarr; _Metadata of matched items_. [Read more](/personalize/create-validation-rules).
        related_object:
          type: string
          default: product
          enum:
            - product
          description: >-
            A reference to the object containing details of the related product.
            __Required__ when sending `source_id` in payload.
        product:
          type: object
          description: >-
            An object containing details of the related product. __Required__
            when sending `source_id` in payload. These details will be used for
            qualification on top of details already stored in the system.
          properties:
            source_id:
              type: string
              description: A unique product identifier from your inventory system.
              example: product_1234
            name:
              type: string
              description: |-
                Product name.

                 The qualification runs against rules that are defined through the [Create Validation Rules](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order structure_ &rarr; _Every order item/Any order item/None of the order items_ &rarr; _Select a product collection or create a new product collection based on name filters_.
              example: Phone
            price:
              type: integer
              description: >-
                Unit price of an item. The value is multiplied by 100 to
                represent 2 decimal places. For example `10000 cents` for
                `$100.00`.
              example: 10000
            metadata:
              type: object
              description: >-
                A set of key/value pairs that you can send in the request body
                to check against vouchers requiring **product** metadata
                validation rules to be satisfied.

                 The qualification runs against rules that are defined through the [Create Validation Rules](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order structure_ &rarr; _Every order item/Any order item/None of the order items_ &rarr; _Select a product collection or create a new product collection based on metadata filters_. [Read more](/personalize/create-validation-rules).
    1_req_obj_vouchers_qualification_sku:
      title: SKU Item
      type: object
      description: Schema model for a SKU item.
      properties:
        source_id:
          type: string
          description: >-
            A unique sku identifier from your inventory system. __Requires__ the
            `related_object` property to be defined. 

             The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order Structure_ &rarr; _Every order item/Any order item/None of the order items_ &rarr; _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](/personalize/validation-rules-reference).
          example: product_1234
        sku_id:
          type: string
          example: sku_0a41e31c7b41c28358
          description: >-
            A unique identifier that represents the SKU and is assigned by
            Voucherify.
        amount:
          type: integer
          description: >-
            Represents a total amount of order item (price * quantity).


            You should provide it to retrieve `discount_amount` if the discount
            is applied only to this item.[I'm not sure what this means here,
            it's from the original docs]
          example: 10000
        quantity:
          type: integer
          description: >-
            Quantity of the item in the cart. The qualification runs against
            rules that are defined through the Create Validation Rules endpoint
            or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order
            Volume_ &rarr; _Items quantity_. The qualification adds the
            individual quantities of the items and checks whether the sum meets
            the limits set by _Items quantity_ validation rule. [Read
            more](/personalize/validation-rules-reference).
          example: 1
        related_object:
          type: string
          enum:
            - product
            - sku
          description: >-
            A reference to the object containing details of the related
            product/sku. __Required__ when sending `source_id` in payload.
        product:
          type: object
          description: >-
            An object containing details of the related product. __Required__
            when sending `source_id` in payload. These details will be used for
            qualification on top of details already stored in the system.
          properties:
            source_id:
              type: string
              description: A unique product identifier from your inventory system.
              example: product_1234
            name:
              type: string
              description: Product name.
              example: Phone
            price:
              type: integer
              description: >-
                Unit price of an item. The value is multiplied by 100 to
                represent 2 decimal places. For example `10000 cents` for
                `$100.00`.
              example: 10000
            metadata:
              type: object
              description: >-
                A set of key/value pairs that you can send in the request body
                to check against vouchers requiring **product** metadata
                validation rules to be satisfied.

                 The qualification runs against rules that are defined through the [Create Validation Rules](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order structure_ &rarr; _Every order item/Any order item/None of the order items_ &rarr; _Select a product collection or create a new product collection based on metadata filters_. [Read more](/personalize/create-validation-rules).
        sku:
          type: object
          description: >-
            An object containing details of the related SKU. __Required__ when
            sending `source_id` in payload. These details will be used for
            qualification on top of details already stored in the system.
          properties:
            source_id:
              type: string
              description: A unique SKU identifier from your inventory system.
              example: sku_1234
            sku:
              type: string
              description: SKU name.
              example: iPhone 12
            price:
              type: integer
              description: >-
                Unit price of a SKU. The value is multiplied by 100 to represent
                2 decimal places. For example `10000 cents` for `$100.00`.
              example: 10000
            metadata:
              type: object
              description: A set of custom key/value pairs that you can attach to a SKU.
    1_req_obj_vouchers_qualification_product_using_product_id:
      title: Product Item using product_id
      type: object
      description: >-
        Schema model for a product item sent using the `product_id`. 


        You can send this object in the request body to check against vouchers
        requiring specific product validation rules to be satisfied. 

        The qualification runs against rules that are defined through the
        [Create Validation
        Rules](/api-reference/validation-rules/create-validation-rules) endpoint
        or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order
        structure/Order volume_ or _Basic Builder_ &rarr; _Order_. [Read
        more](/personalize/create-validation-rules).
      properties:
        product_id:
          type: string
          description: >-
            A unique identifier that represents the product and is assigned by
            Voucherify.
          example: prod_0a9f9aeddb019a42db
        amount:
          type: integer
          description: >-
            Represents a total pre-discount amount of order item (`price` *
            `quantity`). You can send the total item amount to check against
            vouchers requiring specific order amount validation rules to be
            satisfied.

             The qualification runs against rules that are defined through the [Create Validation Rules](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order volume_ &rarr; _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ &rarr; _Order structure_ &rarr; _Every order item/Any order item_ &rarr; _Subtotal of matched items_.  

            The value is multiplied by 100 to represent 2 decimal places. For
            example `10000 cents` for `$100.00`.
          example: 10000
        quantity:
          type: integer
          description: >-
            Quantity of the item in the cart. 


            The qualification runs against rules that are defined through the
            [Create Validation
            Rules](/api-reference/validation-rules/create-validation-rules)
            endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr;
            _Order Volume_ &rarr; _Items quantity_. The qualification adds the
            individual quantities of the items and checks whether the sum meets
            the limits set by _Items quantity_ validation rule. Another
            validation rule against which the qualification does the checks is
            defined in the _Advanced Rule Builder_ &rarr; _Order Structure_
            &rarr; _Every order item/Any order item_ &rarr; _Quantity of matched
            items_. [Read more](/personalize/validation-rules-reference).
          example: 1
        price:
          type: integer
          description: >-
            Unit price of an item. [This is not true in the case of using
            sourceid what was the case that this happened.]This `price` property
            takes precedence. If you provide a value at this level, then a price
            property defined once again in the `related_object` will be ignored.
            If this property will not be defined here, then the `price` property
            in the `related_object` will be used in the qualification.

             The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order Structure_ &rarr; _Every order item/Any order item_ &rarr; _Unit Price of any matching order line_ and also _Order Volume_ &rarr; _Price of each item/Price of any item_. Even if this price is explicitly provided, it will not override the `price` when running qualifications against _Advanced Rule Builder_ &rarr; _Order structure_ &rarr; _Every order item/Any order item/None of the order items_ &rarr; _Select/create a product collection filtered by a Price_.   [Read more](/personalize/validation-rules-reference).

             The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`.
          example: 10000
        metadata:
          type: object
          description: >-
            A set of key/value pairs that you can send in the request body to
            check against vouchers requiring **order line item** metadata
            validation rules to be satisfied.

             The qualification runs against rules that are defined through the [Create Validation Rules](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order structure_ &rarr; _Every order item/Any order item_ &rarr; _Metadata of matched items_. [Read more](/personalize/create-validation-rules).
        product:
          type: object
          description: >-
            An object containing details of the related product. These details
            will be used for qualification on top of details already stored in
            the system.
          properties:
            name:
              type: string
              description: |-
                Product name.

                 The qualification runs against rules that are defined through the [Create Validation Rules](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order structure_ &rarr; _Every order item/Any order item/None of the order items_ &rarr; _Select a product collection or create a new product collection based on name filters_.
              example: Phone
            price:
              type: integer
              description: >-
                Unit price of an item. The value is multiplied by 100 to
                represent 2 decimal places. For example `10000 cents` for
                `$100.00`.
              example: 10000
            metadata:
              type: object
              description: >-
                A set of key/value pairs that you can send in the request body
                to check against vouchers requiring **product** metadata
                validation rules to be satisfied.

                 The qualification runs against rules that are defined through the [Create Validation Rules](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order structure_ &rarr; _Every order item/Any order item/None of the order items_ &rarr; _Select a product collection or create a new product collection based on metadata filters_. [Read more](/personalize/create-validation-rules).
    1_req_obj_vouchers_qualification_product_using_source_id:
      title: Product Item using source_id
      type: object
      description: >-
        Schema model for a product item. You can send this object in the request
        body to check against vouchers requiring specific product validation
        rules to be satisfied. The qualification runs against rules that are
        defined through the [Create Validation
        Rules](/api-reference/validation-rules/create-validation-rules) endpoint
        or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order
        structure/Order volume_ or _Basic Builder_ &rarr; _Order_. [Read
        more](/personalize/create-validation-rules).
      properties:
        source_id:
          type: string
          description: >-
            A unique product identifier from your inventory system. __Requires__
            the `related_object` property to be defined. 

             The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order Structure_ &rarr; _Every order item/Any order item/None of the order items_ &rarr; _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](/personalize/validation-rules-reference).
          example: product_1234
        amount:
          type: integer
          description: >-
            Represents a total pre-discount amount of order item (`price` *
            `quantity`). You can send the total item amount to check against
            vouchers requiring specific order amount validation rules to be
            satisfied.

             The qualification runs against rules that are defined through the [Create Validation Rules](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order volume_ &rarr; _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ &rarr; _Order structure_ &rarr; _Every order item/Any order item_ &rarr; _Subtotal of matched items_.  

            The value is multiplied by 100 to represent 2 decimal places. For
            example `10000 cents` for `$100.00`.
          example: 10000
        quantity:
          type: integer
          description: >-
            Quantity of the item in the cart. 


            The qualification runs against rules that are defined through the
            [Create Validation
            Rules](/api-reference/validation-rules/create-validation-rules)
            endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr;
            _Order Volume_ &rarr; _Items quantity_. The qualification adds the
            individual quantities of the items and checks whether the sum meets
            the limits set by _Items quantity_ validation rule. Another
            validation rule against which the qualification does the checks is
            defined in the _Advanced Rule Builder_ &rarr; _Order Structure_
            &rarr; _Every order item/Any order item_ &rarr; _Quantity of matched
            items_. [Read more](/personalize/validation-rules-reference).
          example: 1
        price:
          type: integer
          description: >-
            Unit price of an item. [This is not true in the case of using
            sourceid what was the case that this happened.]This `price` property
            takes precedence. If you provide a value at this level, then a price
            property defined once again in the `related_object` will be ignored.
            If this property will not be defined here, then the `price` property
            in the `related_object` will be used in the qualification.

             The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order Structure_ &rarr; _Every order item/Any order item_ &rarr; _Unit Price of any matching order line_ and also _Order Volume_ &rarr; _Price of each item/Price of any item_. [Read more](/personalize/validation-rules-reference).

             The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`.
          example: 10000
        metadata:
          type: object
          description: >-
            A set of key/value pairs that you can send in the request body to
            check against vouchers requiring **order line item** metadata
            validation rules to be satisfied.

             The qualification runs against rules that are defined through the [Create Validation Rules](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order structure_ &rarr; _Every order item/Any order item_ &rarr; _Metadata of matched items_. [Read more](/personalize/create-validation-rules).
        related_object:
          type: string
          default: product
          enum:
            - product
          description: >-
            A reference to the object containing details of the related product.
            __Required__ when sending `source_id` in payload.
        product:
          type: object
          description: >-
            An object containing details of the related product. __Required__
            when sending `source_id` in payload. These details will be used for
            qualification on top of details already stored in the system.
          properties:
            source_id:
              type: string
              description: A unique product identifier from your inventory system.
              example: product_1234
            name:
              type: string
              description: |-
                Product name.

                 The qualification runs against rules that are defined through the [Create Validation Rules](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order structure_ &rarr; _Every order item/Any order item/None of the order items_ &rarr; _Select a product collection or create a new product collection based on name filters_.
              example: Phone
            price:
              type: integer
              description: >-
                Unit price of an item. The value is multiplied by 100 to
                represent 2 decimal places. For example `10000 cents` for
                `$100.00`.
              example: 10000
            metadata:
              type: object
              description: >-
                A set of key/value pairs that you can send in the request body
                to check against vouchers requiring **product** metadata
                validation rules to be satisfied.

                 The qualification runs against rules that are defined through the [Create Validation Rules](/api-reference/validation-rules/create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr; _Order structure_ &rarr; _Every order item/Any order item/None of the order items_ &rarr; _Select a product collection or create a new product collection based on metadata filters_. [Read more](/personalize/create-validation-rules).
      required:
        - source_id
        - related_object
    Voucher:
      title: Voucher
      description: >-
        This is an object representing a voucher with categories and validation
        rules assignments.
      allOf:
        - $ref: '#/components/schemas/VoucherBase'
        - type: object
          properties:
            categories:
              type: array
              description: Contains details about the category.
              items:
                $ref: '#/components/schemas/Category'
            validation_rules_assignments:
              $ref: '#/components/schemas/ValidationRulesAssignmentsList'
    1_res_obj_vouchers_qualification_applicable_to:
      title: ApplicableToObject
      type: object
      description: ''
      properties:
        applicable_to:
          $ref: '#/components/schemas/6_res_applicable_to_object'
    1_res_obj_vouchers_qualification_inapplicable_to:
      title: InapplicableToObject
      type: object
      properties:
        inapplicable_to:
          $ref: '#/components/schemas/6_res_inapplicable_to_object'
    VoucherBase:
      title: Voucher Base
      description: This is an object representing a voucher.
      type: object
      properties:
        id:
          type: string
          example: v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV
          description: Assigned by the Voucherify API, identifies the voucher.
        code:
          type: string
          example: WVPblOYX
          description: >-
            A code that identifies a voucher. Pattern can use all letters of the
            English alphabet, Arabic numerals, and special characters.
        campaign:
          type: string
          example: Gift Card Campaign
          description: A unique campaign name, identifies the voucher's parent campaign.
        campaign_id:
          type: string
          example: camp_FNYR4jhqZBM9xTptxDGgeNBV
          description: >-
            Assigned by the Voucherify API, identifies the voucher's parent
            campaign.
        category:
          type: string
          description: >-
            Tag defining the category that this voucher belongs to. Useful when
            listing vouchers using the List Vouchers endpoint.
        category_id:
          type: string
          description: Unique category ID assigned by Voucherify.
          example: cat_0bb343dee3cdb5ec0c
        type:
          type: string
          enum:
            - GIFT_VOUCHER
            - DISCOUNT_VOUCHER
            - LOYALTY_CARD
          description: 'Defines the type of the voucher. '
        discount:
          $ref: '#/components/schemas/Discount'
        gift:
          type: object
          description: >-
            Object representing gift parameters. Child attributes are present
            only if `type` is `GIFT_VOUCHER`. Defaults to `null`.
          properties:
            amount:
              type: integer
              example: 10000
              description: >-
                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`.
            subtracted_amount:
              type: integer
              description: >-
                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`.
            balance:
              type: integer
              example: 500
              description: >-
                Available funds. The value is multiplied by 100 to represent 2
                decimal places. For example `10000 cents` for `$100.00`.
            effect:
              type: string
              enum:
                - APPLY_TO_ORDER
                - APPLY_TO_ITEMS
              description: Defines how the credits are applied to the customer's order.
        loyalty_card:
          type: object
          description: >-
            Object representing loyalty card parameters. Child attributes are
            present only if `type` is `LOYALTY_CARD`. Defaults to `null`.
          properties:
            points:
              type: integer
              example: 7000
              description: >-
                Total number of points added to the loyalty card over its
                lifespan.
            balance:
              type: integer
              example: 6970
              description: >-
                Points available for reward redemption. This is calculated as
                follows: `balance` = `points` - `expired_points` -
                `subtracted_points` - `redemption.redeemed_points`.
            next_expiration_date:
              type: string
              format: date
              example: '2023-05-30'
              description: >-
                The next closest date when the next set of points are due to
                expire.
            next_expiration_points:
              type: integer
              description: The amount of points that are set to expire next.
            pending_points:
              type: integer
              description: >-
                Shows the number of pending points that will be added to the
                loyalty card when they are activated automatically or manually.
            expired_points:
              type: integer
              description: >-
                Shows the total number of expired points over the lifetime of
                the loyalty card.
            subtracted_points:
              type: integer
              description: >-
                Shows the total number of subtracted points over the lifetime of
                the loyalty card.
        start_date:
          type: string
          example: '2021-12-01T00:00:00.000Z'
          format: date-time
          description: >-
            Activation timestamp defines when the code starts to be active in
            ISO 8601 format. Voucher is *inactive before* this date. 
        expiration_date:
          type: string
          example: '2021-12-31T00:00:00.000Z'
          format: date-time
          description: >-
            Expiration timestamp defines when the code expires in ISO 8601
            format.  Voucher is *inactive after* this date.
        validity_timeframe:
          $ref: '#/components/schemas/ValidityTimeframe'
        validity_day_of_week:
          $ref: '#/components/schemas/ValidityDayOfWeek'
        validity_hours:
          $ref: '#/components/schemas/ValidityHours'
        active:
          type: boolean
          nullable: true
          description: >-
            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* voucher

            - `false` indicates an *inactive* voucher
        additional_info:
          type: string
          description: >-
            An optional field to keep any extra textual information about the
            code such as a code description and details.
        metadata:
          type: object
          description: >-
            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:
          $ref: '#/components/schemas/VoucherAssets'
        is_referral_code:
          type: boolean
          nullable: true
          description: >-
            Flag indicating whether this voucher is a referral code; `true` for
            campaign type `REFERRAL_PROGRAM`.
        created_at:
          type: string
          example: '2021-12-22T10:13:06.487Z'
          description: >-
            Timestamp representing the date and time when the voucher was
            created. The value is shown in the ISO 8601 format.
          format: date-time
        updated_at:
          type: string
          example: '2021-12-22T10:14:45.316Z'
          format: date-time
          description: >-
            Timestamp representing the date and time when the voucher was last
            updated in ISO 8601 format.
        holder_id:
          type: string
          example: cust_eWgXlBBiY6THFRJwX45Iakv4
          description: >-
            Unique customer identifier of the redeemable holder. It equals to
            the customer ID assigned by Voucherify.
        referrer_id:
          type: string
          description: Unique identifier of the referring person.
          example: cust_Vzck5i8U3OhcEUFY6MKhN9Rv
        object:
          type: string
          description: The type of the object represented by JSON. Default is `voucher`.
          default: voucher
        publish:
          type: object
          description: >-
            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.
          properties:
            object:
              type: string
              default: list
              description: >-
                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.
            count:
              type: integer
              example: 0
              description: Publication events counter.
            url:
              type: string
              example: /v1/vouchers/WVPblOYX/publications?page=1&limit=10
              description: >-
                The endpoint where this list of publications can be accessed
                using a **GET** method.
                `/v1/vouchers/{voucher_code}/publications`
        redemption:
          type: object
          description: >-
            Stores a summary of redemptions that have been applied to the
            voucher.
          properties:
            quantity:
              type: integer
              description: >-
                How many times a voucher can be redeemed. A `null` value means
                unlimited.
            redeemed_quantity:
              type: integer
              example: 1
              description: How many times a voucher has already been redeemed.
            redeemed_points:
              type: integer
              example: 100000
              description: Total loyalty points redeemed.
            object:
              type: string
              default: list
              description: >-
                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.
            url:
              type: string
              example: /v1/vouchers/WVPblOYX/redemptions?page=1&limit=10
              description: >-
                The endpoint where this list of redemptions can be accessed
                using a **GET** method.
                `/v1/vouchers/{voucher_code}/redemptions`
    Category:
      title: Category
      description: This is an object representing a category.
      type: object
      properties:
        id:
          type: string
          description: Unique category ID assigned by Voucherify.
        name:
          type: string
          description: Category name.
        hierarchy:
          type: integer
          description: >-
            Category hierarchy. Categories with lower hierarchy are processed
            before categories with higher hierarchy value.
          minimum: 0
        object:
          type: string
          default: category
          enum:
            - category
          description: >-
            The type of the object represented by the JSON. This object stores
            information about the category.
        created_at:
          type: string
          description: >-
            Timestamp 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'
          format: date-time
        updated_at:
          type: string
          example: '2022-08-16T10:52:08.094Z'
          description: >-
            Timestamp representing the date and time when the category was
            updated. The value is shown in the ISO 8601 format.
          format: date-time
      required:
        - id
        - name
        - hierarchy
        - created_at
        - object
    ValidationRulesAssignmentsList:
      title: Validation Rules Assignments List
      description: List of Validation Rules Assignments
      type: object
      properties:
        object:
          type: string
          default: list
          enum:
            - list
          description: >-
            The type of the object represented by JSON. This object stores
            information about validation rules assignments.
        data_ref:
          type: string
          default: data
          enum:
            - data
          description: >-
            Identifies the name of the attribute that contains the array of
            validation rules assignments.
        data:
          type: array
          description: Contains array of validation rules assignments.
          items:
            $ref: '#/components/schemas/BusValRuleAssignment'
        total:
          type: integer
          minimum: 0
          description: Total number of validation rules assignments.
      required:
        - object
        - data_ref
        - data
        - total
    6_res_applicable_to_object:
      title: Included  Items
      type: object
      description: >-
        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.
      properties:
        data:
          type: array
          description: Contains array of items to which the discount can apply.
          items:
            oneOf:
              - $ref: '#/components/schemas/6_res_product_collection'
              - $ref: '#/components/schemas/6_res_product_collection_unit'
              - $ref: '#/components/schemas/6_res_product_collection_fixed_amount'
              - $ref: '#/components/schemas/6_res_product'
              - $ref: '#/components/schemas/6_res_product_unit'
              - $ref: '#/components/schemas/6_res_product_fixed_amount'
              - $ref: '#/components/schemas/6_res_sku'
              - $ref: '#/components/schemas/6_res_sku_unit'
              - $ref: '#/components/schemas/6_res_sku_unit_fixed_amount'
        total:
          type: integer
          description: >-
            Total number of objects defining included products, SKUs, or product
            collections.
        data_ref:
          type: string
          default: data
          description: >-
            Identifies the name of the attribute that contains the array of
            included objects.
        object:
          type: string
          default: list
          description: >-
            The type of the object represented by JSON. This object stores
            information about included products, SKUs, or product collections in
            a dictionary.
    6_res_inapplicable_to_object:
      title: Excluded Items
      type: object
      description: >-
        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.
      properties:
        data:
          description: Contains array of items to which the discount cannot apply.
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/6_res_product_collection_excluded'
              - $ref: '#/components/schemas/6_res_product_excluded'
              - $ref: '#/components/schemas/6_res_sku_excluded'
        total:
          type: integer
          description: >-
            Total number of objects defining excluded products, SKUs, or product
            collections.
        data_ref:
          type: string
          default: data
          description: >-
            Identifies the name of the attribute that contains the array of
            excluded objects.
        object:
          type: string
          default: list
          description: >-
            The type of the object represented by JSON. This object stores
            information about excluded products, SKUs, or product collections in
            a dictionary.
    Discount:
      title: Discount
      type: object
      description: Contains information about discount.
      oneOf:
        - $ref: '#/components/schemas/DiscountAmount'
        - $ref: '#/components/schemas/DiscountUnit'
        - $ref: '#/components/schemas/DiscountUnitMultiple'
        - $ref: '#/components/schemas/DiscountPercent'
        - $ref: '#/components/schemas/DiscountFixed'
    ValidityTimeframe:
      title: Validity Timeframe
      type: object
      description: >-
        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`.
      properties:
        duration:
          type: string
          description: >-
            Defines 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
        interval:
          type: string
          description: >-
            Defines 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
    ValidityDayOfWeek:
      title: Validity Day Of Week
      type: array
      description: >-
        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
      items:
        type: integer
        enum:
          - 0
          - 1
          - 2
          - 3
          - 4
          - 5
          - 6
    ValidityHours:
      title: Validity Hours
      type: object
      description: Determines the hours of validity, e.g. to create a happy hours scenario.
      properties:
        daily:
          type: array
          description: >-
            Defines the recurring period(s) when the resource is active. The
            periods should not overlap.
          items:
            type: object
            description: Defines the recurring period(s) when the resource will be active.
            properties:
              start_time:
                type: string
                format: time
                description: >-
                  Defines the starting hour of validity in the HH:mm format. The
                  resource is *inactive before* this time.
                example: '12:00'
              days_of_week:
                type: array
                description: >-
                  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
                items:
                  type: integer
                  enum:
                    - 0
                    - 1
                    - 2
                    - 3
                    - 4
                    - 5
                    - 6
              expiration_time:
                type: string
                format: time
                description: >-
                  Defines the ending hour of validity in the HH:mm format. The
                  resource is *inactive after* this time.
                example: '14:00'
    VoucherAssets:
      title: Voucher Assets
      type: object
      description: >-
        Stores links to images of QR and barcode that correspond to an encrypted
        voucher code.
      properties:
        qr:
          type: object
          description: Stores Quick Response (QR) representation of encrypted code.
          properties:
            id:
              type: string
              example: >-
                U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK+t4pp7U7oFzjGJzj9q/bmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg+BaZk5QwXMf8k/OzSlOEVybpwSq+AiqPoNtjeuqtIgkDyvT6Q==
              description: Encrypted voucher code ID.
            url:
              type: string
              example: >-
                https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK%2Bt4pp7U7oFzjGJzj9q%2FbmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg%2BBaZk5QwXMf8k%2FOzSlOEVybpwSq%2BAiqPoNtjeuqtIgkDyvT6Q%3D%3D
              description: >-
                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`
        barcode:
          type: object
          description: Stores barcode representation of encrypted code.
          properties:
            id:
              type: string
              example: >-
                U2FsdGVkX19eJhGfWwUrH9+tulBkON+AnMktic+N6CVWzZ9+fHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ+kJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6/pFs61apEn9SJx32ttCF6d3oxKISQQ==
              description: Encrypted voucher code ID.
            url:
              type: string
              example: >-
                https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D
              description: >-
                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`
    BusValRuleAssignment:
      title: Business Validation Rule Assignment
      description: Assignments of business validation rule
      example:
        id: asgm_LnY1g7UNFA9KyDrD
        rule_id: val_3gPNA6SnH4ae
        related_object_id: camp_CZOnEGiZfwIKWmSjhIoIT7Ol
        related_object_type: campaign
        object: validation_rules_assignment
        validation_status: PARTIALLY_VALID
        validation_omitted_rules:
          - '1'
      properties:
        id:
          type: string
          description: The unique identifier for a assignment
        rule_id:
          type: string
          description: The unique identifier for a rule
        related_object_id:
          type: string
          description: The unique identifier for a related object
        related_object_type:
          type: string
          description: The type of related object
        created_at:
          type: string
          description: >-
            Timestamp 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'
          format: date-time
        updated_at:
          type: string
          description: >-
            Timestamp representing the date and time when the object was last
            updated in ISO 8601 format.
          example: '2022-03-09T11:19:04.819Z'
          format: date-time
        object:
          type: string
          description: The type of the object represented by JSON.
          default: validation_rules_assignment
          enum:
            - validation_rules_assignment
        validation_status:
          type: string
          description: The validation status of the assignment
          enum:
            - VALID
            - PARTIALLY_VALID
            - INVALID
        validation_omitted_rules:
          type: array
          description: The list of omitted rules
          items:
            type: string
      required:
        - id
        - rule_id
        - related_object_id
        - related_object_type
        - object
    6_res_product_collection:
      title: Product Collection
      type: object
      description: Contains definition for a product collection.
      properties:
        object:
          type: string
          default: products_collection
          description: This object stores information about the product collection.
        id:
          type: string
          example: pc_4ndRXAsTOzwSdHcQcxf489uU
          description: Unique product collection ID assigned by Voucherify.
        effect:
          type: string
          enum:
            - APPLY_TO_EVERY
            - APPLY_TO_CHEAPEST
            - APPLY_TO_MOST_EXPENSIVE
          description: Defines how the discount is applied to the customer's order.
    6_res_product_collection_unit:
      title: Product Collection for Unit Discount
      type: object
      description: Contains definition for a product collection.
      properties:
        object:
          type: string
          default: products_collection
          description: This object stores information about the product collection.
        id:
          type: string
          example: pc_4ndRXAsTOzwSdHcQcxf489uU
          description: Unique product collection ID assigned by Voucherify.
        effect:
          type: string
          enum:
            - APPLY_TO_EVERY
            - APPLY_TO_CHEAPEST
            - APPLY_TO_MOST_EXPENSIVE
          description: Defines how the discount is applied to the customer's order.
        quantity_limit:
          type: integer
          description: >-
            The maximum number of units allowed to be discounted per order line
            item.
        aggregated_quantity_limit:
          type: integer
          description: >-
            The maximum number of units allowed to be discounted combined across
            all matched order line items.
    6_res_product_collection_fixed_amount:
      title: Product Collection for Fixed Amount Discount
      type: object
      description: Contains definition for a product collection.
      properties:
        object:
          type: string
          default: products_collection
          description: This object stores information about the product collection.
        id:
          type: string
          example: pc_4ndRXAsTOzwSdHcQcxf489uU
          description: Unique product collection ID assigned by Voucherify.
        price:
          type: integer
          description: >-
            New fixed price of an item. Value is multiplied by 100 to precisely
            represent 2 decimal places. For example, a $10 price is written as
            1000. In case of the fixed price being calculated by the formula,
            i.e. the `price_formula` parameter is present in the fixed price
            definition, this value becomes the **fallback value**. Such that in
            a case where the formula cannot be calculated due to missing
            metadata, for example, this value will be used as the fixed price.
        price_formula:
          type: string
          description: >-
            Formula used to dynamically calculate the discounted price of an
            item.
          example: '"IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)'
        effect:
          type: string
          enum:
            - APPLY_TO_EVERY
            - APPLY_TO_CHEAPEST
            - APPLY_TO_MOST_EXPENSIVE
          description: Defines how the discount is applied to the customer's order.
    6_res_product:
      title: Product
      type: object
      description: Contains definition for a product.
      properties:
        object:
          type: string
          default: product
          description: This object stores information about the product.
        id:
          type: string
          description: Unique product ID assigned by Voucherify.
          example: prod_0bae2dc5a090fd0184
        source_id:
          type: string
          description: The product ID from your inventory system.
        effect:
          type: string
          enum:
            - APPLY_TO_EVERY
            - APPLY_TO_CHEAPEST
            - APPLY_TO_MOST_EXPENSIVE
          description: Defines how the discount is applied to the customer's order.
    6_res_product_unit:
      title: Product for Unit Discount
      type: object
      description: Contains definition for a product.
      properties:
        object:
          type: string
          default: product
          description: This object stores information about the product.
        id:
          type: string
          description: Unique product ID assigned by Voucherify.
          example: prod_0bae2dc5a090fd0184
        source_id:
          type: string
          description: The product ID from your inventory system.
        effect:
          type: string
          enum:
            - APPLY_TO_EVERY
            - APPLY_TO_CHEAPEST
            - APPLY_TO_MOST_EXPENSIVE
          description: Defines how the discount is applied to the customer's order.
        quantity_limit:
          type: integer
          description: >-
            The maximum number of units allowed to be discounted per order line
            item.
        aggregated_quantity_limit:
          type: integer
          description: >-
            The maximum number of units allowed to be discounted combined across
            all matched order line items.
    6_res_product_fixed_amount:
      title: Product for Fixed Amount Discount
      type: object
      description: Contains definition for a product.
      properties:
        object:
          type: string
          default: product
          description: This object stores information about the product.
        id:
          type: string
          description: Unique product ID assigned by Voucherify.
          example: prod_0bae2dc5a090fd0184
        source_id:
          type: string
          description: The product ID from your inventory system.
        price:
          type: integer
          description: >-
            New fixed price of an item. Value is multiplied by 100 to precisely
            represent 2 decimal places. For example, a $10 price is written as
            1000. In case of the fixed price being calculated by the formula,
            i.e. the `price_formula` parameter is present in the fixed price
            definition, this value becomes the **fallback value**. Such that in
            a case where the formula cannot be calculated due to missing
            metadata, for example, this value will be used as the fixed price.
        price_formula:
          type: string
          description: >-
            Formula used to dynamically calculate the discounted price of an
            item.
          example: IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)
        effect:
          type: string
          enum:
            - APPLY_TO_EVERY
            - APPLY_TO_CHEAPEST
            - APPLY_TO_MOST_EXPENSIVE
          description: Defines how the discount is applied to the customer's order.
    6_res_sku:
      title: SKU
      type: object
      description: Contains definition for a product variant.
      properties:
        object:
          type: string
          default: sku
          description: This object stores information about the product variant.
        id:
          type: string
          description: Unique SKU ID assigned by Voucherify.
          example: sku_0b7d7dfb090be5c619
        source_id:
          type: string
          description: The source ID from your inventory system.
        product_id:
          type: string
          description: Parent product's unique ID assigned by Voucherify.
        product_source_id:
          type: string
          description: Parent product's source ID from your inventory system.
        effect:
          type: string
          enum:
            - APPLY_TO_EVERY
            - APPLY_TO_CHEAPEST
            - APPLY_TO_MOST_EXPENSIVE
          description: Defines how the discount is applied to the customer's order.
    6_res_sku_unit:
      title: SKU for Unit Discount
      type: object
      description: Contains definition for a product variant.
      properties:
        object:
          type: string
          default: sku
          description: This object stores information about the product variant.
        id:
          type: string
          description: Unique SKU ID assigned by Voucherify.
          example: sku_0b7d7dfb090be5c619
        source_id:
          type: string
          description: The source ID from your inventory system.
        product_id:
          type: string
          description: Parent product's unique ID assigned by Voucherify.
        product_source_id:
          type: string
          description: Parent product's source ID from your inventory system.
        effect:
          type: string
          enum:
            - APPLY_TO_EVERY
            - APPLY_TO_CHEAPEST
            - APPLY_TO_MOST_EXPENSIVE
          description: Defines how the discount is applied to the customer's order.
        quantity_limit:
          type: integer
          description: >-
            The maximum number of units allowed to be discounted per order line
            item.
        aggregated_quantity_limit:
          type: integer
          description: >-
            The maximum number of units allowed to be discounted combined across
            all matched order line items.
    6_res_sku_unit_fixed_amount:
      title: SKU for Amount Discount
      type: object
      description: Contains definition for a product variant.
      properties:
        object:
          type: string
          default: sku
          description: This object stores information about the product variant.
        id:
          type: string
          description: Unique SKU ID assigned by Voucherify.
          example: sku_0b7d7dfb090be5c619
        source_id:
          type: string
          description: The source ID from your inventory system.
        product_id:
          type: string
          description: Parent product's unique ID assigned by Voucherify.
        product_source_id:
          type: string
          description: Parent product's source ID from your inventory system.
        price:
          type: integer
          description: >-
            New fixed price of an item. Value is multiplied by 100 to precisely
            represent 2 decimal places. For example, a $10 price is written as
            1000. In case of the fixed price being calculated by the formula,
            i.e. the `price_formula` parameter is present in the fixed price
            definition, this value becomes the **fallback value**. Such that in
            a case where the formula cannot be calculated due to missing
            metadata, for example, this value will be used as the fixed price.
        price_formula:
          type: string
          description: >-
            Formula used to dynamically calculate the discounted price of an
            item.
          example: IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE * 0.2;6)
        effect:
          type: string
          enum:
            - APPLY_TO_EVERY
            - APPLY_TO_CHEAPEST
            - APPLY_TO_MOST_EXPENSIVE
          description: Defines how the discount is applied to the customer's order.
    6_res_product_collection_excluded:
      title: Product Collection
      type: object
      description: Contains definition for a product collection.
      properties:
        object:
          type: string
          default: products_collection
          description: This object stores information about the product collection.
        id:
          type: string
          example: pc_4ndRXAsTOzwSdHcQcxf489uU
          description: Unique product collection ID assigned by Voucherify.
        effect:
          type: string
          default: APPLY_TO_EVERY
          enum:
            - APPLY_TO_EVERY
          description: Defines how the discount is applied to the customer's order.
    6_res_product_excluded:
      title: Product
      type: object
      description: Contains definition for a product.
      properties:
        object:
          type: string
          default: product
          description: This product stores information about the product.
        id:
          type: string
          description: Unique product ID assigned by Voucherify.
          example: prod_0bae2dc5a090fd0184
        source_id:
          type: string
          description: The product ID from your inventory system.
        effect:
          type: string
          default: APPLY_TO_EVERY
          enum:
            - APPLY_TO_EVERY
          description: Defines how the discount is applied to the customer's order.
    6_res_sku_excluded:
      title: SKU
      type: object
      description: Contains definition for a product variant.
      properties:
        object:
          type: string
          default: sku
          description: This object stores information about the product variant.
        id:
          type: string
          description: Unique SKU ID assigned by Voucherify.
          example: sku_0b7d7dfb090be5c619
        source_id:
          type: string
          description: The source ID from your inventory system.
        effect:
          type: string
          default: APPLY_TO_EVERY
          enum:
            - APPLY_TO_EVERY
          description: Defines how the discount is applied to the customer's order.
    DiscountAmount:
      type: object
      title: Amount
      properties:
        type:
          type: string
          default: AMOUNT
          enum:
            - AMOUNT
          description: Defines the type of the voucher.
        amount_off:
          type: number
          description: >-
            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.
        amount_off_formula:
          type: string
          description: Formula used to dynamically calculate the discount.
        aggregated_amount_limit:
          type: integer
          description: Maximum discount amount per order.
        effect:
          description: Defines how the discount is applied to the customer's order.
          allOf:
            - $ref: '#/components/schemas/DiscountAmountVouchersEffectTypes'
        is_dynamic:
          type: boolean
          description: Flag indicating whether the discount was calculated using a formula.
      required:
        - type
        - amount_off
    DiscountUnit:
      type: object
      title: Unit
      properties:
        type:
          type: string
          default: UNIT
          enum:
            - UNIT
          description: Discount type.
        unit_off:
          type: integer
          description: Number of units to be granted a full value discount.
        unit_off_formula:
          type: string
          description: Formula used to dynamically calculate the number of units.
        effect:
          description: Defines how the unit is added to the customer's order.
          allOf:
            - $ref: '#/components/schemas/DiscountUnitVouchersEffectTypes'
        unit_type:
          type: string
          description: >-
            The product deemed as free, chosen from product inventory (e.g.
            time, items).
        product:
          description: Contains information about the product.
          allOf:
            - $ref: '#/components/schemas/SimpleProductDiscountUnit'
        sku:
          $ref: '#/components/schemas/SimpleSkuDiscountUnit'
        is_dynamic:
          type: boolean
          description: Flag indicating whether the discount was calculated using a formula.
      required:
        - type
        - unit_type
    DiscountUnitMultiple:
      type: object
      title: Unit Multiple
      properties:
        type:
          type: string
          default: UNIT
          enum:
            - UNIT
          description: Discount type.
        effect:
          type: string
          default: ADD_MANY_ITEMS
          enum:
            - ADD_MANY_ITEMS
          description: Defines how the discount is applied to the customer's order.
        units:
          type: array
          items:
            $ref: '#/components/schemas/DiscountUnitMultipleOneUnit'
      required:
        - type
        - units
    DiscountPercent:
      type: object
      title: Percent
      properties:
        type:
          type: string
          default: PERCENT
          enum:
            - PERCENT
          description: Defines the type of the voucher.
        percent_off:
          type: number
          description: The percent discount that the customer will receive.
        percent_off_formula:
          type: string
          description: Formula used to dynamically calculate the discount.
        amount_limit:
          type: number
          description: >-
            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.
        aggregated_amount_limit:
          type: integer
          description: Maximum discount amount per order.
        effect:
          description: Defines how the discount is applied to the customer's order.
          allOf:
            - $ref: '#/components/schemas/DiscountPercentVouchersEffectTypes'
        is_dynamic:
          type: boolean
          description: Flag indicating whether the discount was calculated using a formula.
      required:
        - type
        - percent_off
    DiscountFixed:
      title: Fixed
      type: object
      properties:
        type:
          type: string
          default: FIXED
          enum:
            - FIXED
          description: Defines the type of the voucher.
        fixed_amount:
          type: number
          description: >-
            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.
        fixed_amount_formula:
          type: string
          description: Formula used to dynamically calculate the discount.
        effect:
          description: Defines how the discount is applied to the customer's order.
          allOf:
            - $ref: '#/components/schemas/DiscountFixedVouchersEffectTypes'
        is_dynamic:
          type: boolean
          description: Flag indicating whether the discount was calculated using a formula.
      required:
        - type
        - fixed_amount
    DiscountAmountVouchersEffectTypes:
      title: Discount Amount Vouchers Effect Types
      enum:
        - APPLY_TO_ORDER
        - APPLY_TO_ITEMS
        - APPLY_TO_ITEMS_PROPORTIONALLY
        - APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY
        - APPLY_TO_ITEMS_BY_QUANTITY
      type: string
    DiscountUnitVouchersEffectTypes:
      title: Discount Unit Vouchers Effect Types
      enum:
        - ADD_MISSING_ITEMS
        - ADD_NEW_ITEMS
        - ADD_MANY_ITEMS
        - ADD_SAME_ITEMS
      type: string
    SimpleProductDiscountUnit:
      type: object
      title: Simple Product Discount Unit
      properties:
        id:
          type: string
          description: Unique product ID, assigned by Voucherify.
        source_id:
          type: string
          description: Product's source ID.
        name:
          type: string
          description: Product name.
      required:
        - id
        - name
    SimpleSkuDiscountUnit:
      type: object
      title: Simple Sku Discount Unit
      properties:
        id:
          type: string
          description: Unique SKU ID, assigned by Voucherify.
        source_id:
          type: string
          description: Product variant's source ID.
        name:
          type: string
          description: Sku name
      required:
        - id
        - name
    DiscountUnitMultipleOneUnit:
      type: object
      title: One Unit
      properties:
        unit_off:
          type: number
          description: Number of units to be granted a full value discount.
        unit_off_formula:
          type: string
          description: Formula used to dynamically calculate the number of units.
        effect:
          type: string
          enum:
            - ADD_NEW_ITEMS
            - ADD_MISSING_ITEMS
          description: |+
            Defines how the unit is added to the customer's order.

        unit_type:
          type: string
          description: >-
            The product deemed as free, chosen from product inventory (e.g.
            time, items).
        product:
          description: Contains information about the product.
          allOf:
            - $ref: '#/components/schemas/SimpleProductDiscountUnit'
        sku:
          description: Contains information about the sku.
          allOf:
            - $ref: '#/components/schemas/SimpleSkuDiscountUnit'
      required:
        - effect
        - unit_type
    DiscountPercentVouchersEffectTypes:
      title: Discount Percent Vouchers Effect Types
      enum:
        - APPLY_TO_ORDER
        - APPLY_TO_ITEMS
      type: string
    DiscountFixedVouchersEffectTypes:
      title: Discount Fixed Vouchers Effect Types
      enum:
        - APPLY_TO_ORDER
        - APPLY_TO_ITEMS
      type: string
  securitySchemes:
    X-App-Id:
      type: apiKey
      name: X-App-Id
      in: header
    X-App-Token:
      type: apiKey
      name: X-App-Token
      in: header
    X-Voucherify-OAuth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://api.voucherify.io/v1/oauth/token
          scopes:
            api: Gives access to whole server-side API.
            vouchers: >-
              Gives access to all endpoints and methods starting with
              `v1/vouchers`.
            client_api: Gives access to whole client-side API.
            client_vouchers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/vouchers`.
            promotions: >-
              Gives access to all endpoints and methods starting with
              `/v1/promotions`.
            client_promotions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/promotions`
            campaigns: >-
              Gives access to all endpoints and methods starting with
              `v1/campaigns`.
            client_publish: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/publish`.
            exports: >-
              Gives access to all endpoints and methods starting with
              `/v1/exports`.
            publications: >-
              Gives access to all endpoints and methods starting with
              `/v1/publications`.
            client_validate: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validate`.
            validations: >-
              Gives access to all endpoints and methods starting with
              `/v1/validations`.
            client_validations: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validations`.
            qualifications: >-
              Gives access to all endpoints and methods starting with
              `/v1/qualifications`.
            client_qualifications: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/qualifications`.
            client_redeem: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redeem
            redemptions: >-
              Gives access to all endpoints and methods starting with
              `/v1/redemptions`.
            client_redemptions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redemptions`
            customers: >-
              Gives access to all endpoints and methods starting with
              `/v1/customers`.
            client_customers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/customers`.
            orders: >-
              Gives access to all endpoints and methods starting with
              `/v1/orders`.
            products: >-
              Gives access to all endpoints and methods starting with
              `/v1/products`.
            skus: >-
              Gives access to all endpoints and methods starting with
              `/v1/SKUs`.
            validation-rules: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules`.
            validation-rules-assignments: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules-assignments
            segments: >-
              Gives access to all endpoints and methods starting with
              `/v1/segments`.
            events: >-
              Gives access to all endpoints and methods starting with
              `/v1/events`.
            client_events: >-
              Gives access to all endpoints and methods starting with
              `client/v1/events`.
            rewards: >-
              Gives access to all endpoints and methods starting with
              `/v1/rewards`.
            assets: >-
              Gives access to all endpoints and methods starting with
              `/v1/assets`.
            task-results: >-
              Gives access to all endpoints and methods starting with
              `/v1/task-results`.
            loyalties: >-
              Gives access to all endpoints and methods starting with
              `/v1/loyalties`.
            client_consents: >-
              Gives access to all endpoints and methods starting with
              `client/v1/consents`.
            consents: >-
              Gives access to all endpoints and methods starting with
              `/v1/consents`.
            async-actions: >-
              Gives access to all endpoints and methods starting with
              `/v1/async-actions`.
            product-collections: >-
              Gives access to all endpoints and methods starting with
              `/v1/product-collections`.
            categories: >-
              Gives access to all endpoints and methods starting with
              `/v1/categories`.
            metadata-schemas: >-
              Gives access to all endpoints and methods starting with
              `/v1/metadata-schemas`.
            locations: >-
              Gives access to all endpoints and methods starting with
              `/v1/locations`.
            referrals: >-
              Gives access to all endpoints and methods starting with
              `/v1/referrals`.
            trash-bin: >-
              Gives access to all endpoints and methods starting with
              `/v1/trash-bin`.
            templates: >-
              Gives access to all endpoints and methods starting with
              `/v1/templates`.

````