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

# Redeem Voucher (client-side)

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

To redeem a voucher, you need to create a redemption object. It increments the redemption counter and updates the history of the voucher. This method is accessible through public keys, which you can use in client-side apps (mobile and web browser apps). 

The client-side redemption works similar to the server-side [voucher redemption](/api-reference/redemptions/redeem-voucher) endpoint. The difference lies in the authorization. For the client-side, you can use client-side keys.


> 📘 Opt-in  
>
> By default this feature is disabled. If you want to use it, you will need to enable the function explicitly in **Project Settings**.


> ❗️ Security Threat  
>
> Be careful if you want to include the voucher redemption functionality directly on your client side (website or mobile app). In this configuration, there is a chance that discounts can be modified before being sent to the server.

### Expand Response
You may expand the response by adding the following object to your request body. The expanded response will include the category details of the voucher.

```json
{
    "options": {
        "expand": [
            "category"
        ]
    }
}
```



## OpenAPI

````yaml /openapi/client-side.json post /client/v1/redeem
openapi: 3.0.1
info:
  title: Voucherify API - Client-side
  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:
  /client/v1/redeem:
    post:
      tags:
        - Client-side
      summary: Redeem Voucher (client-side)
      description: >-

        > ❗️ Deprecated  

        >

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


        To redeem a voucher, you need to create a redemption object. It
        increments the redemption counter and updates the history of the
        voucher. This method is accessible through public keys, which you can
        use in client-side apps (mobile and web browser apps). 


        The client-side redemption works similar to the server-side [voucher
        redemption](/api-reference/redemptions/redeem-voucher) endpoint. The
        difference lies in the authorization. For the client-side, you can use
        client-side keys.



        > 📘 Opt-in  

        >

        > By default this feature is disabled. If you want to use it, you will
        need to enable the function explicitly in **Project Settings**.



        > ❗️ Security Threat  

        >

        > Be careful if you want to include the voucher redemption functionality
        directly on your client side (website or mobile app). In this
        configuration, there is a chance that discounts can be modified before
        being sent to the server.


        ### Expand Response

        You may expand the response by adding the following object to your
        request body. The expanded response will include the category details of
        the voucher.


        ```json

        {
            "options": {
                "expand": [
                    "category"
                ]
            }
        }

        ```
      operationId: redeem-voucher-client-side
      parameters:
        - $ref: '#/components/parameters/origin'
        - schema:
            $ref: '#/components/schemas/ParameterCode'
          in: query
          name: code
          description: Voucher code being redeemed.
          required: true
        - schema:
            $ref: '#/components/schemas/ParameterString'
          in: query
          name: tracking_id
          description: >-
            A tracking identifier of a user that redeemed a voucher. Identifier
            generated during voucher validation based on your internal id (e.g.,
            email, database ID). This is a hashed customer source ID. If you
            also pass a customer ID, the tracking ID must be the ID of a source
            of the customer object. Otherwise, if you do not pass a customer ID,
            the tracking you provide must either be a token, like the ones
            returned by [voucher
            validation](/api-reference/validations/validate-voucher), or a
            string identifying customer, with the options described below.
            Although not all information is required, the extra info helps
            prevent fraud.
      requestBody:
        description: Provide the redemption context in the request body.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/7_req_redeem_voucher'
        required: true
      responses:
        '200':
          description: Returns a redemption object if the redeem operation succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/7_res_redeem_voucher'
              examples:
                Gift Voucher:
                  value:
                    id: r_0c5e8a38730ccec0d5
                    object: redemption
                    date: '2023-01-27T12:34:57.100Z'
                    customer_id: cust_eWgXlBBiY6THFRJwX45Iakv4
                    tracking_id: track_9B0kB92+bJa8a+PegaWREw==
                    metadata: null
                    amount: 2000
                    result: SUCCESS
                    order:
                      id: ord_S4BvUj64TlGqVZDOeud7z3rU
                      source_id: null
                      created_at: '2023-01-27T12:34:57.086Z'
                      updated_at: null
                      status: PAID
                      amount: 6000
                      discount_amount: 2000
                      total_discount_amount: 2000
                      total_amount: 4000
                      applied_discount_amount: 2000
                      total_applied_discount_amount: 2000
                      items:
                        - object: order_item
                          product_id: prod_0a9f9ab4ab019a42d5
                          quantity: 1
                          amount: 3300
                          price: 3000
                          subtotal_amount: 3300
                        - object: order_item
                          product_id: prod_0a9f9aeddb019a42db
                          quantity: 2
                          amount: 3400
                          price: 3000
                          subtotal_amount: 3400
                      metadata: {}
                      customer:
                        id: cust_eWgXlBBiY6THFRJwX45Iakv4
                        object: customer
                      customer_id: cust_eWgXlBBiY6THFRJwX45Iakv4
                      referrer_id: null
                      object: order
                      redemptions:
                        r_0c5e8a38730ccec0d5:
                          date: '2023-01-27T12:34:57.100Z'
                          related_object_type: voucher
                          related_object_id: v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g
                          related_object_parent_id: camp_B2Gx83JsSbmvj05MOwxYbNm6
                    customer:
                      id: cust_eWgXlBBiY6THFRJwX45Iakv4
                      name: Bob Jones
                      email: bob.jones@email.com
                      source_id: 36_bob
                      metadata:
                        age: 26
                        favorite_brands:
                          - Nike
                          - Adidas
                          - Reebok
                        accepts_marketing: false
                        acquisition_channel: Facebook
                      object: customer
                    related_object_type: voucher
                    related_object_id: v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g
                    voucher:
                      id: v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g
                      code: CODE14
                      campaign: Gift Card Campaign
                      campaign_id: camp_B2Gx83JsSbmvj05MOwxYbNm6
                      category: Second
                      category_id: cat_0bb343dee3cdb5ec0c
                      categories: []
                      type: GIFT_VOUCHER
                      discount: null
                      gift:
                        amount: 2000
                        balance: 0
                        effect: null
                      loyalty_card: null
                      start_date: '2020-08-16T00:00:00.000Z'
                      expiration_date: null
                      validity_timeframe: null
                      validity_day_of_week: null
                      active: true
                      additional_info: secret-code1
                      metadata:
                        region: APAC
                        season: Fall
                      assets:
                        qr:
                          id: >-
                            U2FsdGVkX1+VibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ==
                          url: '{{internalVoucherifyURL}}'
                        barcode:
                          id: >-
                            U2FsdGVkX1/GVIi0p5fL5hxAY/ZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd//S4R9AB+60T/x4kSKu3lgfa9KgJmbyrzXm7Ggly06/qph4/asJaZVZIXEba4WJCeHqXCEgg==
                          url: '{{internalVoucherifyURL}}'
                      is_referral_code: false
                      created_at: '2022-09-23T11:05:42.164Z'
                      updated_at: '2023-01-27T12:34:57.102Z'
                      validation_rules_assignments:
                        object: list
                        data_ref: data
                        data: []
                        total: 0
                      redemption:
                        quantity: 18
                        redeemed_quantity: 1
                        redeemed_amount: 2000
                        object: list
                        url: /v1/vouchers/CODE14/redemptions?page=1&limit=10
                      publish:
                        object: list
                        count: 0
                        url: /v1/vouchers/CODE14/publications?page=1&limit=10
                      object: voucher
                      applicable_to:
                        data: []
                        total: 0
                        data_ref: data
                        object: list
                      inapplicable_to:
                        data: []
                        total: 0
                        data_ref: data
                        object: list
                    gift:
                      amount: 2000
                Discount Coupon:
                  value:
                    id: r_0c5e8ef10842da0aad
                    object: redemption
                    date: '2023-01-27T12:55:34.689Z'
                    customer_id: cust_eWgXlBBiY6THFRJwX45Iakv4
                    tracking_id: track_9B0kB92+bJa8a+PegaWREw==
                    metadata: null
                    result: SUCCESS
                    order:
                      id: ord_J5ogV1Gkk2yfxmBEhYIg4O65
                      source_id: null
                      created_at: '2023-01-27T12:55:34.673Z'
                      updated_at: null
                      status: PAID
                      amount: 6000
                      items_discount_amount: 300
                      total_discount_amount: 300
                      total_amount: 5700
                      items_applied_discount_amount: 300
                      total_applied_discount_amount: 300
                      items:
                        - object: order_item
                          product_id: prod_0a9f9ab4ab019a42d5
                          quantity: 1
                          amount: 3300
                          discount_amount: 148
                          applied_discount_amount: 148
                          price: 3000
                          subtotal_amount: 3152
                        - object: order_item
                          product_id: prod_0a9f9aeddb019a42db
                          quantity: 2
                          amount: 3400
                          discount_amount: 152
                          applied_discount_amount: 152
                          price: 3000
                          subtotal_amount: 3248
                      metadata: {}
                      customer:
                        id: cust_eWgXlBBiY6THFRJwX45Iakv4
                        object: customer
                      customer_id: cust_eWgXlBBiY6THFRJwX45Iakv4
                      referrer_id: null
                      object: order
                      redemptions:
                        r_0c5e8ef10842da0aad:
                          date: '2023-01-27T12:55:34.689Z'
                          related_object_type: voucher
                          related_object_id: v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u
                    customer:
                      id: cust_eWgXlBBiY6THFRJwX45Iakv4
                      name: Bob Jones
                      email: bob.jones@email.com
                      source_id: 36_bob
                      metadata:
                        age: 26
                        favorite_brands:
                          - Nike
                          - Adidas
                          - Reebok
                        accepts_marketing: false
                        acquisition_channel: Facebook
                      object: customer
                    related_object_type: voucher
                    related_object_id: v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u
                    voucher:
                      id: v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u
                      code: 2CpRCE2c
                      campaign: null
                      campaign_id: null
                      category: null
                      category_id: null
                      categories: []
                      type: DISCOUNT_VOUCHER
                      discount:
                        type: AMOUNT
                        amount_off: 300
                        effect: APPLY_TO_ITEMS_PROPORTIONALLY
                      gift: null
                      loyalty_card: null
                      start_date: null
                      expiration_date: null
                      validity_timeframe: null
                      validity_day_of_week: null
                      active: true
                      additional_info: null
                      metadata: {}
                      assets:
                        qr:
                          id: >-
                            U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==
                          url: '{{internalVoucherifyURL}}'
                        barcode:
                          id: >-
                            U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==
                          url: '{{internalVoucherifyURL}}'
                      is_referral_code: false
                      created_at: '2022-09-19T10:06:07.932Z'
                      updated_at: '2023-01-27T12:55:34.690Z'
                      validation_rules_assignments:
                        object: list
                        data_ref: data
                        data:
                          - id: asgm_HesdqEzt5e9c0T56
                            rule_id: val_gZft0NKZSUWK
                            related_object_id: v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u
                            related_object_type: voucher
                            object: validation_rules_assignment
                        total: 1
                      redemption:
                        quantity: null
                        redeemed_quantity: 2
                        object: list
                        url: /v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10
                      publish:
                        object: list
                        count: 0
                        url: /v1/vouchers/2CpRCE2c/publications?page=1&limit=10
                      object: voucher
                      applicable_to:
                        data:
                          - object: product
                            id: prod_0a9f9ab4ab019a42d5
                            source_id: prod_0a9f9ab4ab019a42d5
                            effect: APPLY_TO_EVERY
                          - object: product
                            id: prod_0a9f9aeddb019a42db
                            source_id: prod_0a9f9aeddb019a42db
                            effect: APPLY_TO_EVERY
                        total: 2
                        data_ref: data
                        object: list
                      inapplicable_to:
                        data: []
                        total: 0
                        data_ref: data
                        object: list
                Loyalty Card:
                  value:
                    id: r_0c5e8f2cd78497a372
                    object: redemption
                    date: '2023-01-27T12:56:35.934Z'
                    customer_id: cust_eWgXlBBiY6THFRJwX45Iakv4
                    tracking_id: track_9B0kB92+bJa8a+PegaWREw==
                    metadata: null
                    amount: 300
                    result: SUCCESS
                    order:
                      id: ord_MGTimoN4VtSj7iT75bP01FsH
                      source_id: null
                      created_at: '2023-01-27T12:56:35.923Z'
                      updated_at: null
                      status: PAID
                      amount: 6000
                      discount_amount: 6000
                      total_discount_amount: 6000
                      total_amount: 0
                      applied_discount_amount: 6000
                      total_applied_discount_amount: 6000
                      items:
                        - object: order_item
                          product_id: prod_0a9f9ab4ab019a42d5
                          quantity: 1
                          amount: 3300
                          price: 3000
                          subtotal_amount: 3300
                        - object: order_item
                          product_id: prod_0a9f9aeddb019a42db
                          quantity: 2
                          amount: 3400
                          price: 3000
                          subtotal_amount: 3400
                      metadata: {}
                      customer:
                        id: cust_eWgXlBBiY6THFRJwX45Iakv4
                        object: customer
                      customer_id: cust_eWgXlBBiY6THFRJwX45Iakv4
                      referrer_id: null
                      object: order
                      redemptions:
                        r_0c5e8f2cd78497a372:
                          date: '2023-01-27T12:56:35.934Z'
                          related_object_type: voucher
                          related_object_id: v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP
                          related_object_parent_id: camp_22noMlhTADb7Fq2UL3vWu3d1
                    customer:
                      id: cust_eWgXlBBiY6THFRJwX45Iakv4
                      name: Bob Jones
                      email: bob.jones@email.com
                      source_id: 36_bob
                      metadata:
                        age: 26
                        favorite_brands:
                          - Nike
                          - Adidas
                          - Reebok
                        accepts_marketing: false
                        acquisition_channel: Facebook
                      object: customer
                    related_object_type: voucher
                    related_object_id: v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP
                    voucher:
                      id: v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP
                      code: AnsvocvP
                      campaign: Loyalty Campaign - Test Points
                      campaign_id: camp_22noMlhTADb7Fq2UL3vWu3d1
                      category: null
                      category_id: cat_0bb81a481615a37b5e
                      categories: []
                      type: LOYALTY_CARD
                      discount: null
                      gift: null
                      loyalty_card:
                        points: 6500
                        balance: 5086
                      start_date: null
                      expiration_date: null
                      validity_timeframe: null
                      validity_day_of_week: null
                      active: true
                      additional_info: null
                      metadata: {}
                      assets:
                        qr:
                          id: >-
                            U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==
                          url: '{{internalVoucherifyURL}}'
                        barcode:
                          id: >-
                            U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==
                          url: '{{internalVoucherifyURL}}'
                      is_referral_code: false
                      created_at: '2022-11-10T06:28:59.970Z'
                      updated_at: '2023-01-27T12:56:35.935Z'
                      holder_id: cust_eWgXlBBiY6THFRJwX45Iakv4
                      holder:
                        id: cust_eWgXlBBiY6THFRJwX45Iakv4
                        source_id: 36_bob
                        metadata:
                          age: 26
                          favorite_brands:
                            - Nike
                            - Adidas
                            - Reebok
                          accepts_marketing: false
                          acquisition_channel: Facebook
                        object: customer
                      validation_rules_assignments:
                        object: list
                        data_ref: data
                        data: []
                        total: 0
                      redemption:
                        quantity: null
                        redeemed_quantity: 10
                        redeemed_points: 1414
                        object: list
                        url: /v1/vouchers/AnsvocvP/redemptions?page=1&limit=10
                      publish:
                        object: list
                        count: 1
                        url: /v1/vouchers/AnsvocvP/publications?page=1&limit=10
                      object: voucher
                      applicable_to:
                        data: []
                        total: 0
                        data_ref: data
                        object: list
                      inapplicable_to:
                        data: []
                        total: 0
                        data_ref: data
                        object: list
                    reward:
                      customer:
                        id: cust_eWgXlBBiY6THFRJwX45Iakv4
                        name: Bob Jones
                        email: bob.jones@email.com
                        source_id: 36_bob
                        metadata:
                          age: 26
                          favorite_brands:
                            - Nike
                            - Adidas
                            - Reebok
                          accepts_marketing: false
                          acquisition_channel: Facebook
                        object: customer
                      assignment_id: rewa_YAIuU7AY6LNJVlUbRxSbNgiD
                      id: rew_INt3fGH3n7xIr3ZQcq4kkUZ1
                      object: reward
                      name: 100 = $20
                      created_at: '2022-11-10T06:28:39.582Z'
                      updated_at: null
                      parameters:
                        coin:
                          exchange_ratio: 20
                          points_ratio: 100
                      type: COIN
                    loyalty_card:
                      points: 300
        '400':
          description: >-
            Returns an error if something goes wrong. A common source of error
            is an invalid or expired voucher, or a valid gift card with
            insufficient available balance.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/e_error_expanded'
              examples:
                Voucher disabled:
                  value:
                    code: 400
                    key: voucher_disabled
                    message: voucher is disabled
                    details: AnsvocvP
                    request_id: v-0c5d710a63c4110ae9
                    resource_id: rf_0c5d710a87c8a31f86
                    resource_type: redemption
                    error:
                      message: The voucher has been disabled and cannot be used.
                Invalid Customer:
                  value:
                    code: 400
                    key: invalid_customer
                    message: Customer must be a holder of a loyalty card.
                    details: AnsvocvP
                    request_id: v-0c5e628bd14411244b
                    resource_id: rf_0c5e628bf841c7f248
                    resource_type: redemption
                    error:
                      message: The customer is invalid.
                Voucher Inactive:
                  value:
                    code: 400
                    key: voucher_not_active_now
                    message: voucher not active now
                    details: CODE14
                    request_id: v-0c5e89b9300d820994
                    resource_id: rf_0c5e89b945d33b9c02
                    resource_type: redemption
                    error:
                      message: The voucher is not active in the given timeframe.
      deprecated: true
      security:
        - X-Client-Application-Id: []
          X-Client-Token: []
        - X-Voucherify-OAuth:
            - client_api
            - client_redeem
components:
  parameters:
    origin:
      name: origin
      in: header
      required: true
      schema:
        $ref: '#/components/schemas/ParameterOrigin'
      description: Indicates the origin (scheme, hostname, and port).
  schemas:
    ParameterCode:
      type: string
      example: 2CpRCE2c
    ParameterString:
      type: string
    7_req_redeem_voucher:
      title: Redeem Voucher Request Body
      description: >-
        Request body schema for redeeming a voucher using **POST**
        `v1/vouchers/{code}/redemption`.
      oneOf:
        - $ref: '#/components/schemas/7_req_redeem_voucher_discount_code'
        - $ref: '#/components/schemas/7_req_redeem_voucher_gift_card'
        - $ref: '#/components/schemas/7_req_redeem_voucher_loyalty_card'
    7_res_redeem_voucher:
      title: Redeem Voucher Response Body
      description: Response body schema for **POST** `v1/vouchers/{code}/redemption`.
      allOf:
        - $ref: '#/components/schemas/7_obj_redemption_object_voucher_extended'
    e_error_expanded:
      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.
        resource_id:
          type: string
          description: >-
            Unique resource ID that can be used in another endpoint to get more
            details.
          example: rf_0c5d710a87c8a31f86
        resource_type:
          type: string
          description: The resource type.
          example: redemption
        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
    ParameterOrigin:
      type: string
      format: hostname
    7_req_redeem_voucher_discount_code:
      title: Discount Code
      type: object
      description: Redeem a discount code.
      properties:
        session:
          $ref: '#/components/schemas/6_req_session_lock_discount_code'
        customer:
          oneOf:
            - $ref: '#/components/schemas/6_req_validate_voucher_customer_id'
            - $ref: '#/components/schemas/6_req_validate_voucher_customer_source_id'
            - $ref: '#/components/schemas/9_req_create_customer'
          description: Customer's information.
        order:
          oneOf:
            - $ref: '#/components/schemas/6_req_validate_voucher_order_id'
            - $ref: '#/components/schemas/6_req_validate_voucher_order_source_id'
            - $ref: '#/components/schemas/OrdersCreateRequestBody'
          description: Order information.
        metadata:
          type: object
          description: >-
            A set of key/value pairs that you can send in the request body to
            check against vouchers requiring **redemption** metadata validation
            rules to be satisfied. The validation runs against rules that are
            defined through the [Create Validation
            Rules](/api-reference/validation-rules/create-validation-rules)
            endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr;
            _Advanced_ &rarr; _Redemption metadata satisfy_ or _Basic Builder_
            &rarr; _Attributes match_ &rarr; _REDEMPTION METADATA_. [Read
            more](/personalize/create-validation-rules).
        options:
          type: object
          description: Configure parameters returned in the response.
          properties:
            expand:
              type: array
              description: >-
                The expand array lets you configure the parameters included in
                the response. Depending on the strings included in the array,
                the response will contain different details. Add `category` as a
                string in the array to include a `categories` object in the
                response.
              items:
                type: string
                default: category
                enum:
                  - category
                example: category
    7_req_redeem_voucher_gift_card:
      title: Gift Card
      type: object
      description: Redeem a gift card.
      properties:
        session:
          $ref: '#/components/schemas/6_req_session_lock_gift_card'
        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: integer
              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`.
        customer:
          oneOf:
            - $ref: '#/components/schemas/6_req_validate_voucher_customer_id'
            - $ref: '#/components/schemas/6_req_validate_voucher_customer_source_id'
            - $ref: '#/components/schemas/9_req_create_customer'
          description: Customer's information.
        order:
          oneOf:
            - $ref: '#/components/schemas/6_req_validate_voucher_order_id'
            - $ref: '#/components/schemas/6_req_validate_voucher_order_source_id'
            - $ref: '#/components/schemas/OrdersCreateRequestBody'
          description: Order information.
        metadata:
          type: object
          description: >-
            A set of key/value pairs that you can send in the request body to
            check against vouchers requiring **redemption** metadata validation
            rules to be satisfied. The validation runs against rules that are
            defined through the [Create Validation
            Rules](/api-reference/validation-rules/create-validation-rules)
            endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr;
            _Advanced_ &rarr; _Redemption metadata satisfy_ or _Basic Builder_
            &rarr; _Attributes match_ &rarr; _REDEMPTION METADATA_. [Read
            more](/personalize/create-validation-rules).
        options:
          type: object
          description: Configure parameters returned in the response.
          properties:
            expand:
              type: array
              description: >-
                The expand array lets you configure the parameters included in
                the response. Depending on the strings included in the array,
                the response will contain different details. Add `category` as a
                string in the array to include a `categories` object in the
                response.
              items:
                type: string
                default: category
                enum:
                  - category
                example: category
    7_req_redeem_voucher_loyalty_card:
      title: Loyalty Card
      type: object
      description: Redeem a loyalty card.
      properties:
        session:
          $ref: '#/components/schemas/6_req_session_lock_loyalty_card'
        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.
            points:
              type: integer
              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.
        customer:
          oneOf:
            - $ref: '#/components/schemas/6_req_validate_voucher_customer_id'
            - $ref: '#/components/schemas/6_req_validate_voucher_customer_source_id'
            - $ref: '#/components/schemas/9_req_create_customer'
          description: Customer's information.
        order:
          oneOf:
            - $ref: '#/components/schemas/6_req_validate_voucher_order_id'
            - $ref: '#/components/schemas/6_req_validate_voucher_order_source_id'
            - $ref: '#/components/schemas/OrdersCreateRequestBody'
          description: Order information.
        metadata:
          type: object
          description: >-
            A set of key/value pairs that you can send in the request body to
            check against vouchers requiring **redemption** metadata validation
            rules to be satisfied. The validation runs against rules that are
            defined through the [Create Validation
            Rules](/api-reference/validation-rules/create-validation-rules)
            endpoint or via the Dashboard; in the _Advanced Rule Builder_ &rarr;
            _Advanced_ &rarr; _Redemption metadata satisfy_ or _Basic Builder_
            &rarr; _Attributes match_ &rarr; _REDEMPTION METADATA_. [Read
            more](/personalize/create-validation-rules).
        options:
          type: object
          description: Configure parameters returned in the response.
          properties:
            expand:
              type: array
              description: >-
                The expand array lets you configure the parameters included in
                the response. Depending on the strings included in the array,
                the response will contain different details. Add `category` as a
                string in the array to include a `categories` object in the
                response.
              items:
                type: string
                default: category
                enum:
                  - category
                example: category
    7_obj_redemption_object_voucher_extended:
      title: Redemption Object
      description: >-
        This is an object representing an attempted or successful voucher
        redemption.
      oneOf:
        - $ref: >-
            #/components/schemas/7_obj_redemption_object_discount_voucher_extended
        - $ref: '#/components/schemas/7_obj_redemption_object_loyalty_card_extended'
        - $ref: '#/components/schemas/7_obj_redemption_object_gift_card_extended'
    6_req_session_lock_discount_code:
      title: Discount Code Session Lock
      type: object
      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](/guides/locking-validation-session).
      properties:
        type:
          type: string
          description: >-
            This parameter is **required** to establish a new session. The
            session locks the redemption **quantity** by 1.
          default: LOCK
          enum:
            - LOCK
        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.
          example: ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts
        ttl_unit:
          type: string
          description: Defines the type of unit in which the session time is counted.
          enum:
            - HOURS
            - DAYS
            - MINUTES
            - SECONDS
            - MILLISECONDS
            - MICROSECONDS
            - NANOSECONDS
        ttl:
          type: integer
          description: >-
            Value for the period of time that the session is active. Units for
            this parameter are defined by the `session.ttl_unit` parameter.
    6_req_validate_voucher_customer_id:
      title: Customer ID
      description: You can pass the unique customer ID that was assigned by Voucherify.
      type: object
      properties:
        id:
          type: string
          description: >-
            The ID of an existing customer that will be linked to redemption in
            this request.
          example: cust_Vzck5i8U3OhcEUFY6MKhN9Rv
    6_req_validate_voucher_customer_source_id:
      title: Customer Source ID
      description: >-
        You can send the source ID that you used to create the customer in
        Voucherify.
      type: object
      properties:
        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.
    9_req_create_customer:
      type: object
      title: Customer
      description: This is an object containing information about the customer.
      properties:
        source_id:
          type: string
          description: >-
            The merchant's customer ID if it is different from the Voucherify
            customer ID. It is really useful in case of an integration between
            multiple systems. It can be a customer ID from a CRM system,
            database or 3rd-party service. 


            Please note that if you would like your data to sync based on the
            `source_id` of the customer, you need to define the `source_id`
            upfront. You will not be able to change or update the `source_id`
            later on.
        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.
        address:
          type: object
          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.
        birthdate:
          type: string
          description: Customer's birthdate; format `YYYY-MM-DD`.
          format: date
        birthday:
          type: string
          description: '`Deprecated`. ~~Customer''s birthdate; format `YYYY-MM-DD`~~.'
          format: date
        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. 
    6_req_validate_voucher_order_id:
      title: Order ID
      description: You can pass the unique order ID that was assigned by Voucherify.
      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.
    6_req_validate_voucher_order_source_id:
      title: Order Source ID
      description: >-
        You can send the source ID that you used to create the order in
        Voucherify.
      type: object
      properties:
        source_id:
          type: string
          description: >-
            Unique source ID of an existing order that will be linked to the
            redemption of this request.
    OrdersCreateRequestBody:
      title: Orders Create Request Body
      type: object
      description: Request body schema for **POST** `v1/orders`.
      allOf:
        - $ref: '#/components/schemas/Order'
        - title: Order Customer And Referrer Ids Objects
          type: object
          description: Order information.
          properties:
            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
            referrer_id:
              type: string
              nullable: true
              description: Unique referrer ID.
              example: cust_nM4jqPiaXUvQdVSA6vTRUnix
            customer:
              allOf:
                - $ref: '#/components/schemas/Customer'
            referrer:
              allOf:
                - $ref: '#/components/schemas/Referrer'
    6_req_session_lock_gift_card:
      title: Gift Card Session Lock
      type: object
      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](/guides/locking-validation-session).
      properties:
        type:
          type: string
          description: >-
            This parameter is **required** to establish a new session. The
            session locks the redemption **quantity** by 1 and the redemption
            **gift credits** specified within the request.
          default: LOCK
          enum:
            - LOCK
        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.
          example: ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts
        ttl_unit:
          type: string
          description: Defines the type of unit in which the session time is counted.
          enum:
            - HOURS
            - DAYS
            - MINUTES
            - SECONDS
            - MILLISECONDS
            - MICROSECONDS
            - NANOSECONDS
        ttl:
          type: integer
          description: >-
            Value for the period of time that the session is active. Units for
            this parameter are defined by the `session.ttl_unit` parameter.
    6_req_session_lock_loyalty_card:
      title: Loyalty Card Session Lock
      type: object
      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](/guides/locking-validation-session).
      properties:
        type:
          type: string
          description: >-
            This parameter is **required** to establish a new session. The
            session locks the redemption **quantity** by 1 and the redemption
            **loyalty points** specified within the request.
          default: LOCK
          enum:
            - LOCK
        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.
          example: ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts
        ttl_unit:
          type: string
          description: Defines the type of unit in which the session time is counted.
          enum:
            - HOURS
            - DAYS
            - MINUTES
            - SECONDS
            - MILLISECONDS
            - MICROSECONDS
            - NANOSECONDS
        ttl:
          type: integer
          description: >-
            Value for the period of time that the session is active. Units for
            this parameter are defined by the `session.ttl_unit` parameter.
    7_obj_redemption_object_discount_voucher_extended:
      type: object
      title: Discount Voucher
      description: >-
        This is an object representing a redemption.  


        Redemption is the key operation in the voucher and promotion tier
        lifecycle. A customer can redeem a voucher or promotion tier once or
        multiple times depending on selected limit (`quantity`). Each redemption
        is recorded in voucher/promotion's history (`redemption_entries`). There
        is also an option to cancel a redemption. We call such operation a
        [redemption rollback](rollback-redemption).
      properties:
        id:
          type: string
          example: r_0bc92f81a6801f9bca
          description: Unique redemption ID.
        object:
          type: string
          description: >-
            The type of the object represented by the JSON. This object stores
            information about the `redemption`.
          default: redemption
        date:
          type: string
          format: date-time
          example: '2022-10-03T12:24:58.008Z'
          description: Timestamp in ISO 8601 format indicating when the redemption occured.
        customer_id:
          type: string
          example: cust_i8t5Tt6eiKG5K79KQlJ0Vs64
          description: Unique customer ID of the redeeming customer.
        tracking_id:
          type: string
          example: track_fxEMFiLowFHg==
          description: Hashed customer source ID.
        metadata:
          type: object
          description: >-
            The metadata object stores all custom attributes in the form of
            key/value pairs assigned to the redemption.
        result:
          type: string
          enum:
            - SUCCESS
            - FAILURE
          description: Redemption result.
        order:
          description: Defines the details of the order that is related to the redemption.
          allOf:
            - $ref: '#/components/schemas/7_obj_order_object'
        channel:
          type: object
          description: >-
            Defines the details of the channel through which the redemption was
            issued.
          properties:
            channel_id:
              type: string
              example: user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH
              description: >-
                Unique channel ID of the user performing the redemption. This is
                either a user ID from a user using the Voucherify Dashboard or
                an X-APP-Id of a user using the API.
            channel_type:
              type: string
              description: >-
                The source of the channel for the redemption. A `USER`
                corresponds to the Voucherify Dashboard and an `API` corresponds
                to the API.
              enum:
                - USER
                - API
        customer:
          type: object
          description: Defines the customer that is related to the redemption.
          properties:
            id:
              type: string
              description: The unique ID of a customer that is assigned by Voucherify.
              example: cust_eWgXlBBiY6THFRJwX45Iakv4
            name:
              type: string
              description: Customer's first and last name.
            email:
              type: string
              description: Customer's email address.
            source_id:
              type: string
              description: >-
                The merchant's customer ID if it is different from the
                Voucherify customer ID. It is really useful in case of an
                integration between multiple systems. It can be a customer ID
                from a CRM system, database or 3rd-party service.
            metadata:
              type: object
              description: >-
                The metadata object stores all custom attributes assigned to the
                customer. A set of key/value pairs that you can attach to a
                customer object. It can be useful for storing additional
                information about the customer in a structured format.
            object:
              type: string
              description: Type of object represented is `customer`.
              default: customer
        related_object_type:
          type: string
          description: |-
            Defines the related object.

            | **Related Object** | **Definition** |
            | :--- | :--- |
            | voucher | Either a discount voucher, gift card, or loyalty card. |
          default: voucher
          enum:
            - voucher
        related_object_id:
          type: string
          description: >-
            Unique related object ID assigned by Voucherify, i.e.
            v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher.
        voucher:
          description: Defines the details of the voucher being redeemed.
          allOf:
            - $ref: '#/components/schemas/Voucher'
            - $ref: '#/components/schemas/VoucherHolder'
    7_obj_redemption_object_loyalty_card_extended:
      type: object
      title: Loyalty Card Voucher
      description: >-
        This is an object representing a redemption.  


        Redemption is the key operation in the voucher and promotion tier
        lifecycle. A customer can redeem a voucher or promotion tier once or
        multiple times depending on selected limit (`quantity`). Each redemption
        is recorded in voucher/promotion's history (`redemption_entries`). There
        is also an option to cancel a redemption. We call such operation a
        [redemption rollback](rollback-redemption).
      properties:
        id:
          type: string
          example: r_0bc92f81a6801f9bca
          description: Unique redemption ID.
        object:
          type: string
          description: >-
            The type of the object represented by the JSON. This object stores
            information about the redemption.
          default: redemption
        date:
          type: string
          format: date-time
          example: '2022-10-03T12:24:58.008Z'
          description: Timestamp in ISO 8601 format indicating when the redemption occured.
        customer_id:
          type: string
          example: cust_i8t5Tt6eiKG5K79KQlJ0Vs64
          description: Unique customer ID of the redeeming customer.
        tracking_id:
          type: string
          example: track_fxEMFiLowFHg==
          description: Hashed customer source ID.
        metadata:
          type: object
          description: >-
            The metadata object stores all custom attributes in the form of
            key/value pairs assigned to the redemption.
        amount:
          type: integer
          description: Number of points being redeemed for a reward.
        result:
          type: string
          enum:
            - SUCCESS
            - FAILURE
          description: Redemption result.
        order:
          description: Defines the details of the order that is related to the redemption.
          allOf:
            - $ref: '#/components/schemas/7_obj_order_object'
        channel:
          type: object
          description: >-
            Defines the details of the channel through which the redemption was
            issued.
          properties:
            channel_id:
              type: string
              example: user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH
              description: >-
                Unique channel ID of the user performing the redemption. This is
                either a user ID from a user using the Voucherify Dashboard or
                an X-APP-Id of a user using the API.
            channel_type:
              type: string
              description: >-
                The source of the channel for the redemption. A `USER`
                corresponds to the Voucherify Dashboard and an `API` corresponds
                to the API.
              enum:
                - USER
                - API
        customer:
          type: object
          description: Defines the customer redeeming the reward.
          properties:
            id:
              type: string
              description: The unique ID of a customer that is assigned by Voucherify.
              example: cust_eWgXlBBiY6THFRJwX45Iakv4
            name:
              type: string
              description: Customer's first and last name.
            email:
              type: string
              description: Customer's email address.
            source_id:
              type: string
              description: >-
                The merchant's customer ID if it is different from the
                Voucherify customer ID. It is really useful in case of an
                integration between multiple systems. It can be a customer ID
                from a CRM system, database or 3rd-party service.
            metadata:
              type: object
              description: >-
                The metadata object stores all custom attributes assigned to the
                customer. A set of key/value pairs that you can attach to a
                customer object. It can be useful for storing additional
                information about the customer in a structured format.
            object:
              type: string
              description: Type of object represented is `customer`.
              default: customer
        related_object_type:
          type: string
          description: Defines the related object, i.e. `voucher`.
          default: voucher
          enum:
            - voucher
        related_object_id:
          type: string
          description: >-
            Unique related object ID assigned by Voucherify, i.e.
            `v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno` for a voucher.
        voucher:
          description: Defines the details of the voucher being redeemed.
          allOf:
            - $ref: '#/components/schemas/Voucher'
        reward:
          description: Defines the reward being redeemed.
          oneOf:
            - $ref: >-
                #/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points
            - $ref: >-
                #/components/schemas/7_obj_redemption_object_loyalty_card_material_product
            - $ref: >-
                #/components/schemas/7_obj_redemption_object_loyalty_card_material_sku
            - $ref: >-
                #/components/schemas/7_obj_redemption_object_loyalty_card_digital
        loyalty_card:
          type: object
          description: >-
            Stores the number of points being subtracted from the loyalty card
            for the reward redemption.
          properties:
            points:
              type: integer
              description: >-
                Number of points being subtracted from the loyalty card for the
                reward redemption.
    7_obj_redemption_object_gift_card_extended:
      type: object
      title: Gift Card
      description: This is an object representing a gift card redemption.
      properties:
        id:
          type: string
          example: r_0bc92f81a6801f9bca
          description: Unique redemption ID.
        object:
          type: string
          description: >-
            The type of the object represented by the JSON. This object stores
            information about the `redemption`.
          default: redemption
        date:
          type: string
          format: date-time
          example: '2022-10-03T12:24:58.008Z'
          description: Timestamp in ISO 8601 format indicating when the redemption occured.
        customer_id:
          type: string
          example: cust_i8t5Tt6eiKG5K79KQlJ0Vs64
          description: Unique customer ID of the redeeming customer.
        tracking_id:
          type: string
          example: track_fxEMFiLowFHg==
          description: Hashed customer source ID.
        metadata:
          type: object
          description: >-
            The metadata object stores all custom attributes in the form of
            key/value pairs assigned to the redemption.
        amount:
          type: integer
          description: >-
            The amount subtracted from the gift card expressed as the smallest
            currency unit (e.g. 100 cents for $1.00).
        result:
          type: string
          enum:
            - SUCCESS
            - FAILURE
          description: Redemption result.
        order:
          description: Defines the details of the order that is related to the redemption.
          allOf:
            - $ref: '#/components/schemas/7_obj_order_object'
        channel:
          type: object
          description: >-
            Defines the details of the channel through which the redemption was
            issued.
          properties:
            channel_id:
              type: string
              example: user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH
              description: >-
                Unique channel ID of the user performing the redemption. This is
                either a user ID from a user using the Voucherify Dashboard or
                an X-APP-Id of a user using the API.
            channel_type:
              type: string
              description: >-
                The source of the channel for the redemption. A `USER`
                corresponds to the Voucherify Dashboard and an `API` corresponds
                to the API.
              enum:
                - USER
                - API
        customer:
          type: object
          description: Defines the customer redeeming the gift card.
          properties:
            id:
              type: string
              description: The unique ID of a customer that is assigned by Voucherify.
              example: cust_eWgXlBBiY6THFRJwX45Iakv4
            name:
              type: string
              description: Customer's first and last name.
            email:
              type: string
              description: Customer's email address.
            source_id:
              type: string
              description: >-
                The merchant's customer ID if it is different from the
                Voucherify customer ID. It is really useful in case of an
                integration between multiple systems. It can be a customer ID
                from a CRM system, database or 3rd-party service.
            metadata:
              type: object
              description: >-
                The metadata object stores all custom attributes assigned to the
                customer. A set of key/value pairs that you can attach to a
                customer object. It can be useful for storing additional
                information about the customer in a structured format.
            object:
              type: string
              description: Type of object represented is `customer`.
              default: customer
        related_object_type:
          type: string
          description: |-
            Defines the related object.

            | **Related Object** | **Definition** |
            | :--- | :--- |
            | voucher | Either a discount voucher, gift card, or loyalty card. |
          default: voucher
          enum:
            - voucher
        related_object_id:
          type: string
          description: >-
            Unique related object ID assigned by Voucherify, i.e.
            v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher.
        voucher:
          description: Defines the details of the voucher being redeemed.
          allOf:
            - $ref: '#/components/schemas/Voucher'
        gift:
          type: object
          description: >-
            Contains the amount being subtracted from the gift card for the
            redemption.
          properties:
            amount:
              type: integer
              description: >-
                The amount subtracted from the gift card expressed as the
                smallest currency unit (e.g. 100 cents for $1.00).
    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'
    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'
    Referrer:
      title: Referrer
      allOf:
        - $ref: '#/components/schemas/Customer'
    7_obj_order_object:
      title: Order object
      description: >-
        This is an object representing an order with calculated discounts
        applied using the voucher code.
      oneOf:
        - $ref: '#/components/schemas/7_obj_order_object_apply_to_order'
        - $ref: '#/components/schemas/7_obj_order_object_apply_to_items'
    Voucher:
      title: Voucher
      description: >-
        This is an object representing a voucher with categories and validation
        rules assignments.
      allOf:
        - $ref: '#/components/schemas/VoucherBase'
        - type: object
          properties:
            categories:
              type: array
              description: Contains details about the category.
              items:
                $ref: '#/components/schemas/Category'
            validation_rules_assignments:
              $ref: '#/components/schemas/ValidationRulesAssignmentsList'
    VoucherHolder:
      title: Voucher Holder
      type: object
      description: This is an object representing a voucher holder.
      properties:
        holder:
          $ref: '#/components/schemas/SimpleCustomer'
    7_obj_redemption_object_loyalty_card_pay_with_points:
      type: object
      description: >-
        Defines the pay with points reward redeemed for the particular loyalty
        card.
      properties:
        customer:
          type: object
          description: Defines the customer redeeming the reward.
          properties:
            id:
              type: string
              description: The unique ID of a customer that is assigned by Voucherify.
              example: cust_eWgXlBBiY6THFRJwX45Iakv4
            name:
              type: string
              description: Customer's first and last name.
            email:
              type: string
              description: Customer's email address.
            source_id:
              type: string
              description: >-
                The merchant's customer ID if it is different from the
                Voucherify customer ID. It is really useful in case of an
                integration between multiple systems. It can be a customer ID
                from a CRM system, database or 3rd-party service.
            metadata:
              type: object
              description: >-
                The metadata object stores all custom attributes assigned to the
                customer. A set of key/value pairs that you can attach to a
                customer object. It can be useful for storing additional
                information about the customer in a structured format.
            object:
              type: string
              description: Type of object represented is `customer`.
              default: customer
        assignment_id:
          type: string
          example: rewa_YAIuU7AY6LNJVlUbRxSbNgiD
          description: Unique reward assginment ID assigned by Voucherify.
        id:
          type: string
          example: rew_INt3fGH3n7xIr3ZQcq4kkUZ1
          description: Unique reward ID assigned by Voucherify.
        object:
          type: string
          default: reward
          description: Type of object represented is `reward`.
        name:
          type: string
          description: Reward name.
        created_at:
          type: string
          format: date-time
          example: '2022-10-03T12:24:58.008Z'
          description: Timestamp in ISO 8601 format indicating when the reward was created.
        updated_at:
          type: string
          format: date-time
          example: '2022-10-03T12:24:58.008Z'
          description: Timestamp in ISO 8601 format indicating when the reward was updated.
        parameters:
          type: object
          description: These are parameters representing a Pay with Points (COIN) reward.
          properties:
            coin:
              type: object
              description: >-
                Defines the ratio by mapping the number of loyalty points in
                `points_ratio` to a predefined cash amount in `exchange_ratio`.
              properties:
                exchange_ratio:
                  type: integer
                  description: >-
                    The cash equivalent of the points defined in the
                    `points_ratio` property.
                points_ratio:
                  type: integer
                  description: >-
                    The number of loyalty points that will map to the predefined
                    cash amount defined by the `exchange_ratio` property.
        type:
          type: string
          description: Reward type
          default: COIN
          enum:
            - COIN
      title: Pay with Points Reward
    7_obj_redemption_object_loyalty_card_material_product:
      type: object
      description: >-
        Defines the product material reward redeemed for the particular loyalty
        card.
      properties:
        customer:
          type: object
          description: Defines the customer redeeming the reward.
          properties:
            id:
              type: string
              description: The unique ID of a customer that is assigned by Voucherify.
              example: cust_eWgXlBBiY6THFRJwX45Iakv4
            name:
              type: string
              description: Customer's first and last name.
            email:
              type: string
              description: Customer's email address.
            source_id:
              type: string
              description: >-
                The merchant's customer ID if it is different from the
                Voucherify customer ID. It is really useful in case of an
                integration between multiple systems. It can be a customer ID
                from a CRM system, database or 3rd-party service.
            metadata:
              type: object
              description: >-
                The metadata object stores all custom attributes assigned to the
                customer. A set of key/value pairs that you can attach to a
                customer object. It can be useful for storing additional
                information about the customer in a structured format.
            object:
              type: string
              description: Type of object represented is `customer`.
              default: customer
        assignment_id:
          type: string
          example: rewa_YAIuU7AY6LNJVlUbRxSbNgiD
          description: Unique reward assginment ID assigned by Voucherify.
        product:
          description: Details of the product redeemed as a reward.
          allOf:
            - $ref: '#/components/schemas/Product'
        id:
          type: string
          example: rew_INt3fGH3n7xIr3ZQcq4kkUZ1
          description: Unique reward ID assigned by Voucherify.
        object:
          type: string
          default: reward
          description: Type of object represented is `reward`.
        name:
          type: string
          description: Reward name.
        created_at:
          type: string
          format: date-time
          example: '2022-10-03T12:24:58.008Z'
          description: Timestamp in ISO 8601 format indicating when the reward was created.
        updated_at:
          type: string
          format: date-time
          example: '2022-10-03T12:24:58.008Z'
          description: Timestamp in ISO 8601 format indicating when the reward was updated.
        parameters:
          type: object
          description: These are parameters representing a material reward.
          properties:
            product:
              type: object
              description: Defines the product redeemed as a reward.
              properties:
                id:
                  type: string
                  description: Unique product ID assignedy by Voucherify of the product.
                  example: prod_0b2c2ddf35150b83bb
                sku_id:
                  type: string
                  nullable: true
        type:
          type: string
          description: Reward type
          default: MATERIAL
          enum:
            - MATERIAL
      title: Product Material Reward
    7_obj_redemption_object_loyalty_card_material_sku:
      type: object
      description: >-
        Defines the SKU material reward redeemed for the particular loyalty
        card.
      properties:
        customer:
          type: object
          description: Defines the customer redeeming the reward.
          properties:
            id:
              type: string
              description: The unique ID of a customer that is assigned by Voucherify.
              example: cust_eWgXlBBiY6THFRJwX45Iakv4
            name:
              type: string
              description: Customer's first and last name.
            email:
              type: string
              description: Customer's email address.
            source_id:
              type: string
              description: >-
                The merchant's customer ID if it is different from the
                Voucherify customer ID. It is really useful in case of an
                integration between multiple systems. It can be a customer ID
                from a CRM system, database or 3rd-party service.
            metadata:
              type: object
              description: >-
                The metadata object stores all custom attributes assigned to the
                customer. A set of key/value pairs that you can attach to a
                customer object. It can be useful for storing additional
                information about the customer in a structured format.
            object:
              type: string
              description: Type of object represented is `customer`.
              default: customer
        assignment_id:
          type: string
          example: rewa_YAIuU7AY6LNJVlUbRxSbNgiD
          description: Unique reward assginment ID assigned by Voucherify.
        product:
          description: Details of the SKU's parent product redeemed as a reward.
          allOf:
            - $ref: '#/components/schemas/Product'
        sku:
          description: Details of the SKU redeemed as a reward.
          allOf:
            - $ref: '#/components/schemas/Sku'
        id:
          type: string
          example: rew_INt3fGH3n7xIr3ZQcq4kkUZ1
          description: Unique reward ID assigned by Voucherify.
        object:
          type: string
          default: reward
          description: Type of object represented is `reward`.
        name:
          type: string
          description: Reward name.
        created_at:
          type: string
          format: date-time
          example: '2022-10-03T12:24:58.008Z'
          description: Timestamp in ISO 8601 format indicating when the reward was created.
        updated_at:
          type: string
          format: date-time
          example: '2022-10-03T12:24:58.008Z'
          description: Timestamp in ISO 8601 format indicating when the reward was updated.
        parameters:
          type: object
          description: These are parameters representing a material reward.
          properties:
            product:
              type: object
              description: Defines the SKU redeemed as a reward.
              properties:
                id:
                  type: string
                  description: >-
                    Unique product ID assignedy by Voucherify of the SKU's
                    parent.
                sku_id:
                  type: string
                  description: >-
                    Unique SKU ID assigned by Voucherify of the SKU redeemed as
                    a reward.
        type:
          type: string
          description: Reward type
          default: MATERIAL
          enum:
            - MATERIAL
      title: SKU Material Reward
    7_obj_redemption_object_loyalty_card_digital:
      type: object
      description: Defines the digital reward redeemed for the particular loyalty card.
      properties:
        customer:
          type: object
          description: Defines the customer redeeming the reward.
          properties:
            id:
              type: string
              description: The unique ID of a customer that is assigned by Voucherify.
              example: cust_eWgXlBBiY6THFRJwX45Iakv4
            name:
              type: string
              description: Customer's first and last name.
            email:
              type: string
              description: Customer's email address.
            source_id:
              type: string
              description: >-
                The merchant's customer ID if it is different from the
                Voucherify customer ID. It is really useful in case of an
                integration between multiple systems. It can be a customer ID
                from a CRM system, database or 3rd-party service.
            metadata:
              type: object
              description: >-
                The metadata object stores all custom attributes assigned to the
                customer. A set of key/value pairs that you can attach to a
                customer object. It can be useful for storing additional
                information about the customer in a structured format.
            object:
              type: string
              description: Type of object represented is `customer`.
              default: customer
        assignment_id:
          type: string
          example: rewa_YAIuU7AY6LNJVlUbRxSbNgiD
          description: Unique reward assginment ID assigned by Voucherify.
        voucher:
          description: Voucher object.
          allOf:
            - $ref: '#/components/schemas/Voucher'
        id:
          type: string
          example: rew_INt3fGH3n7xIr3ZQcq4kkUZ1
          description: Unique reward ID assigned by Voucherify.
        object:
          type: string
          default: reward
          description: Type of object represented is `reward`.
        name:
          type: string
          description: Reward name.
        created_at:
          type: string
          format: date-time
          example: '2022-10-03T12:24:58.008Z'
          description: Timestamp in ISO 8601 format indicating when the reward was created.
        updated_at:
          type: string
          format: date-time
          example: '2022-10-03T12:24:58.008Z'
          description: Timestamp in ISO 8601 format indicating when the reward was updated.
        parameters:
          type: object
          description: >-
            These are parameters representing a digital reward. These can be in
            the form of discount coupons, gift card credits, or loyalty point
            credits.
          properties:
            campaign:
              description: Defines the source of the digital reward.
              oneOf:
                - $ref: >-
                    #/components/schemas/7_obj_redemption_object_loyalty_card_digital_discount_voucher
                - $ref: >-
                    #/components/schemas/7_obj_redemption_object_loyalty_card_digital_gift_card_credits
                - $ref: >-
                    #/components/schemas/7_obj_redemption_object_loyalty_card_digital_loyalty_card_points
        type:
          type: string
          description: Reward type
          default: CAMPAIGN
          enum:
            - CAMPAIGN
      title: Digital Reward
    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.
    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.
    7_obj_order_object_apply_to_order:
      type: object
      title: 'Order object - Effect: Apply to order'
      description: >-
        This is an object representing an order with calculated discounts
        applied using the voucher code.
      properties:
        id:
          type: string
          example: ord_OLWs41pBk7VFn6ZTyX9U6keh
          description: Unique order ID, assigned by Voucherify.
        source_id:
          type: string
          description: >-
            The merchant's order ID if it is different from the Voucherify order
            ID. It is really useful in case of integration between multiple
            systems. It can be an order ID from CRM, database or 3rd party
            service.
        created_at:
          type: string
          format: date-time
          example: '2022-10-06T11:40:48.705Z'
          description: >-
            Timestamp representing the date and time when the order was created.
            The value is shown in the ISO 8601 format.
        updated_at:
          type: string
          format: date-time
          example: '2022-10-06T11:47:20.760Z'
          description: >-
            Timestamp representing the date and time when the order was updated.
            The value is shown in the ISO 8601 format.
        status:
          type: string
          description: Order status.
          enum:
            - CREATED
            - PAID
            - CANCELED
            - FULFILLED
        amount:
          type: integer
          description: Order amount before applying any discount.
        discount_amount:
          type: integer
          description: Sum of all order-level discounts applied to the order.
        total_discount_amount:
          type: integer
          description: >-
            Sum of all order-level AND all product-specific discounts applied to
            the order.  

            `total_discount_amount` = `discount_amount` +
            `items_discount_amount`
        total_amount:
          type: integer
          description: |-
            Order amount after applying all the discounts.  
            `total_amount` = `amount` - `total_discount_amount`
        applied_discount_amount:
          type: integer
          description: This field shows the order-level discount applied.
        total_applied_discount_amount:
          type: integer
          description: >-
            This field sums up all order-level and all product-specific
            discounts applied in a particular request.
        items:
          type: array
          description: >-
            Array of order items that have been applied to the order. Each order
            item can show the effects of particular discounts on the item-level.
          items:
            type: object
            properties:
              object:
                type: string
                default: order_item
                description: >-
                  The type of the object represented by JSON. This object stores
                  information about the `order_item`.
              product_id:
                type: string
                example: prod_5h0wc453_1
                description: >-
                  A unique identifier that represents the product and is
                  assigned by Voucherify.
              sku_id:
                type: string
                example: sku_prod_5h0wc453_1_1
                description: >-
                  A unique identifier that represents the SKU and is assigned by
                  Voucherify.
              quantity:
                type: integer
                description: Quantity of the item in the cart.
              amount:
                type: integer
                description: >-
                  Represents a total pre-discount amount of order item (`price`
                  * `quantity`).
              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`-`discount_amount`
              product:
                type: object
                description: This object stores more information about the related product.
                properties:
                  id:
                    type: string
                    example: prod_5h0wc453_1
                    description: >-
                      A unique identifier that represents the product and is
                      assigned by Voucherify.
                  source_id:
                    type: string
                    description: A unique product identifier from your inventory system.
                    example: illy-arabica
                  name:
                    type: string
                    example: Brewing System
                    description: Product name.
                  price:
                    type: integer
                    description: >-
                      Unit price of a product. The value is multiplied by 100 to
                      represent 2 decimal places. For example `10000 cents` for
                      `$100.00`.
              sku:
                type: object
                description: This object stores more information about the related SKU.
                properties:
                  id:
                    type: string
                    example: sku_prod_5h0wc453_1_1
                    description: >-
                      A unique identifier that represents the SKU and is
                      assigned by Voucherify.
                  source_id:
                    type: string
                    example: illy-arabica-250g
                    description: A unique SKU identifier from your inventory system.
                  sku:
                    type: string
                    description: SKU name.
                  price:
                    type: integer
                    description: >-
                      Unit price of a SKU. The value is multiplied by 100 to
                      represent 2 decimal places. For example `10000 cents` for
                      `$100.00`.
        metadata:
          type: object
          description: >-
            The metadata object stores all custom attributes assigned to the
            order. A set of key/value pairs that are att to an order object.
            Stores additional information about the order in a structured
            format.
        customer:
          type: object
          description: >-
            Object containing information about the customer that is making the
            purchase.
          properties:
            id:
              type: string
              example: cust_7iUa6ICKyU6gH40dBU25kQU1
              description: >-
                Unique customer identifier of the customer making the purchase.
                The ID is assigned by Voucherify.
            object:
              type: string
              default: customer
              description: Type of object represented by the `customer` object.
        referrer:
          type: object
          description: Object containing information about the referrer.
          properties:
            id:
              type: string
              example: cust_7iUa6ICKyU6gH40dBU25kQU1
              description: >-
                Unique referrer ID, who referred the customer making the
                purchase.
            object:
              type: string
              default: customer
              description: Type of object represented by the `referrer` object.
        customer_id:
          type: string
          example: cust_7iUa6ICKyU6gH40dBU25kQU1
          description: >-
            Unique customer identifier of the customer making the purchase. The
            ID is assigned by Voucherify.
        referrer_id:
          type: string
          example: cust_nM4jqPiaXUvQdVSA6vTRUnix
          description: Unique referrer ID.
        object:
          type: string
          default: order
          description: >-
            The type of the object represented by JSON. This object stores
            information about the `order`.
        redemptions:
          description: Lists details related to the redemption.
          allOf:
            - $ref: '#/components/schemas/10_obj_order_object_unstacked_redemptions'
    7_obj_order_object_apply_to_items:
      type: object
      title: 'Order object - Effect: Apply to items'
      description: >-
        This is an object representing an order with calculated discounts
        applied using the voucher code.
      properties:
        id:
          type: string
          example: ord_OLWs41pBk7VFn6ZTyX9U6keh
          description: 'Unique order ID, assigned by Voucherify. '
        source_id:
          type: string
          description: >-
            The merchant's order ID if it is different from the Voucherify order
            ID. It is really useful in case of integration between multiple
            systems. It can be an order ID from CRM, database or 3rd party
            service.
        created_at:
          type: string
          format: date-time
          example: '2022-10-06T11:40:48.705Z'
          description: >-
            Timestamp representing the date and time when the order was created.
            The value is shown in the ISO 8601 format.
        updated_at:
          type: string
          format: date-time
          example: '2022-10-06T11:47:20.760Z'
          description: >-
            Timestamp representing the date and time when the order was updated.
            The value is shown in the ISO 8601 format.
        status:
          type: string
          description: Order status.
          enum:
            - CREATED
            - PAID
            - CANCELED
            - FULFILLED
        amount:
          type: integer
          description: Order amount before applying any discount.
        items_discount_amount:
          type: integer
          description: |-
            Sum of all product-specific discounts applied to the order.  
            `sum(items, i => i.discount_amount)`
        total_discount_amount:
          type: integer
          description: >-
            Sum of all order-level AND all product-specific discounts applied to
            the order.
        total_amount:
          type: integer
          description: |-
            Order amount after applying all the discounts.  
            `total_amount` = `amount` - `total_discount_amount`
        items_applied_discount_amount:
          type: integer
          description: Sum of all product-specific discounts applied.
        total_applied_discount_amount:
          type: integer
          description: >-
            Sum of all order-level AND all product-specific discounts applied to
            the order.
        items:
          type: array
          description: >-
            Array of order items that have been applied to the order. Each order
            item can show the effects of particular discounts on the item-level.
          items:
            type: object
            properties:
              object:
                type: string
                default: order_item
                description: >-
                  The type of the object represented by JSON. This object stores
                  information about the `order_item`.
              product_id:
                type: string
                example: prod_5h0wc453_1
                description: >-
                  A unique identifier that represents the product and is
                  assigned by Voucherify.
              sku_id:
                type: string
                example: sku_prod_5h0wc453_1_1
                description: >-
                  A unique identifier that represents the SKU and is assigned by
                  Voucherify.
              quantity:
                type: integer
                description: Quantity of the item in the cart.
              amount:
                type: integer
                description: >-
                  Represents a total pre-discount amount of order item (`price`
                  * `quantity`).
              discount_amount:
                type: integer
                description: The item-level discount applied to the item.
              applied_discount_amount:
                type: integer
                description: The item-level discount applied to the item.
              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`-`discount_amount`
              product:
                type: object
                description: This object stores more information about the related product.
                properties:
                  id:
                    type: string
                    example: prod_5h0wc453_1
                    description: >-
                      A unique identifier that represents the product and is
                      assigned by Voucherify.
                  source_id:
                    type: string
                    description: A unique product identifier from your inventory system.
                    example: illy-arabica
                  name:
                    type: string
                    example: Brewing System
                    description: Product name.
                  price:
                    type: integer
                    description: >-
                      Unit price of a product. The value is multiplied by 100 to
                      represent 2 decimal places. For example `10000 cents` for
                      `$100.00`.
              sku:
                type: object
                description: This object stores more information about the related SKU.
                properties:
                  id:
                    type: string
                    example: sku_prod_5h0wc453_1_1
                    description: >-
                      A unique identifier that represents the SKU and is
                      assigned by Voucherify.
                  source_id:
                    type: string
                    example: illy-arabica-250g
                    description: A unique SKU identifier from your inventory system.
                  sku:
                    type: string
                    description: SKU name.
                  price:
                    type: integer
                    description: >-
                      Unit price of a SKU. The value is multiplied by 100 to
                      represent 2 decimal places. For example `10000 cents` for
                      `$100.00`.
        metadata:
          type: object
          description: >-
            The metadata object stores all custom attributes assigned to the
            order. A set of key/value pairs that are att to an order object.
            Stores additional information about the order in a structured
            format.
        customer:
          type: object
          description: >-
            Object containing information about the customer that is making the
            purchase.
          properties:
            id:
              type: string
              example: cust_7iUa6ICKyU6gH40dBU25kQU1
              description: >-
                Unique customer identifier of the customer making the purchase.
                The ID is assigned by Voucherify.
            object:
              type: string
              default: customer
              description: Type of object represented by the `customer` object.
        referrer:
          type: object
          description: Object containing information about the referrer.
          properties:
            id:
              type: string
              example: cust_7iUa6ICKyU6gH40dBU25kQU1
              description: >-
                Unique referrer ID, who referred the customer making the
                purchase.
            object:
              type: string
              default: customer
              description: Type of object represented by the `referrer` object.
        customer_id:
          type: string
          example: cust_7iUa6ICKyU6gH40dBU25kQU1
          description: >-
            Unique customer identifier of the customer making the purchase. The
            ID is assigned by Voucherify.
        referrer_id:
          type: string
          example: cust_nM4jqPiaXUvQdVSA6vTRUnix
          description: Unique referrer ID.
        object:
          type: string
          default: order
          description: >-
            The type of the object represented by JSON. This object stores
            information about the `order`.
        redemptions:
          description: Lists details related to the redemption.
          allOf:
            - $ref: '#/components/schemas/10_obj_order_object_unstacked_redemptions'
    VoucherBase:
      title: Voucher Base
      description: This is an object representing a voucher.
      type: object
      properties:
        id:
          type: string
          example: v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV
          description: Assigned by the Voucherify API, identifies the voucher.
        code:
          type: string
          example: WVPblOYX
          description: >-
            A code that identifies a voucher. Pattern can use all letters of the
            English alphabet, Arabic numerals, and special characters.
        campaign:
          type: string
          example: Gift Card Campaign
          description: A unique campaign name, identifies the voucher's parent campaign.
        campaign_id:
          type: string
          example: camp_FNYR4jhqZBM9xTptxDGgeNBV
          description: >-
            Assigned by the Voucherify API, identifies the voucher's parent
            campaign.
        category:
          type: string
          description: >-
            Tag defining the category that this voucher belongs to. Useful when
            listing vouchers using the List Vouchers endpoint.
        category_id:
          type: string
          description: Unique category ID assigned by Voucherify.
          example: cat_0bb343dee3cdb5ec0c
        type:
          type: string
          enum:
            - GIFT_VOUCHER
            - DISCOUNT_VOUCHER
            - LOYALTY_CARD
          description: 'Defines the type of the voucher. '
        discount:
          $ref: '#/components/schemas/Discount'
        gift:
          type: object
          description: >-
            Object representing gift parameters. Child attributes are present
            only if `type` is `GIFT_VOUCHER`. Defaults to `null`.
          properties:
            amount:
              type: integer
              example: 10000
              description: >-
                Total gift card income over the lifetime of the card. The value
                is multiplied by 100 to represent 2 decimal places. For example
                `10000 cents` for `$100.00`.
            subtracted_amount:
              type: integer
              description: >-
                Total amount of subtracted credits over the gift card lifetime.
                The value is multiplied by 100 to represent 2 decimal places.
                For example `10000 cents` for `$100.00`.
            balance:
              type: integer
              example: 500
              description: >-
                Available funds. The value is multiplied by 100 to represent 2
                decimal places. For example `10000 cents` for `$100.00`.
            effect:
              type: string
              enum:
                - APPLY_TO_ORDER
                - APPLY_TO_ITEMS
              description: Defines how the credits are applied to the customer's order.
        loyalty_card:
          type: object
          description: >-
            Object representing loyalty card parameters. Child attributes are
            present only if `type` is `LOYALTY_CARD`. Defaults to `null`.
          properties:
            points:
              type: integer
              example: 7000
              description: >-
                Total number of points added to the loyalty card over its
                lifespan.
            balance:
              type: integer
              example: 6970
              description: >-
                Points available for reward redemption. This is calculated as
                follows: `balance` = `points` - `expired_points` -
                `subtracted_points` - `redemption.redeemed_points`.
            next_expiration_date:
              type: string
              format: date
              example: '2023-05-30'
              description: >-
                The next closest date when the next set of points are due to
                expire.
            next_expiration_points:
              type: integer
              description: The amount of points that are set to expire next.
            pending_points:
              type: integer
              description: >-
                Shows the number of pending points that will be added to the
                loyalty card when they are activated automatically or manually.
            expired_points:
              type: integer
              description: >-
                Shows the total number of expired points over the lifetime of
                the loyalty card.
            subtracted_points:
              type: integer
              description: >-
                Shows the total number of subtracted points over the lifetime of
                the loyalty card.
        start_date:
          type: string
          example: '2021-12-01T00:00:00.000Z'
          format: date-time
          description: >-
            Activation timestamp defines when the code starts to be active in
            ISO 8601 format. Voucher is *inactive before* this date. 
        expiration_date:
          type: string
          example: '2021-12-31T00:00:00.000Z'
          format: date-time
          description: >-
            Expiration timestamp defines when the code expires in ISO 8601
            format.  Voucher is *inactive after* this date.
        validity_timeframe:
          $ref: '#/components/schemas/ValidityTimeframe'
        validity_day_of_week:
          $ref: '#/components/schemas/ValidityDayOfWeek'
        validity_hours:
          $ref: '#/components/schemas/ValidityHours'
        active:
          type: boolean
          nullable: true
          description: >-
            A flag to toggle the voucher on or off. You can disable a voucher
            even though it's within the active period defined by the
            `start_date` and `expiration_date`.  


            - `true` indicates an *active* voucher

            - `false` indicates an *inactive* voucher
        additional_info:
          type: string
          description: >-
            An optional field to keep any extra textual information about the
            code such as a code description and details.
        metadata:
          type: object
          description: >-
            The metadata object stores all custom attributes assigned to the
            code. A set of key/value pairs that you can attach to a voucher
            object. It can be useful for storing additional information about
            the voucher in a structured format.
        assets:
          $ref: '#/components/schemas/VoucherAssets'
        is_referral_code:
          type: boolean
          nullable: true
          description: >-
            Flag indicating whether this voucher is a referral code; `true` for
            campaign type `REFERRAL_PROGRAM`.
        created_at:
          type: string
          example: '2021-12-22T10:13:06.487Z'
          description: >-
            Timestamp representing the date and time when the voucher was
            created. The value is shown in the ISO 8601 format.
          format: date-time
        updated_at:
          type: string
          example: '2021-12-22T10:14:45.316Z'
          format: date-time
          description: >-
            Timestamp representing the date and time when the voucher was last
            updated in ISO 8601 format.
        holder_id:
          type: string
          example: cust_eWgXlBBiY6THFRJwX45Iakv4
          description: >-
            Unique customer identifier of the redeemable holder. It equals to
            the customer ID assigned by Voucherify.
        referrer_id:
          type: string
          description: Unique identifier of the referring person.
          example: cust_Vzck5i8U3OhcEUFY6MKhN9Rv
        object:
          type: string
          description: The type of the object represented by JSON. Default is `voucher`.
          default: voucher
        publish:
          type: object
          description: >-
            Stores a summary of publication events: an event counter and
            endpoint to return details of each event. Publication is an
            assignment of a code to a customer, e.g. through a distribution.
          properties:
            object:
              type: string
              default: list
              description: >-
                The type of the object represented is by default `list`. To get
                this list, you need to make a call to the endpoint returned in
                the `url` attribute.
            count:
              type: integer
              example: 0
              description: Publication events counter.
            url:
              type: string
              example: /v1/vouchers/WVPblOYX/publications?page=1&limit=10
              description: >-
                The endpoint where this list of publications can be accessed
                using a **GET** method.
                `/v1/vouchers/{voucher_code}/publications`
        redemption:
          type: object
          description: >-
            Stores a summary of redemptions that have been applied to the
            voucher.
          properties:
            quantity:
              type: integer
              description: >-
                How many times a voucher can be redeemed. A `null` value means
                unlimited.
            redeemed_quantity:
              type: integer
              example: 1
              description: How many times a voucher has already been redeemed.
            redeemed_points:
              type: integer
              example: 100000
              description: Total loyalty points redeemed.
            object:
              type: string
              default: list
              description: >-
                The type of the object represented is by default `list`. To get
                this list, you need to make a call to the endpoint returned in
                the url attribute.
            url:
              type: string
              example: /v1/vouchers/WVPblOYX/redemptions?page=1&limit=10
              description: >-
                The endpoint where this list of redemptions can be accessed
                using a **GET** method.
                `/v1/vouchers/{voucher_code}/redemptions`
    Category:
      title: Category
      description: This is an object representing a category.
      type: object
      properties:
        id:
          type: string
          description: Unique category ID assigned by Voucherify.
        name:
          type: string
          description: Category name.
        hierarchy:
          type: integer
          description: >-
            Category hierarchy. Categories with lower hierarchy are processed
            before categories with higher hierarchy value.
          minimum: 0
        object:
          type: string
          default: category
          enum:
            - category
          description: >-
            The type of the object represented by the JSON. This object stores
            information about the category.
        created_at:
          type: string
          description: >-
            Timestamp representing the date and time when the category was
            created. The value is shown in the ISO 8601 format.
          example: '2022-07-14T10:45:13.156Z'
          format: date-time
        updated_at:
          type: string
          example: '2022-08-16T10:52:08.094Z'
          description: >-
            Timestamp representing the date and time when the category was
            updated. The value is shown in the ISO 8601 format.
          format: date-time
      required:
        - id
        - name
        - hierarchy
        - created_at
        - object
    ValidationRulesAssignmentsList:
      title: Validation Rules Assignments List
      description: List of Validation Rules Assignments
      type: object
      properties:
        object:
          type: string
          default: list
          enum:
            - list
          description: >-
            The type of the object represented by JSON. This object stores
            information about validation rules assignments.
        data_ref:
          type: string
          default: data
          enum:
            - data
          description: >-
            Identifies the name of the attribute that contains the array of
            validation rules assignments.
        data:
          type: array
          description: Contains array of validation rules assignments.
          items:
            $ref: '#/components/schemas/BusValRuleAssignment'
        total:
          type: integer
          minimum: 0
          description: Total number of validation rules assignments.
      required:
        - object
        - data_ref
        - data
        - total
    SimpleCustomer:
      title: Simple Customer
      type: object
      description: Simplified customer data.
      properties:
        id:
          type: string
          description: >-
            Unique identifier of an existing customer. It is assigned by
            Voucherify.
        name:
          type: string
          description: Customer's first and last name.
        email:
          type: string
          description: Customer's email address.
        source_id:
          type: string
          description: >-
            A unique identifier of the customer. It can be a customer ID or
            email from a CRM system, database, or a third-party service.
        metadata:
          type: object
          description: >-
            A set of custom key/value pairs that are attached to the customer.
            It stores all custom attributes assigned to the customer.
        object:
          type: string
          description: The type of the object represented by JSON.
          enum:
            - customer
    Product:
      type: object
      description: >-
        This is an object representing a product.  


        This entity should be used to map product items from your inventory
        management system. The aim of products is to build which reflect
        product-specific campaigns.
      title: Product
      allOf:
        - $ref: '#/components/schemas/ProductWithoutSkus'
        - type: object
          properties:
            skus:
              $ref: '#/components/schemas/SkusListForProduct'
    Sku:
      title: SKU Object
      type: object
      description: This is an object representing a product SKU.
      properties:
        id:
          type: string
          example: sku_0b1621b319d248b79f
          description: >-
            A unique identifier that represents the SKU and is assigned by
            Voucherify.
        source_id:
          type: string
          nullable: true
          example: sku_source_id_4
          description: A unique SKU identifier from your inventory system.
        product_id:
          type: string
          example: prod_0b15f6b9f650c16990
          description: The parent product's unique ID.
        sku:
          type: string
          nullable: true
          example: Large Pink Shirt
          description: Unique user-defined SKU name.
        price:
          type: integer
          nullable: true
          description: >-
            Unit price. It is represented by a value multiplied by 100 to
            accurately reflect 2 decimal places, such as `$100.00` being
            expressed as `10000`.
        currency:
          type: string
          nullable: true
          description: SKU price currency.
          example: USD
        attributes:
          type: object
          description: >-
            The attributes object stores values for all custom attributes
            inherited by the SKU from the parent product. A set of key/value
            pairs that are attached to a SKU object and are unique to each SKU
            within a product family.
        image_url:
          type: string
          nullable: true
          description: >-
            The HTTPS URL pointing to the .png or .jpg file that will be used to
            render the SKU image.
        metadata:
          type: object
          description: >-
            The metadata object stores all custom attributes assigned to the
            SKU. A set of key/value pairs that you can attach to a SKU object.
            It can be useful for storing additional information about the SKU in
            a structured format. It can be used to create product collections.
        created_at:
          type: string
          example: '2022-05-17T10:36:30.187Z'
          description: >-
            Timestamp representing the date and time when the SKU was created.
            The value is shown in the ISO 8601 format.
          format: date-time
        updated_at:
          type: string
          nullable: true
          example: '2022-05-17T10:55:09.137Z'
          description: >-
            Timestamp representing the date and time when the SKU was updated.
            The value is shown in the ISO 8601 format.
          format: date-time
        object:
          type: string
          default: sku
          description: >-
            The type of the object represented by JSON. This object stores
            information about the `SKU`.
          enum:
            - sku
      required:
        - id
        - source_id
        - product_id
        - sku
        - price
        - attributes
        - metadata
        - image_url
        - created_at
        - updated_at
        - object
    7_obj_redemption_object_loyalty_card_digital_discount_voucher:
      type: object
      title: Discount Voucher
      description: Contains information about the source of the digital reward.
      properties:
        id:
          type: string
          example: camp_0dJG7cCAjquzcxWmZ634bA0C
          description: Unique parent campaign ID of reward.
        type:
          type: string
          description: Campaign type.
          default: DISCOUNT_COUPONS
          enum:
            - DISCOUNT_COUPONS
    7_obj_redemption_object_loyalty_card_digital_gift_card_credits:
      type: object
      title: Gift Card
      description: Contains information about the source of the digital reward.
      properties:
        id:
          type: string
          example: camp_0dJG7cCAjquzcxWmZ634bA0C
          description: Unique parent campaign ID of reward.
        balance:
          type: integer
          description: >-
            The amount credited to the gift card as a reward expressed as the
            smallest currency unit (e.g. 100 cents for $1.00).
        type:
          type: string
          description: Campaign type.
          default: GIFT_VOUCHERS
          enum:
            - GIFT_VOUCHERS
    7_obj_redemption_object_loyalty_card_digital_loyalty_card_points:
      type: object
      title: Loyalty Card
      description: Contains information about the source of the digital reward.
      properties:
        id:
          type: string
          example: camp_0dJG7cCAjquzcxWmZ634bA0C
          description: Unique parent campaign ID of reward.
        balance:
          type: integer
          description: >-
            The number of loyalty points that is added to the loyalty card as a
            reward.
        type:
          type: string
          description: Campaign type.
          default: LOYALTY_PROGRAM
          enum:
            - LOYALTY_PROGRAM
    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
    10_obj_order_object_unstacked_redemptions:
      type: object
      title: Unstacked Redemption
      description: Redemption object representing a single redemption.
      properties:
        redemption_ID:
          type: object
          description: >-
            The property name is the unique redemption ID; i.e.
            `r_0ba186c4824e4881e1`. This object contains information about the
            redemption of an incentive.
          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
            related_object_type:
              type: string
              description: The source of the incentive.
              enum:
                - voucher
                - promotion_tier
            related_object_id:
              type: string
              description: Unique ID of the related object that defines the incentive.
            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.
    Discount:
      title: Discount
      type: object
      description: Contains information about discount.
      oneOf:
        - $ref: '#/components/schemas/DiscountAmount'
        - $ref: '#/components/schemas/DiscountUnit'
        - $ref: '#/components/schemas/DiscountUnitMultiple'
        - $ref: '#/components/schemas/DiscountPercent'
        - $ref: '#/components/schemas/DiscountFixed'
    ValidityTimeframe:
      title: Validity Timeframe
      type: object
      description: >-
        Set recurrent time periods when the earning rule is valid. For example,
        valid for 1 hour every other day.`start_date` **required** when
        including the `validity_timeframe`.
      properties:
        duration:
          type: string
          description: >-
            Defines the amount of time an earning rule will be active in ISO
            8601 format. For example, an earning rule with a `duration` of
            `PT1H` will be valid for a duration of one hour.
          example: PT1H
        interval:
          type: string
          description: >-
            Defines the intervening time between two time points in ISO 8601
            format, expressed as a duration. For example, an earning rule with
            an `interval` of `P2D` will be valid every other day.
          example: P2D
    ValidityDayOfWeek:
      title: Validity Day Of Week
      type: array
      description: >-
        Integer array corresponding to the particular days of the week in which
        the voucher is valid.


        - `0` Sunday

        - `1` Monday

        - `2` Tuesday

        - `3` Wednesday

        - `4` Thursday

        - `5` Friday

        - `6` Saturday
      items:
        type: integer
        enum:
          - 0
          - 1
          - 2
          - 3
          - 4
          - 5
          - 6
    ValidityHours:
      title: Validity Hours
      type: object
      description: Determines the hours of validity, e.g. to create a happy hours scenario.
      properties:
        daily:
          type: array
          description: >-
            Defines the recurring period(s) when the resource is active. The
            periods should not overlap.
          items:
            type: object
            description: Defines the recurring period(s) when the resource will be active.
            properties:
              start_time:
                type: string
                format: time
                description: >-
                  Defines the starting hour of validity in the HH:mm format. The
                  resource is *inactive before* this time.
                example: '12:00'
              days_of_week:
                type: array
                description: >-
                  Integer array corresponding to the particular days of the week
                  in which the resource is valid.


                  - `0` Sunday

                  - `1` Monday

                  - `2` Tuesday

                  - `3`  Wednesday

                  - `4` Thursday

                  - `5` Friday

                  - `6` Saturday
                items:
                  type: integer
                  enum:
                    - 0
                    - 1
                    - 2
                    - 3
                    - 4
                    - 5
                    - 6
              expiration_time:
                type: string
                format: time
                description: >-
                  Defines the ending hour of validity in the HH:mm format. The
                  resource is *inactive after* this time.
                example: '14:00'
    VoucherAssets:
      title: Voucher Assets
      type: object
      description: >-
        Stores links to images of QR and barcode that correspond to an encrypted
        voucher code.
      properties:
        qr:
          type: object
          description: Stores Quick Response (QR) representation of encrypted code.
          properties:
            id:
              type: string
              example: >-
                U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK+t4pp7U7oFzjGJzj9q/bmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg+BaZk5QwXMf8k/OzSlOEVybpwSq+AiqPoNtjeuqtIgkDyvT6Q==
              description: Encrypted voucher code ID.
            url:
              type: string
              example: >-
                https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK%2Bt4pp7U7oFzjGJzj9q%2FbmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg%2BBaZk5QwXMf8k%2FOzSlOEVybpwSq%2BAiqPoNtjeuqtIgkDyvT6Q%3D%3D
              description: >-
                URL to QR code  


                *Optional:* Attach query parameters to base URL to customize the
                image of the encrypted voucher code.  


                - `size`: integer value from `1` to `100`  

                - `format`: string, either `png` (default) or `svg`
        barcode:
          type: object
          description: Stores barcode representation of encrypted code.
          properties:
            id:
              type: string
              example: >-
                U2FsdGVkX19eJhGfWwUrH9+tulBkON+AnMktic+N6CVWzZ9+fHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ+kJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6/pFs61apEn9SJx32ttCF6d3oxKISQQ==
              description: Encrypted voucher code ID.
            url:
              type: string
              example: >-
                https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D
              description: >-
                URL to barcode  


                *Optional:* Attach query parameters to base URL to customize the
                image of the encrypted voucher code.  


                - `size`: integer value from `1` to `100`  

                - `format`: string, either `png` (default) or `svg`
    BusValRuleAssignment:
      title: Business Validation Rule Assignment
      description: Assignments of business validation rule
      example:
        id: asgm_LnY1g7UNFA9KyDrD
        rule_id: val_3gPNA6SnH4ae
        related_object_id: camp_CZOnEGiZfwIKWmSjhIoIT7Ol
        related_object_type: campaign
        object: validation_rules_assignment
        validation_status: PARTIALLY_VALID
        validation_omitted_rules:
          - '1'
      properties:
        id:
          type: string
          description: The unique identifier for a assignment
        rule_id:
          type: string
          description: The unique identifier for a rule
        related_object_id:
          type: string
          description: The unique identifier for a related object
        related_object_type:
          type: string
          description: The type of related object
        created_at:
          type: string
          description: >-
            Timestamp representing the date and time when the object was
            created. The value is shown in the ISO 8601 format.
          example: '2022-03-09T11:19:04.819Z'
          format: date-time
        updated_at:
          type: string
          description: >-
            Timestamp representing the date and time when the object was last
            updated in ISO 8601 format.
          example: '2022-03-09T11:19:04.819Z'
          format: date-time
        object:
          type: string
          description: The type of the object represented by JSON.
          default: validation_rules_assignment
          enum:
            - validation_rules_assignment
        validation_status:
          type: string
          description: The validation status of the assignment
          enum:
            - VALID
            - PARTIALLY_VALID
            - INVALID
        validation_omitted_rules:
          type: array
          description: The list of omitted rules
          items:
            type: string
      required:
        - id
        - rule_id
        - related_object_id
        - related_object_type
        - object
    ProductWithoutSkus:
      title: Product without Skus Object
      properties:
        id:
          type: string
          description: Unique product ID assigned by Voucherify.
          example: prod_0b1da8105693710357
        source_id:
          type: string
          nullable: true
          example: productSourceID16
          description: Unique product source ID.
        name:
          type: string
          nullable: true
          description: Unique user-defined product name.
          example: T-shirt
        price:
          type: integer
          nullable: true
          description: >-
            Unit price. It is represented by a value multiplied by 100 to
            accurately reflect 2 decimal places, such as `$100.00` being
            expressed as `10000`.
        attributes:
          type: array
          description: >-
            A list of product attributes whose values you can customize for
            given SKUs: `["color","size","ranking"]`. Each child SKU can have a
            unique value for a given attribute.
          items:
            type: string
        metadata:
          type: object
          description: >-
            The metadata object stores all custom attributes assigned to the
            product. A set of key/value pairs that you can attach to a product
            object. It can be useful for storing additional information about
            the product in a structured format. It can be used to create product
            collections.
        image_url:
          type: string
          nullable: true
          description: >-
            The HTTPS URL pointing to the .png or .jpg file that will be used to
            render the product image.
          example: https://images.com/original.jpg
        created_at:
          type: string
          description: >-
            Timestamp representing the date and time when the product was
            created. The value is shown in the ISO 8601 format.
          example: '2022-05-23T06:52:55.008Z'
          format: date-time
        updated_at:
          type: string
          nullable: true
          description: >-
            Timestamp representing the date and time when the product was
            updated. The value is shown in the ISO 8601 format.
          example: '2022-05-23T09:24:07.405Z'
          format: date-time
        object:
          type: string
          description: >-
            The type of the object represented by JSON. This object stores
            information about the product.
          default: product
          enum:
            - product
      required:
        - id
        - source_id
        - name
        - attributes
        - metadata
        - object
        - price
    SkusListForProduct:
      type: object
      description: Contains information about child SKUs.
      title: Skus List For Product
      properties:
        object:
          type: string
          description: >-
            The type of the object represented by JSON. This object stores
            information about SKUs.
          default: list
        data_ref:
          type: string
          description: >-
            Identifies the name of the JSON property that contains the array of
            SKUs.
          default: data
        data:
          type: array
          description: A dictionary that contains an array of SKUs.
          items:
            $ref: '#/components/schemas/Sku'
        total:
          type: integer
          description: Total number of SKUs in the product.
      required:
        - object
        - data_ref
        - data
        - total
    DiscountAmount:
      type: object
      title: Amount
      properties:
        type:
          type: string
          default: AMOUNT
          enum:
            - AMOUNT
          description: Defines the type of the voucher.
        amount_off:
          type: number
          description: >-
            Amount taken off the subtotal of a price. Value is multiplied by 100
            to precisely represent 2 decimal places. For example, a $10 discount
            is written as 1000.
        amount_off_formula:
          type: string
          description: Formula used to dynamically calculate the discount.
        aggregated_amount_limit:
          type: integer
          description: Maximum discount amount per order.
        effect:
          description: Defines how the discount is applied to the customer's order.
          allOf:
            - $ref: '#/components/schemas/DiscountAmountVouchersEffectTypes'
        is_dynamic:
          type: boolean
          description: Flag indicating whether the discount was calculated using a formula.
      required:
        - type
        - amount_off
    DiscountUnit:
      type: object
      title: Unit
      properties:
        type:
          type: string
          default: UNIT
          enum:
            - UNIT
          description: Discount type.
        unit_off:
          type: integer
          description: Number of units to be granted a full value discount.
        unit_off_formula:
          type: string
          description: Formula used to dynamically calculate the number of units.
        effect:
          description: Defines how the unit is added to the customer's order.
          allOf:
            - $ref: '#/components/schemas/DiscountUnitVouchersEffectTypes'
        unit_type:
          type: string
          description: >-
            The product deemed as free, chosen from product inventory (e.g.
            time, items).
        product:
          description: Contains information about the product.
          allOf:
            - $ref: '#/components/schemas/SimpleProductDiscountUnit'
        sku:
          $ref: '#/components/schemas/SimpleSkuDiscountUnit'
        is_dynamic:
          type: boolean
          description: Flag indicating whether the discount was calculated using a formula.
      required:
        - type
        - unit_type
    DiscountUnitMultiple:
      type: object
      title: Unit Multiple
      properties:
        type:
          type: string
          default: UNIT
          enum:
            - UNIT
          description: Discount type.
        effect:
          type: string
          default: ADD_MANY_ITEMS
          enum:
            - ADD_MANY_ITEMS
          description: Defines how the discount is applied to the customer's order.
        units:
          type: array
          items:
            $ref: '#/components/schemas/DiscountUnitMultipleOneUnit'
      required:
        - type
        - units
    DiscountPercent:
      type: object
      title: Percent
      properties:
        type:
          type: string
          default: PERCENT
          enum:
            - PERCENT
          description: Defines the type of the voucher.
        percent_off:
          type: number
          description: The percent discount that the customer will receive.
        percent_off_formula:
          type: string
          description: Formula used to dynamically calculate the discount.
        amount_limit:
          type: number
          description: >-
            Upper limit allowed to be applied as a discount. Value is multiplied
            by 100 to precisely represent 2 decimal places. For example, a $6
            maximum discount is written as 600.
        aggregated_amount_limit:
          type: integer
          description: Maximum discount amount per order.
        effect:
          description: Defines how the discount is applied to the customer's order.
          allOf:
            - $ref: '#/components/schemas/DiscountPercentVouchersEffectTypes'
        is_dynamic:
          type: boolean
          description: Flag indicating whether the discount was calculated using a formula.
      required:
        - type
        - percent_off
    DiscountFixed:
      title: Fixed
      type: object
      properties:
        type:
          type: string
          default: FIXED
          enum:
            - FIXED
          description: Defines the type of the voucher.
        fixed_amount:
          type: number
          description: >-
            Sets a fixed value for an order total or the item price. The value
            is multiplied by 100 to precisely represent 2 decimal places. For
            example, a $10 discount is written as 1000. If the fixed amount is
            calculated by the formula, i.e. the `fixed_amount_formula` parameter
            is present in the fixed amount definition, this value becomes the
            **fallback value**. As a result, if the formula cannot be calculated
            due to missing metadata, for example, this value will be used as the
            fixed value.
        fixed_amount_formula:
          type: string
          description: Formula used to dynamically calculate the discount.
        effect:
          description: Defines how the discount is applied to the customer's order.
          allOf:
            - $ref: '#/components/schemas/DiscountFixedVouchersEffectTypes'
        is_dynamic:
          type: boolean
          description: Flag indicating whether the discount was calculated using a formula.
      required:
        - type
        - fixed_amount
    DiscountAmountVouchersEffectTypes:
      title: Discount Amount Vouchers Effect Types
      enum:
        - APPLY_TO_ORDER
        - APPLY_TO_ITEMS
        - APPLY_TO_ITEMS_PROPORTIONALLY
        - APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY
        - APPLY_TO_ITEMS_BY_QUANTITY
      type: string
    DiscountUnitVouchersEffectTypes:
      title: Discount Unit Vouchers Effect Types
      enum:
        - ADD_MISSING_ITEMS
        - ADD_NEW_ITEMS
        - ADD_MANY_ITEMS
        - ADD_SAME_ITEMS
      type: string
    SimpleProductDiscountUnit:
      type: object
      title: Simple Product Discount Unit
      properties:
        id:
          type: string
          description: Unique product ID, assigned by Voucherify.
        source_id:
          type: string
          description: Product's source ID.
        name:
          type: string
          description: Product name.
      required:
        - id
        - name
    SimpleSkuDiscountUnit:
      type: object
      title: Simple Sku Discount Unit
      properties:
        id:
          type: string
          description: Unique SKU ID, assigned by Voucherify.
        source_id:
          type: string
          description: Product variant's source ID.
        name:
          type: string
          description: Sku name
      required:
        - id
        - name
    DiscountUnitMultipleOneUnit:
      type: object
      title: One Unit
      properties:
        unit_off:
          type: number
          description: Number of units to be granted a full value discount.
        unit_off_formula:
          type: string
          description: Formula used to dynamically calculate the number of units.
        effect:
          type: string
          enum:
            - ADD_NEW_ITEMS
            - ADD_MISSING_ITEMS
          description: |+
            Defines how the unit is added to the customer's order.

        unit_type:
          type: string
          description: >-
            The product deemed as free, chosen from product inventory (e.g.
            time, items).
        product:
          description: Contains information about the product.
          allOf:
            - $ref: '#/components/schemas/SimpleProductDiscountUnit'
        sku:
          description: Contains information about the sku.
          allOf:
            - $ref: '#/components/schemas/SimpleSkuDiscountUnit'
      required:
        - effect
        - unit_type
    DiscountPercentVouchersEffectTypes:
      title: Discount Percent Vouchers Effect Types
      enum:
        - APPLY_TO_ORDER
        - APPLY_TO_ITEMS
      type: string
    DiscountFixedVouchersEffectTypes:
      title: Discount Fixed Vouchers Effect Types
      enum:
        - APPLY_TO_ORDER
        - APPLY_TO_ITEMS
      type: string
  securitySchemes:
    X-Client-Application-Id:
      type: apiKey
      name: X-Client-Application-Id
      in: header
    X-Client-Token:
      type: apiKey
      name: X-Client-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`.

````