> ## 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.

# Validate Voucher

> 
> ❗️ Deprecated  
>
> This endpoint represents the deprecated version of the API responsible for voucher validation, and we do not recommend using it. The new [Stackable Discounts API](/api-reference/validations/validate-stackable-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. 

To verify a voucher code given by a customer, you can use this method. It is designed for a server side integration, which means that is accessible only through private keys.  


> ❗️ Important  
>
> This endpoint supports the validation of a single promo code. If you need to validate more than one incentive, you can use the [Stackable discounts API](/api-reference/validations/validate-stackable-discounts). The stacking discounts API lets you validate up to 30 incentives per call. Before integrating Voucherify, choose which validation endpoint you prefer to use.

#### Gift Vouchers - validate Gift Card and control amount to redeem
Voucherify also gives the possibility to create a gift card, which allows using credits to fulfill the order. A user can specify how many credits he wants to use from the gift card. The available balance of credits is counted based on policy rules attached to the Gift Voucher definition.  

This operation returns information about the validity of the code. Moreover, it returns a hashed source identifier which can be used as a tracking ID in future calls.

If a validation session is established, then the session details will be returned as well. Read more about sessions [here](/guides/locking-validation-session).

Voucher validation might fail because of one of these reasons:
* `voucher not found` - voucher doesn't exist or was [deleted](/api-reference/vouchers/delete-voucher)
* `voucher expired` - voucher is out of start date - expiration date time frame
* `voucher is disabled` - learn more about a [disabled voucher](/api-reference/vouchers/disable-voucher)
* `customer does not match segment rules` - learn more [customer tracking](/api-reference/customers/customer-object) 
* `order does not match validation rules` - learn more about [validation rules](/api-reference/validation-rules/validation-rule-object)



## OpenAPI

````yaml /openapi/validations.json post /v1/vouchers/{code}/validate
openapi: 3.0.1
info:
  title: Voucherify API - Validations
  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/{code}/validate:
    parameters:
      - schema:
          $ref: '#/components/schemas/ParameterCode'
        name: code
        in: path
        required: true
        description: A code that identifies the voucher.
    post:
      tags:
        - Validations
      summary: Validate Voucher
      description: >-

        > ❗️ Deprecated  

        >

        > This endpoint represents the deprecated version of the API responsible
        for voucher validation, and we do not recommend using it. The new
        [Stackable Discounts
        API](/api-reference/validations/validate-stackable-discounts) introduces
        additional features and improvements while maintaining backward
        compatibility, including applying a combination of coupon codes and
        promotion tiers. Developers are encouraged to migrate to the latest
        version to take advantage of the latest enhancements and bug fixes. No
        updates will be provided to the deprecated endpoint. 


        To verify a voucher code given by a customer, you can use this method.
        It is designed for a server side integration, which means that is
        accessible only through private keys.  



        > ❗️ Important  

        >

        > This endpoint supports the validation of a single promo code. If you
        need to validate more than one incentive, you can use the [Stackable
        discounts API](/api-reference/validations/validate-stackable-discounts).
        The stacking discounts API lets you validate up to 30 incentives per
        call. Before integrating Voucherify, choose which validation endpoint
        you prefer to use.


        #### Gift Vouchers - validate Gift Card and control amount to redeem

        Voucherify also gives the possibility to create a gift card, which
        allows using credits to fulfill the order. A user can specify how many
        credits he wants to use from the gift card. The available balance of
        credits is counted based on policy rules attached to the Gift Voucher
        definition.  


        This operation returns information about the validity of the code.
        Moreover, it returns a hashed source identifier which can be used as a
        tracking ID in future calls.


        If a validation session is established, then the session details will be
        returned as well. Read more about sessions
        [here](/guides/locking-validation-session).


        Voucher validation might fail because of one of these reasons:

        * `voucher not found` - voucher doesn't exist or was
        [deleted](/api-reference/vouchers/delete-voucher)

        * `voucher expired` - voucher is out of start date - expiration date
        time frame

        * `voucher is disabled` - learn more about a [disabled
        voucher](/api-reference/vouchers/disable-voucher)

        * `customer does not match segment rules` - learn more [customer
        tracking](/api-reference/customers/customer-object) 

        * `order does not match validation rules` - learn more about [validation
        rules](/api-reference/validation-rules/validation-rule-object)
      operationId: validate-voucher
      parameters: []
      requestBody:
        description: >-
          Specify the voucher validation context using the request body
          parameters.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VouchersValidateRequestBody'
            examples:
              Free Shipping:
                value:
                  customer:
                    id: cust_4vMj8Twr5nBzvTrNCgipMb6M
                  order:
                    items:
                      - product_id: prod_0ba621bae5d39762ce
                        quantity: '1'
                      - product_id: prod_0b661d404787ec6d3b
                        quantity: '1'
                        price: 3100
              Multiple Product Variants:
                value:
                  customer:
                    source_id: 08dd9b5a-26de-44aa-a1d4-d9adfa9e8ec2
                  order:
                    id: ord_FDdsDI3FppuiqHa4s7drZEMP
              Unit - Add order items:
                value:
                  customer:
                    source_id: 08dd9b5a-26de-44aa-a1d4-d9adfa9e8ec2
                  order:
                    source_id: 47f491d1-a697-4f92-95ca-2ba1f463efa8
                  session:
                    type: LOCK
                    ttl_unit: NANOSECONDS
                    ttl: 1
              Fixed:
                value:
                  customer:
                    source_id: 08dd9b5a-26de-44aa-a1d4-d9adfa9e8ec2
                  order:
                    items:
                      - source_id: webinar_BF_sweater_pink_sweater
                        quantity: '1'
                        price: 6500
                        related_object: product
                      - source_id: webinar_BF_pants_navy_sweat_pants
                        quantity: '1'
                        price: 6000
                        related_object: product
                      - source_id: 5h1pp1ng
                        quantity: '1'
                        price: 2000
                        related_object: product
                      - source_id: webinar_BF_pants_gray_sweat_pants
                        quantity: '2'
                        price: 5000
                        related_object: product
                      - source_id: webinar_BF_sweater_pearl
                        quantity: '2'
                        price: 11000
                        related_object: product
                  session:
                    type: LOCK
              Percentage:
                value:
                  customer:
                    source_id: your_customer_source_ID
                    name: Bob Smith
                    description: A frequent customer
                    email: bob.smith@email.com
                    phone: +1 933 222 3333
                    address:
                      city: New York
                      country: United States
                      line_1: 123 Main St.
                      line_2: APT 3 BLG 5
                      postal_code: '10001'
                      state: NY
                    metadata:
                      lang: en
                      test: true
                    birthday: '1960-12-01'
                  order:
                    items:
                      - source_id: webinar_BF_sweater_pink_sweater
                        quantity: '1'
                        price: 6500
                        related_object: product
                      - source_id: webinar_BF_pants_navy_sweat_pants
                        quantity: '1'
                        price: 6000
                        related_object: product
                      - source_id: 5h1pp1ng
                        quantity: '1'
                        price: 2000
                        related_object: product
                      - source_id: webinar_BF_pants_gray_sweat_pants
                        quantity: '2'
                        price: 5000
                        related_object: product
                      - source_id: webinar_BF_sweater_pearl
                        quantity: '2'
                        price: 11000
                        related_object: product
                  session:
                    type: LOCK
                    key: your_custom_key
                    ttl_unit: NANOSECONDS
                    ttl: 1
              Amount:
                value:
                  customer:
                    source_id: your_customer_source_ID
                    name: Bob Smith
                    description: A frequent customer
                    email: bob.smith@email.com
                    phone: +1 933 222 3333
                    address:
                      city: New York
                      country: United States
                      line_1: 123 Main St.
                      line_2: APT 3 BLG 5
                      postal_code: '10001'
                      state: NY
                    metadata:
                      lang: en
                      test: true
                    birthday: '1960-12-01'
                  order:
                    items:
                      - source_id: webinar_BF_sweater_pink_sweater
                        quantity: '1'
                        price: 6500
                        related_object: product
                      - source_id: webinar_BF_pants_navy_sweat_pants
                        quantity: '1'
                        price: 6000
                        related_object: product
                      - source_id: 5h1pp1ng
                        quantity: '1'
                        price: 2000
                        related_object: product
                      - source_id: webinar_BF_pants_gray_sweat_pants
                        quantity: '2'
                        price: 5000
                        related_object: product
                      - source_id: webinar_BF_sweater_pearl
                        quantity: '2'
                        price: 11000
                        related_object: product
                    metadata:
                      currency: EUR
                  session:
                    type: LOCK
                    key: your_custom_key
                    ttl_unit: NANOSECONDS
                    ttl: 1
              Loyalty Card:
                value:
                  order:
                    items:
                      - product_id: prod_0bd76fc58f8038b043
                        quantity: '1'
                      - product_id: prod_0bd76bd0e204542738
                        quantity: '1'
                  reward:
                    id: rew_4ZF6Y69U2PXE3GLIZxfozgg1
                    points: 10
              Gift Card:
                value:
                  customer:
                    source_id: 286401dc-6f4c-4ebb-8ca2-9f78b3e84c7d
                  order:
                    amount: 1000
                    metadata:
                      currency: USD
                  gift:
                    credits: 2
                  metadata:
                    location_id:
                      - L1
              Referral Code:
                value:
                  customer:
                    source_id: earlybirdcust
                  order:
                    amount: 20000
                    metadata:
                      currency: USD
                  metadata:
                    location_id:
                      - L1
        required: true
      responses:
        '200':
          description: >-
            Returns information whether the voucher is valid in the context of
            the parameter values provided in the request body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VouchersValidateResponseBody'
              examples:
                'False':
                  value:
                    valid: false
                    reason: redemption does not match validation rules
                    error:
                      code: 400
                      key: redemption_rules_violated
                      message: redemption does not match validation rules
                      details: >-
                        Gift Card cannot be redeemed because of violated
                        validation rules: val_wvipKm99CJuL
                      request_id: v-0bccef7a9585cf63b6
                    tracking_id: track_ZGPtmYcM+Mw=
                    code: vBQvYFEM
                    metadata: {}
                Free Shipping:
                  value:
                    valid: true
                    applicable_to:
                      data: []
                      total: 0
                      data_ref: data
                      object: list
                    inapplicable_to:
                      data: []
                      total: 0
                      data_ref: data
                      object: list
                    tracking_id: >-
                      track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==
                    order:
                      amount: 4300
                      total_amount: 4300
                      items:
                        - object: order_item
                          product_id: prod_0ba621bae5d39762ce
                          quantity: 1
                          amount: 1200
                          price: 1200
                          subtotal_amount: 1200
                          product:
                            id: prod_0ba621bae5d39762ce
                            source_id: arabica_plus
                            name: Arabica Coffee 250g
                            price: 1200
                        - object: order_item
                          product_id: prod_0b661d404787ec6d3b
                          quantity: 1
                          amount: 3100
                          price: 3100
                          subtotal_amount: 3100
                          product:
                            id: prod_0b661d404787ec6d3b
                            source_id: 7717f389-4621-4c7a-a6db-d4acfe051a97
                            name: Kate Moss by Mario Testino
                        - object: order_item
                          product_id: prod_5h1pp1ng
                          quantity: 1
                          discount_quantity: 1
                          initial_quantity: 0
                          product:
                            id: prod_5h1pp1ng
                            source_id: 5h1pp1ng
                            name: Shipping
                      metadata: {}
                      customer_id: null
                      referrer_id: null
                      object: order
                    code: Test - Discount - Free Shipping
                    discount:
                      type: UNIT
                      effect: ADD_MISSING_ITEMS
                      unit_off: 1
                      unit_type: prod_5h1pp1ng
                      product:
                        id: prod_5h1pp1ng
                        source_id: 5h1pp1ng
                        name: Shipping
                    metadata: {}
                Multiple Product Varients:
                  value:
                    valid: true
                    applicable_to:
                      data: []
                      total: 0
                      data_ref: data
                      object: list
                    inapplicable_to:
                      data: []
                      total: 0
                      data_ref: data
                      object: list
                    tracking_id: >-
                      track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==
                    order:
                      id: ord_FDdsDI3FppuiqHa4s7drZEMP
                      source_id: 47f491d1-a697-4f92-95ca-2ba1f463efa8
                      created_at: '2022-09-21T13:09:25.773Z'
                      updated_at: '2022-09-21T13:09:27.139Z'
                      status: PAID
                      amount: 237300
                      initial_amount: 28000
                      discount_amount: 8400
                      items_discount_amount: 209300
                      total_discount_amount: 217700
                      total_amount: 19600
                      items_applied_discount_amount: 209300
                      total_applied_discount_amount: 209300
                      items:
                        - object: order_item
                          source_id: A0E20000000295J
                          related_object: sku
                          product_id: prod_0b661d31134b299cc2
                          quantity: 1
                          amount: 9500
                          price: 9500
                          subtotal_amount: 9500
                          product:
                            id: prod_0b661d31134b299cc2
                            source_id: 2c446063-d582-4d7e-9651-23971b3e56f7
                            name: Keychain D‘Amico
                          sku:
                            id: sku_0b661d6265cb29ae52
                            source_id: A0E20000000295J
                            sku: Keychain D‘Amico
                            metadata: {}
                            price: 9500
                        - object: order_item
                          source_id: M0E20000000EAT6
                          related_object: sku
                          quantity: 1
                          amount: 18500
                          price: 18500
                          subtotal_amount: 18500
                          product:
                            name: Jogging pants Paolo Pecora light grey
                          sku:
                            sku: Jogging pants Paolo Pecora light grey
                            metadata: {}
                        - object: order_item
                          product_id: prod_5h1pp1ng
                          quantity: 1
                          discount_quantity: 1
                          initial_quantity: 0
                          product:
                            id: prod_5h1pp1ng
                            source_id: 5h1pp1ng
                            name: Shipping
                        - object: order_item
                          product_id: prod_0b661d4bd2c7ec7d1f
                          sku_id: sku_0b661e41fc8d35a8f7
                          quantity: 3
                          discount_quantity: 3
                          initial_quantity: 0
                          amount: 89700
                          discount_amount: 89700
                          initial_amount: 0
                          applied_discount_amount: 89700
                          price: 29900
                          subtotal_amount: 0
                          product:
                            id: prod_0b661d4bd2c7ec7d1f
                            source_id: facdc58f-ff7c-40c4-a22f-ab0a084a9107
                            name: Casual jacket Michael Kors beige
                          sku:
                            id: sku_0b661e41fc8d35a8f7
                            source_id: M0E20000000ELDG
                            sku: Casual jacket Michael Kors beige
                            price: 29900
                        - object: order_item
                          product_id: prod_0b661d4bd2c7ec7d1f
                          sku_id: sku_0b661e41fc8d35a8f6
                          quantity: 4
                          discount_quantity: 4
                          initial_quantity: 0
                          amount: 119600
                          discount_amount: 119600
                          initial_amount: 0
                          applied_discount_amount: 119600
                          price: 29900
                          subtotal_amount: 0
                          product:
                            id: prod_0b661d4bd2c7ec7d1f
                            source_id: facdc58f-ff7c-40c4-a22f-ab0a084a9107
                            name: Casual jacket Michael Kors beige
                          sku:
                            id: sku_0b661e41fc8d35a8f6
                            source_id: M0E20000000ELDF
                            sku: Casual jacket Michael Kors beige
                            price: 29900
                      metadata: {}
                      customer:
                        id: cust_nM4jqPiaXUvQdVSA6vTRUnix
                        object: customer
                      customer_id: cust_nM4jqPiaXUvQdVSA6vTRUnix
                      referrer_id: null
                      object: order
                      redemptions:
                        r_0bb9c69ca9d5a364b2:
                          date: '2022-09-21T13:09:25.799Z'
                          related_object_type: redemption
                          related_object_id: r_0bb9c69ca9d5a364b2
                          stacked:
                            - r_0bb9c69ca9d5a364b3
                            - r_0bb9c69ca9d5a364b4
                    code: Test - Discount - Unit - Multiple - Product Variants
                    discount:
                      type: UNIT
                      effect: ADD_MANY_ITEMS
                      units:
                        - effect: ADD_MISSING_ITEMS
                          unit_off: 3
                          unit_type: sku_0b661e41fc8d35a8f7
                          sku:
                            id: sku_0b661e41fc8d35a8f7
                            source_id: M0E20000000ELDG
                            sku: Casual jacket Michael Kors beige
                          product:
                            id: prod_0b661d4bd2c7ec7d1f
                            source_id: facdc58f-ff7c-40c4-a22f-ab0a084a9107
                            name: Casual jacket Michael Kors beige
                        - effect: ADD_NEW_ITEMS
                          unit_off: 4
                          unit_type: sku_0b661e41fc8d35a8f6
                          sku:
                            id: sku_0b661e41fc8d35a8f6
                            source_id: M0E20000000ELDF
                            sku: Casual jacket Michael Kors beige
                          product:
                            id: prod_0b661d4bd2c7ec7d1f
                            source_id: facdc58f-ff7c-40c4-a22f-ab0a084a9107
                            name: Casual jacket Michael Kors beige
                    metadata: {}
                Unit - Add order items:
                  value:
                    valid: true
                    applicable_to:
                      data: []
                      total: 0
                      data_ref: data
                      object: list
                    inapplicable_to:
                      data: []
                      total: 0
                      data_ref: data
                      object: list
                    tracking_id: >-
                      track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==
                    session:
                      key: ssn_K7DV3RbAGNCRVrPNZxJfld3FdwAQwOGl
                      type: LOCK
                      ttl: 1
                      ttl_unit: NANOSECONDS
                    order:
                      id: ord_FDdsDI3FppuiqHa4s7drZEMP
                      source_id: 47f491d1-a697-4f92-95ca-2ba1f463efa8
                      created_at: '2022-09-21T13:09:25.773Z'
                      updated_at: '2022-09-21T13:09:27.139Z'
                      status: PAID
                      amount: 117700
                      initial_amount: 28000
                      discount_amount: 8400
                      items_discount_amount: 89700
                      total_discount_amount: 98100
                      total_amount: 19600
                      items_applied_discount_amount: 89700
                      total_applied_discount_amount: 89700
                      items:
                        - object: order_item
                          source_id: A0E20000000295J
                          related_object: sku
                          product_id: prod_0b661d31134b299cc2
                          quantity: 1
                          amount: 9500
                          price: 9500
                          subtotal_amount: 9500
                          product:
                            id: prod_0b661d31134b299cc2
                            source_id: 2c446063-d582-4d7e-9651-23971b3e56f7
                            name: Keychain D‘Amico
                          sku:
                            id: sku_0b661d6265cb29ae52
                            source_id: A0E20000000295J
                            sku: Keychain D‘Amico
                            metadata: {}
                            price: 9500
                        - object: order_item
                          source_id: M0E20000000EAT6
                          related_object: sku
                          quantity: 1
                          amount: 18500
                          price: 18500
                          subtotal_amount: 18500
                          product:
                            name: Jogging pants Paolo Pecora light grey
                          sku:
                            sku: Jogging pants Paolo Pecora light grey
                            metadata: {}
                        - object: order_item
                          product_id: prod_5h1pp1ng
                          quantity: 1
                          discount_quantity: 1
                          initial_quantity: 0
                          product:
                            id: prod_5h1pp1ng
                            source_id: 5h1pp1ng
                            name: Shipping
                        - object: order_item
                          product_id: prod_0b661d4bd2c7ec7d1f
                          sku_id: sku_0b661e41fc8d35a8f8
                          quantity: 3
                          discount_quantity: 3
                          initial_quantity: 0
                          amount: 89700
                          discount_amount: 89700
                          initial_amount: 0
                          applied_discount_amount: 89700
                          price: 29900
                          subtotal_amount: 0
                          product:
                            id: prod_0b661d4bd2c7ec7d1f
                            source_id: facdc58f-ff7c-40c4-a22f-ab0a084a9107
                            name: Casual jacket Michael Kors beige
                          sku:
                            id: sku_0b661e41fc8d35a8f8
                            source_id: M0E20000000ELDH
                            sku: Casual jacket Michael Kors beige
                            price: 29900
                      metadata: {}
                      customer:
                        id: cust_nM4jqPiaXUvQdVSA6vTRUnix
                        object: customer
                      customer_id: cust_nM4jqPiaXUvQdVSA6vTRUnix
                      referrer_id: null
                      object: order
                      redemptions:
                        r_0bb9c69ca9d5a364b2:
                          date: '2022-09-21T13:09:25.799Z'
                          related_object_type: redemption
                          related_object_id: r_0bb9c69ca9d5a364b2
                          stacked:
                            - r_0bb9c69ca9d5a364b3
                            - r_0bb9c69ca9d5a364b4
                    code: Test - Discount - Unit - Add new order items
                    discount:
                      type: UNIT
                      effect: ADD_NEW_ITEMS
                      unit_off: 3
                      unit_type: sku_0b661e41fc8d35a8f8
                      sku:
                        id: sku_0b661e41fc8d35a8f8
                        source_id: M0E20000000ELDH
                        sku: Casual jacket Michael Kors beige
                      product:
                        id: prod_0b661d4bd2c7ec7d1f
                        source_id: facdc58f-ff7c-40c4-a22f-ab0a084a9107
                        name: Casual jacket Michael Kors beige
                    metadata: {}
                Fixed:
                  value:
                    valid: true
                    applicable_to:
                      data:
                        - object: product
                          id: prod_5h1pp1ng
                          source_id: 5h1pp1ng
                          price: 2000
                          price_formula: IF(ORDER_AMOUNT > 400;0;20)
                          effect: APPLY_TO_EVERY
                        - object: products_collection
                          id: pc_2KWKXn09Dk8neCfymqd4xOq8
                          price: 99900
                          price_formula: >-
                            IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE *
                            0.8;ORDER_ITEM_PRICE)
                          effect: APPLY_TO_EVERY
                        - object: products_collection
                          id: pc_x7HELQo52g2uI6nDuuOTRjAW
                          price: 99900
                          price_formula: >-
                            IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE *
                            0.9;ORDER_ITEM_PRICE)
                          effect: APPLY_TO_EVERY
                        - object: product
                          id: prod_0bd76ca337954ca116
                          source_id: webinar_BF_sweater_pink_sweater
                          price: 99900
                          price_formula: >-
                            IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE *
                            0.8;ORDER_ITEM_PRICE)
                          effect: APPLY_TO_EVERY
                        - object: product
                          id: prod_0bd76bd0e204542738
                          source_id: webinar_BF_pants_navy_sweat_pants
                          price: 99900
                          price_formula: >-
                            IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE *
                            0.9;ORDER_ITEM_PRICE)
                          effect: APPLY_TO_EVERY
                        - object: product
                          id: prod_0bd76b8656956a183f
                          source_id: webinar_BF_pants_gray_sweat_pants
                          price: 99900
                          price_formula: >-
                            IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE *
                            0.9;ORDER_ITEM_PRICE)
                          effect: APPLY_TO_EVERY
                        - object: product
                          id: prod_0bd76f59f98617518e
                          source_id: webinar_BF_sweater_pearl
                          price: 99900
                          price_formula: >-
                            IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE *
                            0.8;ORDER_ITEM_PRICE)
                          effect: APPLY_TO_EVERY
                      total: 7
                      data_ref: data
                      object: list
                    inapplicable_to:
                      data: []
                      total: 0
                      data_ref: data
                      object: list
                    tracking_id: >-
                      track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==
                    session:
                      key: ssn_u8rvi3Ac70S5ZRELWrxYsR2bnolpVWNg
                      type: LOCK
                      ttl: 7
                      ttl_unit: DAYS
                    order:
                      amount: 46500
                      items_discount_amount: 9300
                      total_discount_amount: 9300
                      total_amount: 37200
                      items_applied_discount_amount: 9300
                      total_applied_discount_amount: 9300
                      items:
                        - object: order_item
                          source_id: webinar_BF_sweater_pink_sweater
                          related_object: product
                          quantity: 1
                          amount: 6500
                          discount_amount: 1300
                          applied_discount_amount: 1300
                          price: 6500
                          subtotal_amount: 5200
                          product:
                            id: prod_0bd76ca337954ca116
                            source_id: webinar_BF_sweater_pink_sweater
                            name: Pink Sweater
                            price: 6500
                        - object: order_item
                          source_id: webinar_BF_pants_navy_sweat_pants
                          related_object: product
                          quantity: 1
                          amount: 6000
                          discount_amount: 600
                          applied_discount_amount: 600
                          price: 6000
                          subtotal_amount: 5400
                          product:
                            id: prod_0bd76bd0e204542738
                            source_id: webinar_BF_pants_navy_sweat_pants
                            name: Navy Sweat Pants
                            price: 6000
                        - object: order_item
                          source_id: 5h1pp1ng
                          related_object: product
                          quantity: 1
                          amount: 2000
                          discount_amount: 2000
                          applied_discount_amount: 2000
                          price: 2000
                          subtotal_amount: 0
                          product:
                            id: prod_5h1pp1ng
                            source_id: 5h1pp1ng
                            name: Shipping
                            price: 0
                        - object: order_item
                          source_id: webinar_BF_pants_gray_sweat_pants
                          related_object: product
                          quantity: 2
                          amount: 10000
                          discount_amount: 1000
                          applied_discount_amount: 1000
                          price: 5000
                          subtotal_amount: 9000
                          product:
                            id: prod_0bd76b8656956a183f
                            source_id: webinar_BF_pants_gray_sweat_pants
                            name: Gray Sweat Pants
                            price: 5000
                        - object: order_item
                          source_id: webinar_BF_sweater_pearl
                          related_object: product
                          quantity: 2
                          amount: 22000
                          discount_amount: 4400
                          applied_discount_amount: 4400
                          price: 11000
                          subtotal_amount: 17600
                          product:
                            id: prod_0bd76f59f98617518e
                            source_id: webinar_BF_sweater_pearl
                            name: Pearl Sweater
                            price: 11000
                      metadata: {}
                      customer_id: null
                      referrer_id: null
                      object: order
                    code: SPENDMOREGETMORE-DaIXFJvn
                    discount:
                      type: FIXED
                      effect: APPLY_TO_ITEMS
                    metadata:
                      shoutout: >-
                        Order more than 200€ to get 10% off pants, more than
                        300€ to get 20% off sweaters, and more than 400€ to get
                        free shipping.
                    campaign: SPENDMOREGETMORE
                    campaign_id: camp_Nwb2mppeDTtk23s1FVo6riwp
                Voucher expired:
                  value:
                    valid: false
                    reason: voucher expired
                    error:
                      code: 400
                      key: voucher_expired
                      message: voucher expired
                      details: EarlyBird-tB6zCApA
                      request_id: v-0be43067028abb6ca8
                    tracking_id: track_4Wb/eeza4PDXKElxYR/QtlDQOVFpY9mP
                    code: EarlyBird-tB6zCApA
                    metadata:
                      shoutout: >-
                        Get an early bird special. The earlier you order, the
                        better discount you will get.
                Percentage:
                  value:
                    valid: true
                    applicable_to:
                      data: []
                      total: 0
                      data_ref: data
                      object: list
                    inapplicable_to:
                      data: []
                      total: 0
                      data_ref: data
                      object: list
                    tracking_id: track_4Wb/eeza4PDXKElxYR/QtlDQOVFpY9mP
                    session:
                      key: your_custom_key
                      type: LOCK
                      ttl: 1
                      ttl_unit: NANOSECONDS
                    order:
                      amount: 46500
                      discount_amount: 4650
                      total_discount_amount: 4650
                      total_amount: 41850
                      applied_discount_amount: 4650
                      total_applied_discount_amount: 4650
                      items:
                        - object: order_item
                          source_id: webinar_BF_sweater_pink_sweater
                          related_object: product
                          quantity: 1
                          amount: 6500
                          price: 6500
                          subtotal_amount: 6500
                          product:
                            id: prod_0bd76ca337954ca116
                            source_id: webinar_BF_sweater_pink_sweater
                            name: Pink Sweater
                            price: 6500
                        - object: order_item
                          source_id: webinar_BF_pants_navy_sweat_pants
                          related_object: product
                          quantity: 1
                          amount: 6000
                          price: 6000
                          subtotal_amount: 6000
                          product:
                            id: prod_0bd76bd0e204542738
                            source_id: webinar_BF_pants_navy_sweat_pants
                            name: Navy Sweat Pants
                            price: 6000
                        - object: order_item
                          source_id: 5h1pp1ng
                          related_object: product
                          quantity: 1
                          amount: 2000
                          price: 2000
                          subtotal_amount: 2000
                          product:
                            id: prod_5h1pp1ng
                            source_id: 5h1pp1ng
                            name: Shipping
                            price: 0
                        - object: order_item
                          source_id: webinar_BF_pants_gray_sweat_pants
                          related_object: product
                          quantity: 2
                          amount: 10000
                          price: 5000
                          subtotal_amount: 10000
                          product:
                            id: prod_0bd76b8656956a183f
                            source_id: webinar_BF_pants_gray_sweat_pants
                            name: Gray Sweat Pants
                            price: 5000
                        - object: order_item
                          source_id: webinar_BF_sweater_pearl
                          related_object: product
                          quantity: 2
                          amount: 22000
                          price: 11000
                          subtotal_amount: 22000
                          product:
                            id: prod_0bd76f59f98617518e
                            source_id: webinar_BF_sweater_pearl
                            name: Pearl Sweater
                            price: 11000
                      metadata: {}
                      customer_id: null
                      referrer_id: null
                      object: order
                    code: EarlyBird-tB6zCApA
                    discount:
                      type: PERCENT
                      effect: APPLY_TO_ORDER
                      percent_off: 10
                    expiration_date: '2022-10-29T00:00:00.000Z'
                    metadata:
                      shoutout: >-
                        Get an early bird special. The earlier you order, the
                        better discount you will get.
                    campaign: Webinar - Early Bird Scenario
                    campaign_id: camp_z1g3iFqQe5qiZ9TTYFVpMwC0
                Amount:
                  value:
                    valid: true
                    applicable_to:
                      data: []
                      total: 0
                      data_ref: data
                      object: list
                    inapplicable_to:
                      data: []
                      total: 0
                      data_ref: data
                      object: list
                    tracking_id: track_4Wb/eeza4PDXKElxYR/QtlDQOVFpY9mP
                    session:
                      key: your_custom_key
                      type: LOCK
                      ttl: 1
                      ttl_unit: NANOSECONDS
                    order:
                      amount: 46500
                      discount_amount: 1000
                      total_discount_amount: 1000
                      total_amount: 45500
                      applied_discount_amount: 1000
                      total_applied_discount_amount: 1000
                      items:
                        - object: order_item
                          source_id: webinar_BF_sweater_pink_sweater
                          related_object: product
                          quantity: 1
                          amount: 6500
                          price: 6500
                          subtotal_amount: 6500
                          product:
                            id: prod_0bd76ca337954ca116
                            source_id: webinar_BF_sweater_pink_sweater
                            name: Pink Sweater
                            price: 6500
                        - object: order_item
                          source_id: webinar_BF_pants_navy_sweat_pants
                          related_object: product
                          quantity: 1
                          amount: 6000
                          price: 6000
                          subtotal_amount: 6000
                          product:
                            id: prod_0bd76bd0e204542738
                            source_id: webinar_BF_pants_navy_sweat_pants
                            name: Navy Sweat Pants
                            price: 6000
                        - object: order_item
                          source_id: 5h1pp1ng
                          related_object: product
                          quantity: 1
                          amount: 2000
                          price: 2000
                          subtotal_amount: 2000
                          product:
                            id: prod_5h1pp1ng
                            source_id: 5h1pp1ng
                            name: Shipping
                            price: 0
                        - object: order_item
                          source_id: webinar_BF_pants_gray_sweat_pants
                          related_object: product
                          quantity: 2
                          amount: 10000
                          price: 5000
                          subtotal_amount: 10000
                          product:
                            id: prod_0bd76b8656956a183f
                            source_id: webinar_BF_pants_gray_sweat_pants
                            name: Gray Sweat Pants
                            price: 5000
                        - object: order_item
                          source_id: webinar_BF_sweater_pearl
                          related_object: product
                          quantity: 2
                          amount: 22000
                          price: 11000
                          subtotal_amount: 22000
                          product:
                            id: prod_0bd76f59f98617518e
                            source_id: webinar_BF_sweater_pearl
                            name: Pearl Sweater
                            price: 11000
                      metadata:
                        currency: EUR
                      customer_id: null
                      referrer_id: null
                      object: order
                    code: PAYINEUROS
                    discount:
                      type: AMOUNT
                      effect: APPLY_TO_ORDER
                      amount_off: 1000
                    metadata:
                      shoutout: >-
                        Pay in euros to get 10 Euros off, any other currency to
                        get 5 off in that currency.
                Loyalty points exceeded:
                  value:
                    valid: false
                    reason: loyalty card points exceeded
                    error:
                      code: 400
                      key: loyalty_card_points_exceeded
                      message: loyalty card points exceeded
                      details: LOYALTY-CARD-ng3Kb9tM
                      request_id: v-0be434ae35cabb018a
                    tracking_id: >-
                      track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==
                    code: LOYALTY-CARD-ng3Kb9tM
                    metadata: {}
                Loyalty Card:
                  value:
                    valid: true
                    applicable_to:
                      data: []
                      total: 0
                      data_ref: data
                      object: list
                    inapplicable_to:
                      data: []
                      total: 0
                      data_ref: data
                      object: list
                    tracking_id: >-
                      track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==
                    order:
                      amount: 14500
                      discount_amount: 50
                      total_discount_amount: 50
                      total_amount: 14450
                      applied_discount_amount: 50
                      total_applied_discount_amount: 50
                      items:
                        - object: order_item
                          product_id: prod_0bd76fc58f8038b043
                          quantity: 1
                          amount: 8500
                          price: 8500
                          subtotal_amount: 8500
                          product:
                            id: prod_0bd76fc58f8038b043
                            source_id: webinar_BF_sweater_yellow
                            name: Yellow Sweater
                            price: 8500
                        - object: order_item
                          product_id: prod_0bd76bd0e204542738
                          quantity: 1
                          amount: 6000
                          price: 6000
                          subtotal_amount: 6000
                          product:
                            id: prod_0bd76bd0e204542738
                            source_id: webinar_BF_pants_navy_sweat_pants
                            name: Navy Sweat Pants
                            price: 6000
                      metadata: {}
                      customer_id: null
                      referrer_id: null
                      object: order
                    code: LOYALTY-CARD-ng3Kb9tM
                    loyalty:
                      points_cost: 10
                    reward:
                      id: rew_4ZF6Y69U2PXE3GLIZxfozgg1
                      assignment_id: rewa_WkeBlLhj0sRae70J5AAvLbmy
                      points: 10
                    metadata: {}
                    campaign: Loyalty Campaign
                    campaign_id: camp_ZNb23Xtw1WuGCm7gdax84PUi
                Voucher disabled:
                  value:
                    valid: false
                    reason: voucher is disabled
                    error:
                      code: 400
                      key: voucher_disabled
                      message: voucher is disabled
                      details: GIFT-CARD-kW4aEsfB
                      request_id: v-0be43817d7121a437d
                    tracking_id: >-
                      track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==
                    code: GIFT-CARD-kW4aEsfB
                    metadata: {}
                Gift Card:
                  value:
                    valid: true
                    applicable_to:
                      data: []
                      total: 0
                      data_ref: data
                      object: list
                    inapplicable_to:
                      data: []
                      total: 0
                      data_ref: data
                      object: list
                    tracking_id: >-
                      track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==
                    order:
                      amount: 1000
                      discount_amount: 2
                      total_discount_amount: 2
                      total_amount: 998
                      applied_discount_amount: 2
                      total_applied_discount_amount: 2
                      metadata:
                        currency: USD
                      customer_id: null
                      referrer_id: null
                      object: order
                    code: GIFT-CARD-kW4aEsfB
                    gift:
                      amount: 32000
                      balance: 21500
                      effect: APPLY_TO_ORDER
                    metadata: {}
                    campaign: Gift Card Campaign
                    campaign_id: camp_ZjoZEdmnyUCPYwMPN0IVbvDK
                Cannot be redeemed by referrer:
                  value:
                    valid: false
                    reason: voucher cannot be redeemed by referrer
                    error:
                      code: 400
                      key: referrer_not_permitted_to_redeem
                      message: voucher cannot be redeemed by referrer
                      details: REFERRAL-CODE-OxBakPYf
                      request_id: v-0be43a8a110abb1bd3
                    tracking_id: >-
                      track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==
                    code: REFERRAL-CODE-OxBakPYf
                    metadata: {}
                Referral Code:
                  value:
                    valid: true
                    applicable_to:
                      data: []
                      total: 0
                      data_ref: data
                      object: list
                    inapplicable_to:
                      data: []
                      total: 0
                      data_ref: data
                      object: list
                    tracking_id: track_p6hPsnZj2VSvyXDjH9o6aQ==
                    order:
                      amount: 20000
                      discount_amount: 6000
                      total_discount_amount: 6000
                      total_amount: 14000
                      applied_discount_amount: 6000
                      total_applied_discount_amount: 6000
                      metadata:
                        currency: USD
                      referrer:
                        id: cust_nM4jqPiaXUvQdVSA6vTRUnix
                        object: customer
                      customer_id: null
                      referrer_id: cust_nM4jqPiaXUvQdVSA6vTRUnix
                      object: order
                    code: REFERRAL-CODE-OxBakPYf
                    discount:
                      type: PERCENT
                      effect: APPLY_TO_ORDER
                      percent_off: 30
                    metadata: {}
                    campaign: Referral Campaign
                    campaign_id: camp_TnOf5NB4Jtjxwoq38WckMJfy
        '400':
          description: Returns an error if request body is missing parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/e_error'
              examples:
                Missing reward:
                  value:
                    code: 400
                    key: missing_reward
                    message: Missing reward
                    details: A reward is required when redeeming a LOYALTY_CARD
                    request_id: v-0bcb925c6d90f7f8fc
                    error:
                      message: Missing reward = please add one.
                Missing Parameter:
                  value:
                    code: 400
                    key: missing_order_items_amount
                    message: Missing applicable order items
                    details: >-
                      At least one applicable order item with amount is required
                      to redeem this GIFT_VOUCHER
                    request_id: v-0bcccfd04085cf2540
                    error:
                      message: Request should contain an amount for the item.
                Metadata Validation Failed:
                  value:
                    code: 400
                    key: metadata_validation_failed
                    message: Metadata validation failed
                    details: >-
                      location_id: must be an array, and every element: must be
                      a string, must be equal to one of L1,L2,L3 (actual value
                      is 'L1')
                    request_id: v-0bcced27715305d3fa
      deprecated: true
      security:
        - X-App-Id: []
          X-App-Token: []
        - X-Voucherify-OAuth:
            - api
            - vouchers
components:
  schemas:
    ParameterCode:
      type: string
      example: 2CpRCE2c
    VouchersValidateRequestBody:
      title: Validate Voucher Request Body
      description: >-
        Request schema model for validating a voucher using **POST**
        `v1/vouchers/{code}/validate`.
      oneOf:
        - $ref: '#/components/schemas/VouchersValidateDiscountRequestBody'
        - $ref: '#/components/schemas/VouchersValidateGiftRequestBody'
        - $ref: '#/components/schemas/VouchersValidateLoyaltyRequestBody'
    VouchersValidateResponseBody:
      title: Vouchers Validate Response Body
      description: Response body schema for **POST** `v1/vouchers/{code}/validate`.
      oneOf:
        - $ref: '#/components/schemas/VouchersValidateValidResponseBody'
        - $ref: '#/components/schemas/VouchersValidateInvalidResponseBody'
    e_error:
      title: Error Object
      type: object
      description: Error details
      properties:
        code:
          type: integer
          description: Error's HTTP status code.
        key:
          type: string
          description: Short string describing the kind of error which occurred.
        message:
          type: string
          description: A human-readable message providing a short description of the error.
        details:
          type: string
          description: A human-readable message providing more details about the error.
        request_id:
          type: string
          example: v-0a885062c80375740f
          description: >-
            This ID is useful when troubleshooting and/or finding the root cause
            of an error response by our support team.
        error:
          type: object
          description: Contains custom user-defined error message translation.
          properties:
            message:
              type: string
              description: >-
                Error message translation defined in Dashboard &rarr; Project
                Settings &rarr; Error Messages
    VouchersValidateDiscountRequestBody:
      type: object
      title: Vouchers Validate Discount Request Body
      description: >-
        Request schema model for validating a voucher using **POST**
        `v1/vouchers/{code}/validate`.
      properties:
        customer:
          description: Customer's information.
          allOf:
            - $ref: '#/components/schemas/Customer'
        order:
          description: Order information.
          allOf:
            - $ref: '#/components/schemas/Order'
        session:
          description: >-
            Schema model for session lock object. The session object is required
            to establish a session between multiple parallel validation and
            redemption requests. If you only send the type parameter in the
            request, then by default the session lock will be established for 7
            days. Read more on establishing a validation session.
          allOf:
            - $ref: '#/components/schemas/Session'
        tracking_id:
          type: string
        metadata:
          type: object
        options:
          type: object
          properties:
            expand:
              type: array
              items:
                type: string
                default: category
                enum:
                  - category
    VouchersValidateGiftRequestBody:
      type: object
      title: Vouchers Validate Gift Request Body
      description: Request schema model for **POST** `v1/vouchers/{code}/validate`.
      properties:
        customer:
          description: Customer's information.
          allOf:
            - $ref: '#/components/schemas/Customer'
        order:
          type: object
          description: Order information.
          properties:
            id:
              type: string
              description: >+
                Unique ID assigned by Voucherify of an existing order that will
                be linked to the redemption of this request.

            source_id:
              type: string
              description: >-
                Unique source ID of an existing order that will be linked to the
                redemption of this request.
            status:
              type: string
              description: The order status.
              enum:
                - CREATED
                - PAID
                - CANCELED
                - FULFILLED
            amount:
              type: string
              description: >-
                A positive integer in the smallest currency unit (e.g. 100 cents
                for $1.00) representing the total amount of the order. This is
                the sum of the order items' amounts.
            items:
              type: array
              description: Array of items applied to the order.
              items:
                $ref: '#/components/schemas/OrderItem'
            customer:
              description: This is an object containing information about the customer.
              allOf:
                - $ref: '#/components/schemas/Customer'
            customer_id:
              type: string
            referrer:
              description: This is an ojbect containing information about the referrer.
              allOf:
                - $ref: '#/components/schemas/Referrer'
            referrer_id:
              type: string
            metadata:
              type: object
              description: >-
                A set of custom key/value pairs that you can attach to an order.
                It can be useful for storing additional information about the
                order in a structured format.
        gift:
          type: object
          description: >-
            Contains information on the number of gift card credits that the
            customer wants to apply to the order.
          properties:
            credits:
              type: number
              minimum: 0
              description: >-
                The number of credits that the user wants to use from the gift
                card to fulfil the order. The value of credits cannot be higher
                than the current balance on the gift card. If the user gives
                more points than he has on the gift card, the application will
                return an error code in response. The value is multiplied by 100
                to represent 2 decimal places. For example `10000 cents` for
                `$100.00`.
          required:
            - credits
        session:
          description: >-
            Schema model for session lock object. The session object is required
            to establish a session between multiple parallel validation and
            redemption requests. If you only send the type parameter in the
            request, then by default the session lock will be established for 7
            days. Read more on establishing a validation session.
          allOf:
            - $ref: '#/components/schemas/Session'
        tracking_id:
          type: string
        metadata:
          type: object
        options:
          type: object
          properties:
            expand:
              type: array
              items:
                type: string
                default: category
                enum:
                  - category
      required:
        - gift
    VouchersValidateLoyaltyRequestBody:
      type: object
      title: Vouchers Validate Loyalty Request Body
      description: Request schema model for **POST** `v1/vouchers/{code}/validate`.
      properties:
        customer:
          description: Customer's information.
          allOf:
            - $ref: '#/components/schemas/Customer'
        order:
          type: object
          description: Order information.
          properties:
            id:
              type: string
              description: >+
                Unique ID assigned by Voucherify of an existing order that will
                be linked to the redemption of this request.

            source_id:
              type: string
              description: >-
                Unique source ID of an existing order that will be linked to the
                redemption of this request.
            status:
              type: string
              description: The order status.
              enum:
                - CREATED
                - PAID
                - CANCELED
                - FULFILLED
            amount:
              type: string
              description: >+
                A positive integer in the smallest currency unit (e.g. 100 cents
                for $1.00) representing the total amount of the order. This is
                the sum of the order items' amounts.

            items:
              type: array
              description: Array of items applied to the order.
              items:
                $ref: '#/components/schemas/OrderItem'
            customer:
              description: This is an object containing information about the customer.
              allOf:
                - $ref: '#/components/schemas/Customer'
            customer_id:
              type: string
            referrer:
              description: This is an ojbect containing information about the referrer.
              allOf:
                - $ref: '#/components/schemas/Referrer'
            referrer_id:
              type: string
            metadata:
              type: object
              description: >-
                A set of custom key/value pairs that you can attach to an order.
                It can be useful for storing additional information about the
                order in a structured format.
        reward:
          type: object
          description: >-
            Contains information about the reward that the customer wants to
            redeem and the number of points the customer is choosing to use for
            the reward.
          properties:
            id:
              type: string
              description: >-
                Unique reward ID assigned by Voucherify. The reward must be
                assigned to the campaign in order for the user to be able to use
                the reward.
            assignment_id:
              type: string
            points:
              type: number
              description: >-
                The number of loyalty points that the user wants to spend in
                order to fulfill the order. The number of points cannot be
                higher than the current balance on the loyalty card. If the user
                gives more points than he/she has on the loyalty card, the
                application will return an error code in response.
          required:
            - id
        session:
          description: >-
            Schema model for session lock object. The session object is required
            to establish a session between multiple parallel validation and
            redemption requests. If you only send the type parameter in the
            request, then by default the session lock will be established for 7
            days. Read more on establishing a validation session.
          allOf:
            - $ref: '#/components/schemas/Session'
        tracking_id:
          type: string
        metadata:
          type: object
        options:
          type: object
          properties:
            expand:
              type: array
              items:
                type: string
                default: category
                enum:
                  - category
      required:
        - reward
    VouchersValidateValidResponseBody:
      type: object
      description: Response body schema for **POST** `v1/vouchers/{code}/validate`.
      title: Vouchers Validate Valid Response Body
      properties:
        valid:
          type: boolean
          default: true
          description: >-
            Indicates whether the voucher is valid within the context of the
            parameters provided in the request body.
        code:
          type: string
          description: Voucher code.
        applicable_to:
          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.
          allOf:
            - $ref: '#/components/schemas/ApplicableToResultList'
        inapplicable_to:
          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.
          allOf:
            - $ref: '#/components/schemas/InapplicableToResultList'
        campaign:
          type: string
          description: Voucher's parent campaign name.
        campaign_id:
          type: string
          description: Voucher's parent campaign's unique ID.
        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.
        discount:
          $ref: '#/components/schemas/Discount'
        gift:
          description: Gift object response
          allOf:
            - $ref: '#/components/schemas/Gift'
        loyalty:
          type: object
          description: Contains the cost of reward in points.
          properties:
            points_cost:
              type: number
              description: >-
                Number of points that wlil be deducted from loyaty card for the
                associated reward.
          required:
            - points_cost
        reward:
          type: object
          description: Contains information about the reward that is being validated.
          properties:
            id:
              type: string
              description: Unique reward ID assigned by Voucherify.
            assignment_id:
              type: string
              description: Unique reward assignment ID assigned by Voucherify.
            points:
              type: number
              description: Number of points applied to the reward.
          required:
            - id
            - assignment_id
            - points
        order:
          allOf:
            - $ref: '#/components/schemas/OrderCalculated'
            - type: object
              properties:
                items:
                  type: array
                  description: >-
                    Array of items applied to the order. It can include up to
                    500 items.
                  items:
                    $ref: '#/components/schemas/OrderCalculatedItem'
        session:
          description: >+
            Schema model for session lock object. The session object contains
            information about the session key that was used to establish a
            session between multiple parallel validation and redemption
            requests.


          allOf:
            - $ref: '#/components/schemas/Session'
        start_date:
          type: string
          description: >-
            Activation timestamp defines when the voucher starts to be active in
            ISO 8601 format. Voucher is inactive before this date.
        expiration_date:
          type: string
          description: >-
            Expiration timestamp defines when the voucher expires in ISO 8601
            format. Voucher is inactive after this date.
        tracking_id:
          type: string
          description: Hashed order source ID.
      required:
        - valid
        - code
        - applicable_to
        - inapplicable_to
        - metadata
        - tracking_id
    VouchersValidateInvalidResponseBody:
      type: object
      title: Vouchers Validate Invalid Response Body
      description: Response body schema for **POST** `v1/vouchers/{code}/validate`.
      properties:
        valid:
          type: boolean
          default: false
          description: >-
            Indicates whether the voucher is valid within the context of the
            parameters provided in the request body.
        code:
          type: string
          description: Voucher code.
        error:
          type: object
          description: >-
            Detailed failure cause for the invalid voucher if the reason has a
            translation defined in the Dashboard → Project Settings → Error
            Messages.
          properties:
            code:
              type: number
              description: Voucher code.
            key:
              type: string
            message:
              type: string
              description: Customized error message.
            details:
              type: string
            request_id:
              type: string
            resource_id:
              type: string
            resource_type:
              type: string
          required:
            - code
            - key
            - message
            - details
        tracking_id:
          type: string
          description: Hashed customer source ID.
        customer_id:
          type: string
          description: >-
            Unique customer identifier of the customer making the purchase. The
            ID is assigned by Voucherify.
        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.
        reason:
          type: string
      required:
        - valid
        - code
    Customer:
      title: Customer
      allOf:
        - type: object
          title: Customer Id And Source Id
          properties:
            id:
              type: string
              description: The ID of an existing customer.
            source_id:
              type: string
              description: >-
                A unique identifier of the customer who validates a voucher. It
                can be a customer ID or email from a CRM system, database, or a
                third-party service. If you also pass a customer ID (unique ID
                assigned by Voucherify), the source ID will be ignored.
        - $ref: '#/components/schemas/CustomerBase'
    Order:
      title: Order
      type: object
      description: Order information.
      allOf:
        - type: object
          properties:
            id:
              type: string
              description: >-
                Unique ID assigned by Voucherify of an existing order that will
                be linked to the redemption of this request.
        - $ref: '#/components/schemas/OrderBase'
    Session:
      type: object
      title: Session
      properties:
        key:
          type: string
          description: >-
            The session unique ID assigned by Voucherify or your own unique
            session ID. Sending an existing ID will result in overwriting an
            existing session. If no session key is provided, then a new ID will
            be generated.
        type:
          type: string
          default: LOCK
          enum:
            - LOCK
          description: This parameter is required to establish a new session.
        ttl:
          type: number
          description: >-
            Value for the period of time that the session is active. Units for
            this parameter are defined by the session.ttl_unit parameter.
        ttl_unit:
          type: string
          enum:
            - DAYS
            - HOURS
            - MICROSECONDS
            - MILLISECONDS
            - MINUTES
            - NANOSECONDS
            - SECONDS
          description: Defines the type of unit in which the session time is counted.
    OrderItem:
      type: object
      title: Order Item
      properties:
        sku_id:
          type: string
          description: Unique identifier of the SKU. It is assigned by Voucherify.
        product_id:
          type: string
          description: Unique identifier of the product. It is assigned by Voucherify.
        related_object:
          type: string
          enum:
            - product
            - sku
          description: >-
            Used along with the source_id property, can be set to either sku or
            product.
        source_id:
          type: string
          description: >-
            The merchant's product/SKU ID (if it is different from the
            Voucherify product/SKU ID). It is useful in the integration between
            multiple systems. It can be an ID from an eCommerce site, a
            database, or a third-party service.
        quantity:
          type: integer
          description: The quantity of the particular item in the cart.
        discount_quantity:
          type: integer
          description: Number of dicounted items.
        initial_quantity:
          type: integer
          description: >-
            A positive integer in the smallest unit quantity representing the
            total amount of the order; this is the sum of the order items'
            quantity.
        amount:
          type: integer
          description: The total amount of the order item (price * quantity).
        discount_amount:
          type: integer
          description: Sum of all order-item-level discounts applied to the order.
        initial_amount:
          type: integer
          description: >-
            A positive integer in the smallest currency unit (e.g. 100 cents for
            $1.00) representing the total amount of the order. This is the sum
            of the order items' amounts.
        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`.
        product:
          type: object
          description: An object containing details of the related product.
          properties:
            id:
              type: string
              description: >-
                A unique identifier that represents the product and is assigned
                by Voucherify.
            source_id:
              type: string
              description: >-
                The merchant's product ID (if it is different than Voucherify's
                product ID). It is really useful in case of integration between
                multiple systems. It can be an ID from an eCommerce site, a
                database or a 3rd party service.
            override:
              type: boolean
              description: >-
                The override set to `true` is used to store the product
                information in the system. If the product does not exist, it
                will be created with a source_id; if it does exist, the provided
                values for the name, price, and metadata will replace those
                already stored in the system. Override works only for endpoints
                that create an order in the database.
            name:
              type: string
              description: Product name.
            metadata:
              type: object
              description: >-
                A set of custom key/value pairs that you can attach to a
                product. It can be useful for storing additional information
                about the product in a structured format. It can be used to
                create product collections.
            price:
              type: number
              description: >-
                Product price. A positive integer in the smallest currency unit
                (e.g. 100 cents for $1.00).
        sku:
          type: object
          description: An object containing details of the related SKU.
          properties:
            id:
              type: string
              description: >-
                A unique identifier that represents the SKU and is assigned by
                Voucherify.
            source_id:
              type: string
              description: >-
                The merchant's SKU ID (if it is different than Voucherify's SKU
                ID). It is really useful in case of integration between multiple
                systems. It can be an ID from an eCommerce site, a database or a
                3rd party service.
            override:
              type: boolean
              description: >-
                The override set to `true` is used to store the product
                information in the system. If the product does not exist, it
                will be created with a source_id; if it does exist, the provided
                values for the name, price, and metadata will replace those
                already stored in the system.
            sku:
              type: string
              description: The SKU name.
            price:
              type: number
              description: >-
                SKU price. A positive integer in the smallest currency unit
                (e.g. 100 cents for $1.00).
            metadata:
              type: object
              description: >-
                A set of custom key/value pairs that you can attach to an order
                item. It can be useful for storing additional information about
                the order item in a structured format. It can be used to create
                product collections.
        metadata:
          type: object
          description: >-
            A set of custom key/value pairs that you can attach to an order
            item. It can be useful for storing additional information about the
            order item in a structured format. It can be used to define business
            validation rules.
      required:
        - object
    Referrer:
      title: Referrer
      allOf:
        - $ref: '#/components/schemas/Customer'
    ApplicableToResultList:
      title: Applicable To Result List
      type: object
      properties:
        data:
          type: array
          description: Contains array of items to which the discount can apply.
          items:
            $ref: '#/components/schemas/ApplicableTo'
        total:
          type: integer
          minimum: 0
          description: >-
            Total number of objects defining included products, SKUs, or product
            collections.
        object:
          type: string
          default: list
          enum:
            - list
          description: The type of the object represented by JSON.
        data_ref:
          type: string
          description: The type of the object represented by JSON.
          default: data
          enum:
            - data
      required:
        - data
        - total
        - object
        - data_ref
    InapplicableToResultList:
      title: Inapplicable To Result List
      type: object
      properties:
        data:
          type: array
          description: Contains array of items to which the discount cannot apply.
          items:
            $ref: '#/components/schemas/InapplicableTo'
        total:
          type: integer
          minimum: 0
          description: >-
            Total number of objects defining included products, SKUs, or product
            collections.
        object:
          type: string
          default: list
          enum:
            - list
          description: The type of the object represented by JSON.
        data_ref:
          type: string
          description: The type of the object represented by JSON.
          default: data
          enum:
            - data
      required:
        - data
        - total
        - object
        - data_ref
    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'
    Gift:
      title: Gift
      type: object
      description: Contains current gift card balance information.
      properties:
        amount:
          type: number
          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.
        balance:
          type: number
          description: >-
            Available funds. The value is multiplied by 100 to represent 2
            decimal places. For example `10000 cents` for `$100.00`. `balance` =
            `amount` - `subtracted_amount` - `redemption.redeemed_amount`.
        effect:
          type: string
          description: Defines how the credits are applied to the customer's order.
          enum:
            - APPLY_TO_ORDER
            - APPLY_TO_ITEMS
      required:
        - amount
        - balance
    OrderCalculated:
      title: Order Calculated No Customer Data
      type: object
      description: Order information.
      properties:
        id:
          type: string
          description: >-
            Unique ID assigned by Voucherify of an existing order that will be
            linked to the redemption of this request.
        source_id:
          type: string
          nullable: true
          description: >-
            Unique source ID of an existing order that will be linked to the
            redemption of this request.
        status:
          type: string
          description: The order status.
          enum:
            - CREATED
            - PAID
            - CANCELED
            - FULFILLED
        amount:
          type: integer
          description: >-
            This is the sum of the order items' amounts. It is expressed as an
            integer in the smallest currency unit (e.g. 100 cents for $1.00).
        initial_amount:
          type: integer
          description: >-
            This is the sum of the order items' amounts before any discount or
            other effect (e.g. add missing units) is applied. It is expressed as
            an integer in the smallest currency unit (e.g. 100 cents for $1.00).
        discount_amount:
          type: integer
          description: >-
            Sum of all order-level discounts applied to the order. It is
            expressed as an integer in the smallest currency unit (e.g. 100
            cents for $1.00).
        items_discount_amount:
          type: integer
          description: >-
            Sum of all product-specific discounts applied to the order. It is
            expressed as an integer in the smallest currency unit (e.g. 100
            cents for $1.00).
        total_discount_amount:
          type: integer
          description: >-
            Sum of all order-level AND all product-specific discounts applied to
            the order. It is expressed as an integer in the smallest currency
            unit (e.g. 100 cents for $1.00).
        total_amount:
          type: integer
          description: >-
            Order amount after undoing all the discounts through the rollback
            redemption. It is expressed as an integer in the smallest currency
            unit (e.g. 100 cents for $1.00).
        applied_discount_amount:
          type: integer
          description: >-
            This field shows the order-level discount applied. It is expressed
            as an integer in the smallest currency unit (e.g. 100 cents for
            $1.00).
        items_applied_discount_amount:
          type: integer
          description: >-
            Sum of all product-specific discounts applied in a particular
            request. It is expressed as an integer in the smallest currency unit
            (e.g. 100 cents for $1.00).  

            `sum(items, i => i.applied_discount_amount)`
        total_applied_discount_amount:
          type: integer
          description: >-
            Sum of all order-level AND all product-specific discounts applied in
            a particular request. It is expressed as an integer in the smallest
            currency unit (e.g. 100 cents for $1.00).  

            `total_applied_discount_amount` = `applied_discount_amount` +
            `items_applied_discount_amount`
        metadata:
          type: object
          description: >-
            A set of custom key/value pairs that you can attach to an order. It
            can be useful for storing additional information about the order in
            a structured format. It can be used to define business validation
            rules or discount formulas.
        object:
          type: string
          description: The type of the object represented by JSON.
          default: order
          enum:
            - order
        created_at:
          type: string
          example: '2021-12-22T10:13:06.487Z'
          description: >-
            Timestamp representing the date and time when the order was created.
            The value is shown in the ISO 8601 format.
          format: date-time
        updated_at:
          type: string
          nullable: true
          example: '2021-12-22T10:14:45.316Z'
          format: date-time
          description: >-
            Timestamp representing the date and time when the order was last
            updated in ISO 8601 format.
        customer_id:
          type: string
          nullable: true
          description: >-
            Unique customer identifier of the customer making the purchase. The
            ID is assigned by Voucherify.
          example: cust_7iUa6ICKyU6gH40dBU25kQU1
        referrer_id:
          type: string
          nullable: true
          description: Unique referrer ID.
          example: cust_nM4jqPiaXUvQdVSA6vTRUnix
        customer:
          allOf:
            - $ref: '#/components/schemas/CustomerId'
        referrer:
          allOf:
            - $ref: '#/components/schemas/ReferrerId'
        redemptions:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/OrderRedemptionsEntry'
    OrderCalculatedItem:
      type: object
      title: Order Item Calculated
      properties:
        id:
          type: string
          description: Unique identifier of the order line item.
        sku_id:
          type: string
          description: Unique identifier of the SKU. It is assigned by Voucherify.
        product_id:
          type: string
          description: Unique identifier of the product. It is assigned by Voucherify.
        related_object:
          type: string
          enum:
            - product
            - sku
          description: >-
            Used along with the source_id property, can be set to either sku or
            product.
        source_id:
          type: string
          description: >-
            The merchant's product/SKU ID (if it is different from the
            Voucherify product/SKU ID). It is useful in the integration between
            multiple systems. It can be an ID from an eCommerce site, a
            database, or a third-party service.
        quantity:
          type: integer
          description: The quantity of the particular item in the cart.
        discount_quantity:
          type: integer
          description: Number of dicounted items.
        initial_quantity:
          type: integer
          description: >-
            A positive integer in the smallest unit quantity representing the
            total amount of the order; this is the sum of the order items'
            quantity.
        amount:
          type: integer
          description: The total amount of the order item (price * quantity).
        discount_amount:
          type: integer
          description: Sum of all order-item-level discounts applied to the order.
        applied_discount_amount:
          type: integer
          description: This field shows the order-level discount applied.
        applied_discount_quantity:
          type: integer
          description: Number of the discounted items applied in the transaction.
        applied_quantity:
          type: integer
          description: >-
            Quantity of items changed by the application of a new quantity
            items. It can be positive when an item is added or negative if an
            item is replaced.
        applied_quantity_amount:
          type: integer
          description: >-
            Amount for the items changed by the application of a new quantity
            items. It can be positive when an item is added or negative if an
            item is replaced.
        initial_amount:
          type: integer
          description: >-
            A positive integer in the smallest currency unit (e.g. 100 cents for
            $1.00) representing the total amount of the order. This is the sum
            of the order items' amounts.
        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`.
        subtotal_amount:
          type: integer
          description: >-
            Final order item amount after the applied item-level discount.  If
            there are no item-level discounts applied, this item is equal to the
            `amount`.   

            `subtotal_amount`=`amount`-`applied_discount_amount`
        product:
          type: object
          description: An object containing details of the related product.
          properties:
            id:
              type: string
              description: >-
                A unique identifier that represents the product and is assigned
                by Voucherify.
            source_id:
              type: string
              description: >-
                The merchant's product ID (if it is different than Voucherify's
                product ID). It is really useful in case of integration between
                multiple systems. It can be an ID from an eCommerce site, a
                database or a 3rd party service.
            override:
              type: boolean
              description: >-
                The override set to `true` is used to store the product
                information in the system. If the product does not exist, it
                will be created with a source_id; if it does exist, the provided
                values for the name, price, and metadata will replace those
                already stored in the system.
            name:
              type: string
              description: Product name.
            metadata:
              type: object
              description: >-
                A set of custom key/value pairs that you can attach to a
                product. It can be useful for storing additional information
                about the product in a structured format. It can be used to
                create product collections.
            price:
              type: number
              description: >-
                Product price. A positive integer in the smallest currency unit
                (e.g. 100 cents for $1.00).
        sku:
          type: object
          description: An object containing details of the related SKU.
          properties:
            id:
              type: string
              description: >-
                A unique identifier that represents the SKU and is assigned by
                Voucherify.
            source_id:
              type: string
              description: >-
                The merchant's SKU ID (if it is different than Voucherify's SKU
                ID). It is really useful in case of integration between multiple
                systems. It can be an ID from an eCommerce site, a database or a
                3rd party service.
            override:
              type: boolean
              description: >-
                The override set to `true` is used to store the product
                information in the system. If the product does not exist, it
                will be created with a source_id; if it does exist, the provided
                values for the name, price, and metadata will replace those
                already stored in the system.
            sku:
              type: string
              description: The SKU name.
            price:
              type: number
              description: >-
                SKU price. A positive integer in the smallest currency unit
                (e.g. 100 cents for $1.00).
            metadata:
              type: object
              description: >-
                A set of custom key/value pairs that you can attach to an SKU.
                It can be useful for storing additional information about the
                SKU in a structured format. It can be used to create product
                collections.
        object:
          type: string
          default: order_item
          enum:
            - order_item
          description: The type of the object represented by JSON.
        metadata:
          type: object
          description: >-
            A set of custom key/value pairs that you can attach to an item
            object. It can be useful for storing additional information about
            the item in a structured format. It can be used to define business
            validation rules or discount formulas.
      required:
        - object
    CustomerBase:
      title: Customer Base
      type: object
      properties:
        name:
          type: string
          description: Customer's first and last name.
        description:
          type: string
          description: An arbitrary string that you can attach to a customer object.
        email:
          type: string
          description: Customer's email address.
        phone:
          type: string
          description: >-
            Customer's phone number. This parameter is mandatory when you try to
            send out codes to customers via an SMS channel.
        birthday:
          type: string
          description: '`Deprecated`. ~~Customer''s birthdate; format YYYY-MM-DD~~.'
          format: date
        birthdate:
          type: string
          description: Customer's birthdate; format YYYY-MM-DD.
          format: date
        address:
          type: object
          nullable: true
          description: Customer's address.
          properties:
            city:
              type: string
              description: City
            state:
              type: string
              description: State
            line_1:
              type: string
              description: First line of address.
            line_2:
              type: string
              description: Second line of address.
            country:
              type: string
              description: Country.
            postal_code:
              type: string
              description: Postal code.
        metadata:
          type: object
          description: >-
            A set of custom key/value pairs that you can attach to a customer.
            The metadata object stores all custom attributes assigned to the
            customer. It can be useful for storing additional information about
            the customer in a structured format. This metadata can be used for
            validating whether the customer qualifies for a discount or it can
            be used in building customer segments.
    OrderBase:
      title: Order Base
      type: object
      description: Order information.
      properties:
        source_id:
          type: string
          nullable: true
          description: >-
            Unique source ID of an existing order that will be linked to the
            redemption of this request.


            For validation and redemption, if `source_id` is used with an
            existing order, the original order data will be used, like `items`,
            `amount`, and so on, not the one sent in the new request.
        status:
          type: string
          description: The order status.
          enum:
            - CREATED
            - PAID
            - CANCELED
            - FULFILLED
        amount:
          type: integer
          description: >-
            A positive integer in the smallest currency unit (e.g. 100 cents for
            $1.00) representing the total amount of the order. This is the sum
            of the order items' amounts.
        initial_amount:
          type: integer
          description: >-
            A positive integer in the smallest currency unit (e.g. 100 cents for
            $1.00) representing the total amount of the order. This is the sum
            of the order items' amounts.
        discount_amount:
          type: integer
          description: >-
            Sum of all order-level discounts applied to the order. It is
            expressed as an integer in the smallest currency unit (e.g. 100
            cents for $1.00).
        items:
          type: array
          description: Array of items applied to the order. It can include up to 500 items.
          items:
            $ref: '#/components/schemas/OrderItem'
        metadata:
          type: object
          description: >-
            A set of custom key/value pairs that you can attach to an order. It
            can be useful for storing additional information about the order in
            a structured format. It can be used to define business validation
            rules or discount formulas.
    ApplicableTo:
      title: Applicable To
      type: object
      properties:
        object:
          type: string
          enum:
            - product
            - sku
            - products_collection
          description: >-
            This object stores information about the resource to which the
            discount is applicable.
        id:
          type: string
          description: >-
            Unique product collection, product, or SKU identifier assigned by
            Voucherify.
        source_id:
          type: string
          description: The source identifier 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: number
          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: number
          description: >-
            Formula used to dynamically calculate the discounted price of an
            item.
        effect:
          description: Defines how the discount is applied to the customer's order.
          allOf:
            - $ref: '#/components/schemas/ApplicableToEffect'
        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.
        amount_limit:
          type: integer
          description: >-
            Upper limit allowed to be applied as a discount per order line item.
            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. Value is multiplied by 100 to
            precisely represent 2 decimal places. For example, a $6 maximum
            discount on the entire order is written as 600. This value is
            definable for the following discount effects:

            - `APPLY_TO_ITEMS` (each item subtotal is discounted equally)

            - `APPLY_TO_ITEMS_BY_QUANTITY` (each unit of matched products has
            the same discount value)
        product_campaign_quantity_limit:
          type: integer
          description: >-
            Limits the number of discounted item units (product, SKU,
            collection) that all customers can receive in a given campaign. If a
            product is selected, the limit covers all discounts across all SKUs
            belonging to that product. If a product collection is selected, the
            limit covers all products/SKUs within the collection.


            This limit is available on demand as part of campaign budget limits.
            Contact [Voucherify
            support](https://www.voucherify.io/contact-support) or your account
            manager to learn more.
        product_campaign_quantity_limit_formula:
          type: string
          description: >-
            Formula used to dynamically calculate the maximum units per
            campaign.


            This limit is available on demand as part of campaign budget limits.
            Contact [Voucherify
            support](https://www.voucherify.io/contact-support) or your account
            manager to learn more.
        product_customer_campaign_quantity_limit:
          type: integer
          description: >-
            Limits the number of discounted item units (product, SKU,
            collection) that one customer can receive in a given campaign.


            This limit is available on demand as part of campaign budget limits.
            Contact [Voucherify
            support](https://www.voucherify.io/contact-support) or your account
            manager to learn more.
        product_customer_campaign_quantity_limit_formula:
          type: string
          description: >-
            Formula used to dynamically calculate the maximum units per customer
            in a campaign.


            This limit is available on demand as part of campaign budget limits.
            Contact [Voucherify
            support](https://www.voucherify.io/contact-support) or your account
            manager to learn more.
        product_in_collection_campaign_quantity_limit:
          type: integer
          description: >-
            Limits the number of discounted item units of a given product in a
            collection that all customers can receive in a given campaign.


            This limit is available on demand as part of campaign budget limits.
            Contact [Voucherify
            support](https://www.voucherify.io/contact-support) or your account
            manager to learn more.
        product_in_collection_campaign_quantity_limit_formula:
          type: string
          description: >-
            Formula used to dynamically calculate the maximum units per campaign
            for a product in a collection.


            This limit is available on demand as part of campaign budget limits.
            Contact [Voucherify
            support](https://www.voucherify.io/contact-support) or your account
            manager to learn more.
        product_in_collection_customer_campaign_quantity_limit:
          type: integer
          description: >-
            Limits the number of discounted item units of a given product in a
            collection that one customer can receive in a campaign.


            This limit is available on demand as part of campaign budget limits.
            Contact [Voucherify
            support](https://www.voucherify.io/contact-support) or your account
            manager to learn more.
        product_in_collection_customer_campaign_quantity_limit_formula:
          type: string
          description: >-
            Formula used to dynamically calculate the maximum units per customer
            for a product in a collection.


            This limit is available on demand as part of campaign budget limits.
            Contact [Voucherify
            support](https://www.voucherify.io/contact-support) or your account
            manager to learn more.
        product_promotion_tier_quantity_limit:
          type: integer
          description: >-
            Limits the number of discounted item units that all customers can
            receive in a promotion tier.


            This limit is available on demand as part of campaign budget limits.
            Contact [Voucherify
            support](https://www.voucherify.io/contact-support) or your account
            manager to learn more.
        product_promotion_tier_quantity_limit_formula:
          type: string
          description: >-
            Formula used to dynamically calculate the maximum units per
            promotion tier.


            This limit is available on demand as part of campaign budget limits.
            Contact [Voucherify
            support](https://www.voucherify.io/contact-support) or your account
            manager to learn more.
        product_customer_promotion_tier_quantity_limit:
          type: integer
          description: >-
            Limits the number of discounted item units that one customer can
            receive in a given promotion tier.


            This limit is available on demand as part of campaign budget limits.
            Contact [Voucherify
            support](https://www.voucherify.io/contact-support) or your account
            manager to learn more.
        product_customer_promotion_tier_quantity_limit_formula:
          type: string
          description: >-
            Formula used to dynamically calculate the maximum units per customer
            in a promotion tier.


            This limit is available on demand as part of campaign budget limits.
            Contact [Voucherify
            support](https://www.voucherify.io/contact-support) or your account
            manager to learn more.
        product_in_collection_promotion_tier_quantity_limit:
          type: integer
          description: >-
            Limits the number of discounted item units of a given product in a
            collection that all customers can receive in a given promotion tier.


            This limit is available on demand as part of campaign budget limits.
            Contact [Voucherify
            support](https://www.voucherify.io/contact-support) or your account
            manager to learn more.
        product_in_collection_promotion_tier_quantity_limit_formula:
          type: string
          description: >-
            Formula used to dynamically calculate the maximum units per
            promotion tier for a product in a collection.


            This limit is available on demand as part of campaign budget limits.
            Contact [Voucherify
            support](https://www.voucherify.io/contact-support) or your account
            manager to learn more.
        product_in_collection_customer_promotion_tier_quantity_limit:
          type: integer
          description: >-
            Limits the number of discounted item units of a given product in a
            collection that one customer can receive in a promotion tier.


            This limit is available on demand as part of campaign budget limits.
            Contact [Voucherify
            support](https://www.voucherify.io/contact-support) or your account
            manager to learn more.
        product_in_collection_customer_promotion_tier_quantity_limit_formula:
          type: string
          description: >-
            Formula used to dynamically calculate the maximum units per customer
            in a promotion tier for a product in a collection.


            This limit is available on demand as part of campaign budget limits.
            Contact [Voucherify
            support](https://www.voucherify.io/contact-support) or your account
            manager to learn more.
        order_item_indices:
          type: array
          description: >-
            Lists which order lines are (not) covered by the discount. The order
            in the array is determined by the sequence of applied discounts,
            while the numbers correspond to the order lines sent in the `order`
            object in the request. The first order line is assigned `0`, the
            second order line is assigned `1`, and so on.
          items:
            type: integer
        order_item_units:
          type: array
          description: >-
            Lists which units within order lines are covered by the discount.
            The order line items are listed according to sequence of applied
            discounts while the `index` corresponds to the order line sent in
            the `order` object in the request.
          items:
            type: object
            properties:
              index:
                type: integer
                description: >-
                  Number assigned to the order line item in accordance with the
                  order sent in the request.
                minimum: 0
              units:
                type: array
                description: >-
                  Numbers of units in the order line covered by the discount;
                  e.g. `2, 5, 8` for 10 units with the setting
                  `"skip_initially": 1`, `"repeat": 3`. The counting of units
                  starts from `1`. The maximum quantity of all handled units is
                  1000. If the quantity of all order items exceeds 1000, this
                  array is not returned, but `units_limit_exceeded: true`.
                  However, the discount is calculated properly for all relevant
                  units.
                items:
                  type: integer
              units_limit_exceeded:
                type: boolean
                description: >-
                  Returned as `true` only when the sum total of `quantity` of
                  all order items exceeds 1000.
        repeat:
          type: integer
          description: >-
            Determines the recurrence of the discount, e.g. `"repeat": 3` means
            that the discount is applied to every third item.
        skip_initially:
          type: integer
          description: >-
            Determines how many items are skipped before the discount is
            applied.
        target:
          type: string
          description: >-
            Determines to which kinds of objects the discount is applicable.
            `ITEM` includes products and SKUs. `UNIT` means particular units
            within an order line.
          enum:
            - ITEM
            - UNIT
      required:
        - object
        - id
        - effect
    InapplicableTo:
      title: Inapplicable To
      type: object
      allOf:
        - $ref: '#/components/schemas/ApplicableTo'
    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
    CustomerId:
      title: Customer Id
      type: object
      properties:
        id:
          type: string
          description: A unique identifier of an existing customer.
        object:
          type: string
          description: The type of the object represented by JSON.
          default: customer
          enum:
            - customer
      required:
        - id
        - object
    ReferrerId:
      title: Referrer Id
      allOf:
        - $ref: '#/components/schemas/CustomerId'
    OrderRedemptionsEntry:
      title: Order Redemptions
      type: object
      properties:
        date:
          type: string
          description: >-
            Timestamp representing the date and time when the redemption was
            created. The value is shown in the ISO 8601 format.
          example: '2022-09-02T17:06:56.649Z'
          format: date-time
        rollback_id:
          type: string
          description: Unique ID of the redemption rollback.
          example: rr_0c63c84eb78ee0a6c0
        rollback_date:
          type: string
          description: >-
            Timestamp representing the date and time when the redemption
            rollback was created. The value is shown in the ISO 8601 format.
          example: '2023-01-31T14:18:37.150Z'
          format: date-time
        related_object_type:
          type: string
          description: The source of the incentive.
          default: redemption
        related_object_id:
          type: string
          description: Unique ID of the parent redemption.
          example: r_0ba186c4824e4881e1
        related_object_parent_id:
          type: string
          description: >-
            Represent's the campaign ID of the voucher if the redemption was
            based on a voucher that was part of bulk codes generated within a
            campaign. In case of a promotion tier, this represents the campaign
            ID of the promotion tier's parent campaign.
        stacked:
          type: array
          description: >-
            Contains a list of unique IDs of child redemptions, which belong to
            the stacked incentives.
          items:
            type: string
        rollback_stacked:
          type: array
          description: >-
            Lists the rollback redemption IDs of the particular child
            redemptions.
          items:
            type: string
    ApplicableToEffect:
      title: Applicable To Effect
      type: string
      enum:
        - APPLY_TO_EVERY
        - APPLY_TO_CHEAPEST
        - APPLY_FROM_CHEAPEST
        - APPLY_TO_MOST_EXPENSIVE
        - APPLY_FROM_MOST_EXPENSIVE
    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`.

````