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

# List Voucher Transactions

> List transactions that are associated with credit movements on a gift card or loyalty card.



## OpenAPI

````yaml /openapi/vouchers.json get /v1/vouchers/{code}/transactions
openapi: 3.0.1
info:
  title: Voucherify API - Vouchers
  version: v2018-08-01
  description: >-
    Voucherify promotion engine REST API. Please see
    https://docs.voucherify.io/docs for more details.
  contact:
    name: Voucherify Team
    url: https://www.voucherify.io/contact-support
    email: support@voucherify.io
  termsOfService: https://www.voucherify.io/legal/subscription-agreement
  license:
    name: MIT
    url: https://github.com/voucherifyio/voucherify-js-sdk/blob/main/LICENSE
servers:
  - url: https://{cluster}.voucherify.io
    description: Base URL
    variables:
      cluster:
        default: api
        enum:
          - api
          - us1.api
          - as1.api
          - download
          - us1.download
          - as1.download
security: []
paths:
  /v1/vouchers/{code}/transactions:
    parameters:
      - schema:
          $ref: '#/components/schemas/ParameterCode'
        name: code
        in: path
        description: >-
          A **code** that identifies the voucher or a unique voucher ID assigned
          by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`.
        required: true
    get:
      tags:
        - Vouchers
      summary: List Voucher Transactions
      description: >-
        List transactions that are associated with credit movements on a gift
        card or loyalty card.
      operationId: list-voucher-transactions
      parameters:
        - $ref: '#/components/parameters/limit'
        - schema:
            $ref: '#/components/schemas/ParameterOrderListTransactions'
          in: query
          name: order
          description: >-
            Sorts the results using one of the filtering options, where the dash
            - preceding a sorting option means sorting in a descending order.
        - schema:
            $ref: '#/components/schemas/ParameterString'
          in: query
          name: starting_after_id
          description: >-
            A cursor for pagination. It retrieves the transactions starting
            after a transaction with the given ID.
      responses:
        '200':
          description: Returns a dictionary of transaction objects
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VouchersTransactionsListResponseBody'
              examples:
                Example:
                  value:
                    object: list
                    data_ref: data
                    data:
                      - id: vtx_0c9dccc4d5813e71bd
                        source_id: 20230317_subtract_1
                        voucher_id: v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
                        campaign_id: camp_FNYR4jhqZBM9xTptxDGgeNBV
                        source: API
                        reason: Subtracting credits from card
                        type: CREDITS_REMOVAL
                        details:
                          balance:
                            type: gift_voucher
                            total: 128020
                            amount: -2000
                            object: balance
                            balance: 121020
                            related_object:
                              id: v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
                              type: voucher
                        related_transaction_id: null
                        created_at: '2023-03-17T15:50:00.786Z'
                      - id: vtx_0c9dcc920ac0e9ef82
                        source_id: 20230317_add_1
                        voucher_id: v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
                        campaign_id: camp_FNYR4jhqZBM9xTptxDGgeNBV
                        source: API
                        reason: Adding more points to card
                        type: CREDITS_ADDITION
                        details:
                          balance:
                            type: gift_voucher
                            total: 130020
                            amount: 20
                            object: balance
                            balance: 123020
                            related_object:
                              id: v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
                              type: voucher
                        related_transaction_id: null
                        created_at: '2023-03-17T15:49:08.768Z'
                      - id: vtx_0c94f018d30bef6689
                        source_id: HRwc0oHz_reward
                        voucher_id: v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
                        campaign_id: camp_FNYR4jhqZBM9xTptxDGgeNBV
                        source: voucherify-web-ui
                        reason: cash reward
                        type: CREDITS_ADDITION
                        details:
                          balance:
                            type: gift_voucher
                            total: 130000
                            amount: 2000
                            object: balance
                            balance: 123000
                            related_object:
                              id: v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
                              type: voucher
                        related_transaction_id: null
                        created_at: '2023-03-10T18:38:02.055Z'
                      - id: vtx_0c94edbbaccbef5db6
                        source_id: null
                        voucher_id: v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
                        campaign_id: camp_FNYR4jhqZBM9xTptxDGgeNBV
                        source: null
                        reason: null
                        type: CREDITS_REFUND
                        details:
                          balance:
                            type: gift_voucher
                            total: 128000
                            amount: 44
                            object: balance
                            balance: 121000
                            related_object:
                              id: v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
                              type: voucher
                          order:
                            id: ord_jj5EzDxDOd2xFPsAJJ18IaZK
                            source_id: null
                          redemption:
                            id: r_0c94ed583fcafc31c1
                          rollback:
                            id: rr_0c94edbb8d0bef5d9e
                        related_transaction_id: null
                        created_at: '2023-03-10T18:27:42.389Z'
                      - id: vtx_0c94ed584f4afc31da
                        source_id: null
                        voucher_id: v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
                        campaign_id: camp_FNYR4jhqZBM9xTptxDGgeNBV
                        source: null
                        reason: null
                        type: CREDITS_REDEMPTION
                        details:
                          balance:
                            type: gift_voucher
                            total: 128000
                            amount: -44
                            object: balance
                            balance: 120956
                            related_object:
                              id: v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
                              type: voucher
                          order:
                            id: ord_jj5EzDxDOd2xFPsAJJ18IaZK
                            source_id: null
                          redemption:
                            id: r_0c94ed583fcafc31c1
                        related_transaction_id: null
                        created_at: '2023-03-10T18:26:00.640Z'
                      - id: vtx_0c94e9432c4afc2134
                        source_id: HRwc0oHz_removal
                        voucher_id: v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
                        campaign_id: camp_FNYR4jhqZBM9xTptxDGgeNBV
                        source: voucherify-web-ui
                        reason: removal
                        type: CREDITS_REMOVAL
                        details:
                          balance:
                            type: gift_voucher
                            total: 128000
                            amount: -2000
                            object: balance
                            balance: 121000
                            related_object:
                              id: v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
                              type: voucher
                        related_transaction_id: null
                        created_at: '2023-03-10T18:08:10.413Z'
                      - id: vtx_0c94e8100f8afc1c6c
                        source_id: null
                        voucher_id: v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
                        campaign_id: camp_FNYR4jhqZBM9xTptxDGgeNBV
                        source: null
                        reason: null
                        type: CREDITS_REDEMPTION
                        details:
                          balance:
                            type: gift_voucher
                            total: 130000
                            amount: -7000
                            object: balance
                            balance: 123000
                            related_object:
                              id: v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
                              type: voucher
                          order:
                            id: ord_qZX3pEt5rFf5W23qRMDQcVt9
                            source_id: null
                          redemption:
                            id: r_0c94e80fda4afc1c59
                        related_transaction_id: null
                        created_at: '2023-03-10T18:02:55.935Z'
                      - id: vtx_0c94e6b82a4bef406c
                        source_id: walmart
                        voucher_id: v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
                        campaign_id: camp_FNYR4jhqZBM9xTptxDGgeNBV
                        source: voucherify-web-ui
                        reason: return
                        type: CREDITS_ADDITION
                        details:
                          balance:
                            type: gift_voucher
                            total: 130000
                            amount: 5000
                            object: balance
                            balance: 130000
                            related_object:
                              id: v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp
                              type: voucher
                        related_transaction_id: null
                        created_at: '2023-03-10T17:57:03.758Z'
                    has_more: true
                    more_starting_after: vtx_0c94e6b82a4bef406c
        '404':
          description: >-
            Returns an error if the voucher code does not exist or has been
            deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Not Found:
                  value:
                    code: 404
                    key: not_found
                    message: Resource not found
                    details: Cannot find voucher with id IrKORhS
                    request_id: v-0a96cd820301c0483a
                    resource_id: IrKORhS
                    resource_type: voucher
      security:
        - X-App-Id: []
          X-App-Token: []
        - X-Voucherify-OAuth:
            - api
            - vouchers
components:
  schemas:
    ParameterCode:
      type: string
      example: 2CpRCE2c
    ParameterOrderListTransactions:
      type: string
      enum:
        - id
        - '-id'
    ParameterString:
      type: string
    VouchersTransactionsListResponseBody:
      title: Vouchers Transactions List Response Body
      type: object
      description: Response body schema for **GET** `v1/vouchers/{code}/transactions`.
      properties:
        object:
          type: string
          default: list
          enum:
            - list
          description: The type of the object represented by JSON.
        data_ref:
          type: string
          default: data
          description: >-
            Identifies the name of the attribute that contains the array of
            transaction objects.
          enum:
            - data
        data:
          type: array
          items:
            $ref: '#/components/schemas/VoucherTransaction'
          description: >-
            A dictionary that contains an array of transactions. Each entry in
            the array is a separate transaction object.
        has_more:
          type: boolean
          description: >-
            As query results are always limited (by the limit parameter), the
            `has_more` flag indicates if there are more records for given filter
            parameters. This lets you know if you can run another request (with
            a different paging or a different start date filter) to get more
            records returned in the results.
        more_starting_after:
          type: string
          description: >-
            Returns an ID that can be used to return another page of results.
            Use the transaction ID in the `starting_after_id` query parameter to
            display another page of the results starting after the transaction
            with that ID.
      required:
        - object
        - data_ref
        - data
        - has_more
    Error:
      title: Error Object
      type: object
      description: Error details
      properties:
        code:
          type: integer
          description: Error's HTTP status code.
        key:
          type: string
          description: Short string describing the kind of error which occurred.
        message:
          type: string
          description: A human-readable message providing a short description of the error.
        details:
          type: string
          description: A human-readable message providing more details about the error.
        request_id:
          type: string
          example: v-0a885062c80375740f
          description: >-
            This ID is useful when troubleshooting and/or finding the root cause
            of an error response by our support team.
        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: voucher
        error:
          type: object
          description: Includes additional information about the error.
          properties:
            message:
              type: string
              description: The message configured by the user in a validation rule.
      required:
        - code
        - message
    ParameterLimit:
      type: integer
      maximum: 100
      minimum: 1
    VoucherTransaction:
      title: Voucher Transaction
      allOf:
        - $ref: '#/components/schemas/VoucherTransactionBase'
        - type: object
          properties:
            details:
              type: object
              description: Contains the detailed information about the transaction.
              properties:
                balance:
                  $ref: '#/components/schemas/VoucherBalance'
                order:
                  type: object
                  description: Contains information about the original order.
                  properties:
                    id:
                      type: string
                      description: Unique order ID.
                    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.
                  required:
                    - id
                    - source_id
                event:
                  type: object
                  description: >-
                    Contains information about the event that triggers the point
                    accrual.
                  properties:
                    id:
                      type: string
                      description: Unique event ID.
                    type:
                      type: string
                      description: Type of event.
                  required:
                    - id
                    - type
                earning_rule:
                  type: object
                  description: Contains information about the earning rule.
                  properties:
                    id:
                      type: string
                      description: >-
                        Unique identifier of an earning rule, assigned by
                        Voucherify.
                    source:
                      type: object
                      required:
                        - banner
                      description: Contains the custom earning rule name.
                      properties:
                        banner:
                          type: string
                          description: >-
                            Name of the earning rule. This is displayed as a
                            header for the earning rule in the Dashboard.
                  required:
                    - id
                    - source
                segment:
                  type: object
                  description: Contains information about the segment.
                  properties:
                    id:
                      type: string
                      description: Unique identifier of the segment.
                    name:
                      type: string
                      description: Name of the segment.
                  required:
                    - id
                    - name
                loyalty_tier:
                  type: object
                  description: >-
                    Contains information about the loyalty tier that is mapped
                    for the earning rule and used in the transaction.
                  properties:
                    id:
                      type: string
                      description: >-
                        Unique identifier of the loyalty tier, assigned by
                        Voucherify.
                    name:
                      type: string
                      description: User-defined name of the loyalty tier.
                  required:
                    - id
                    - name
                redemption:
                  type: object
                  description: Contains information about the original redemption.
                  properties:
                    id:
                      type: string
                      description: Unique redemption ID.
                  required:
                    - id
                rollback:
                  type: object
                  description: Contains information about the redemption rollback.
                  properties:
                    id:
                      type: string
                      description: Unique identifier of the redemption rollback.
                  required:
                    - id
                custom_event:
                  type: object
                  description: >-
                    Contains information about the custom event that triggers
                    the point accrual.
                  properties:
                    id:
                      type: string
                      description: Unique identifier of the event.
                    type:
                      type: string
                      description: Type of the custom event.
                  required:
                    - id
                    - type
                event_schema:
                  type: object
                  description: Contains information about the custom event metadata schema.
                  properties:
                    id:
                      type: string
                      description: Unique identifier of the metadata schema.
                    name:
                      type: string
                      description: Type of the custom event.
                  required:
                    - id
                    - name
                holder_loyalty_tier:
                  type: object
                  description: >-
                    Loyalty tier of the loyalty card holder at the moment when
                    the transaction occurred. The loyalty tier is the tier in
                    which the holder was before the loyalty point balance
                    changed.
                  properties:
                    id:
                      type: string
                      description: >-
                        Unique identifier of the loyalty tier, assigned by
                        Voucherify.
                    name:
                      type: string
                      description: User-defined name of the loyalty tier.
                  required:
                    - id
                    - name
                pending_points:
                  $ref: '#/components/schemas/LoyaltyPendingPoints'
                reward:
                  type: object
                  description: Contains information about the pay with points reward.
                  properties:
                    id:
                      type: string
                      description: Unique reward ID.
                    name:
                      type: string
                      description: Reward name.
                  required:
                    - id
                    - name
                source_voucher:
                  description: >-
                    Contains information on how the balance on the donor loyalty
                    card was affected by the transaction.
                  allOf:
                    - $ref: '#/components/schemas/SimpleVoucher'
                destination_voucher:
                  description: >-
                    Contains information on how the balance on the receiving
                    loyalty card was affected by the transaction.
                  allOf:
                    - $ref: '#/components/schemas/SimpleVoucher'
            type:
              oneOf:
                - $ref: '#/components/schemas/GiftVoucherTransactionsType'
                - $ref: '#/components/schemas/LoyaltyCardTransactionsType'
    VoucherTransactionBase:
      title: Voucher Transaction Base
      type: object
      properties:
        id:
          type: string
          description: Unique transaction ID.
        source_id:
          type: string
          nullable: true
          description: >-
            The merchant's transaction ID if it is different from the Voucherify
            transaction ID. It is really useful in case of an integration
            between multiple systems. It can be a transaction ID from a CRM
            system, database or 3rd-party service. In case of a redemption, this
            value is null.
        voucher_id:
          type: string
          description: Unique voucher ID.
        campaign_id:
          type: string
          description: >-
            Unqiue campaign ID of the voucher's parent campaign if it is part of
            campaign that generates bulk codes.
        source:
          type: string
          nullable: true
          description: >-
            The channel through which the transaction took place, whether
            through the API or the Dashboard. In case of a redemption, this
            value is null.
        reason:
          type: string
          nullable: true
          description: >-
            Reason why the transaction occurred. In case of a redemption, this
            value is null.
        related_transaction_id:
          type: string
          nullable: true
          description: The related transaction ID on the receiving card.
        created_at:
          type: string
          format: date-time
          description: >-
            Timestamp representing the date and time when the transaction was
            created. The value is shown in the ISO 8601 format.
      required:
        - id
        - source_id
        - voucher_id
        - campaign_id
        - source
        - reason
        - type
        - details
        - related_transaction_id
        - created_at
    VoucherBalance:
      type: object
      title: Voucher Balance
      description: Contains information on how the balance was affected by the transaction.
      properties:
        type:
          type: string
          description: >-
            The type of voucher whose balance is being adjusted due to the
            transaction.
          enum:
            - loyalty_card
            - gift_voucher
        total:
          type: integer
          description: >-
            The number of all points or credits accumulated on the card as
            affected by add or subtract operations.
        object:
          type: string
          description: The type of the object represented by the JSON.
          enum:
            - balance
        amount:
          type: integer
          description: Credits added or subtracted on a gift card.
        points:
          type: integer
          description: Points added or subtracted in the transaction of a loyalty card.
        balance:
          type: integer
          description: >-
            The available points or credits on the card after the transaction as
            affected by redemption or rollback.
        operation_type:
          type: string
          description: >-
            The type of the operation being performed. The operation type is
            `AUTOMATIC` if it is an automatic redemption.
          enum:
            - MANUAL
            - AUTOMATIC
        related_object:
          type: object
          required:
            - id
            - type
          description: >-
            Defines the resource that is being modified with the values that are
            returned in the balance object.
          properties:
            id:
              type: string
              description: >-
                Identifies the voucher that is being modified. The ID is
                assigned by the Voucherify API.
            type:
              type: string
              description: The object being modified, i.e. voucher.
              enum:
                - voucher
      required:
        - total
        - object
        - balance
        - related_object
    LoyaltyPendingPoints:
      type: object
      title: Loyalty Pending Point Entry
      description: Contains details about the pending point entry.
      properties:
        id:
          type: string
          description: >-
            Unique identifier of the pending point entry, assigned by
            Voucherify.
          example: lopp_0ffd593d5ad207ba6b
        voucher_id:
          type: string
          description: Unique identifier of the loyalty card, assigned by Voucherify.
          example: v_abCdEfghI1JKLMNPqRS2Tu3vWXyza4bc
        campaign_id:
          type: string
          description: Unique campaign identifier, assigned by Voucherify.
          example: camp_weer1c3p5ZgktqfW56RfoNaG
        customer_id:
          type: string
          description: Unique customer identifier, assigned by Voucherify.
          example: cust_IdgAFZxYwwHctOk9ppZMu319
        order_id:
          type: string
          description: Unique order identifier, assigned by Voucherify.
          example: ord_0ffc0fa65f15d2df17
        points:
          type: integer
          description: Number of points in the pending state.
        activates_at:
          type: string
          description: >-
            Date when the pending points are activated and added to the
            customer's loyalty card.
          format: date
        details:
          $ref: '#/components/schemas/LoyaltyPendingPointsDetails'
        created_at:
          type: string
          description: >-
            Timestamp representing the date and time when the pending point
            entry was created. The value is shown in the ISO 8601 format.
          format: date-time
        updated_at:
          type: string
          description: >-
            Timestamp representing the date and time when the pending point
            entry was modified. The value is shown in the ISO 8601 format.
          format: date-time
      required:
        - id
        - voucher_id
        - campaign_id
        - customer_id
        - order_id
        - points
        - activates_at
        - details
        - created_at
    SimpleVoucher:
      type: object
      title: Simple Voucher
      description: Simplified voucher data.
      properties:
        id:
          type: string
          description: >-
            A unique identifier that represents the voucher assigned by
            Voucherify.
        code:
          type: string
          description: Voucher code.
        gift:
          description: Gift object response.
          allOf:
            - $ref: '#/components/schemas/Gift'
        discount:
          $ref: '#/components/schemas/Discount'
        loyalty_card:
          description: Defines the loyalty card details.
          type: object
          allOf:
            - $ref: '#/components/schemas/SimpleLoyaltyCard'
        type:
          type: string
          description: Type of the voucher.
          enum:
            - DISCOUNT_VOUCHER
            - LOYALTY_CARD
            - GIFT_VOUCHER
        campaign:
          type: string
          description: Campaign name.
        campaign_id:
          type: string
          description: Campaign unique ID.
        is_referral_code:
          type: boolean
          description: >-
            Flag indicating whether this voucher is a referral code; `true` for
            campaign type `REFERRAL_PROGRAM`.
        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 referrer assigned by Voucherify.
          example: cust_nM4jqPiaXUvQdVSA6vTRUnix
        category_id:
          type: string
          nullable: true
          description: Unique identifier of the category that this voucher belongs to.
          example: cat_0b6152ce12414820dc
        categories:
          type: array
          description: Contains details about the category.
          items:
            $ref: '#/components/schemas/Category'
        active:
          type: boolean
          description: >-
            Shows whether the voucher is on or off. `true` indicates an *active*
            voucher and `false` indicates an *inactive* voucher.
        created_at:
          type: string
          example: '2021-12-22T10:13:06.487Z'
          description: >-
            Timestamp representing the date and time when the order was created
            in the ISO 8601 format.
          format: date-time
        updated_at:
          type: string
          example: '2024-01-01T11:11:11.111Z'
          description: >-
            Timestamp representing the date and time when the order was created.
            The value is shown in the ISO 8601 format.
          format: date-time
        redemption:
          type: object
          description: Defines the redemption limits on vouchers.
          properties:
            quantity:
              type: integer
              nullable: true
              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
              description: Total loyalty points redeemed.
          required:
            - quantity
            - redeemed_quantity
        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.
        metadata:
          type: object
          description: >-
            A set of custom key/value pairs that you can attach to a voucher.
            The metadata object stores all custom attributes assigned to the
            voucher.
        object:
          type: string
          description: The type of the object represented by JSON.
          default: voucher
          enum:
            - voucher
      required:
        - type
        - code
        - created_at
        - object
    GiftVoucherTransactionsType:
      title: Gift Card Transactions Type
      type: string
      description: Transaction types concerning gift card credits.
      enum:
        - CREDITS_REDEMPTION
        - CREDITS_REFUND
        - CREDITS_ADDITION
        - CREDITS_REMOVAL
    LoyaltyCardTransactionsType:
      title: Loyalty Card Transactions Type
      type: string
      description: Transaction types concerning loyalty points.
      enum:
        - PENDING_POINTS_ACTIVATION
        - POINTS_ACCRUAL
        - POINTS_REDEMPTION
        - POINTS_REFUND
        - POINTS_ADDITION
        - POINTS_REMOVAL
        - POINTS_EXPIRATION
        - POINTS_TRANSFER_IN
        - POINTS_TRANSFER_OUT
    LoyaltyPendingPointsDetails:
      title: Pending Point Details
      type: object
      description: Details about how the pending points were earned.
      properties:
        loyalty_tier:
          type: object
          description: >-
            The loyalty tier that is mapped for the earning rule and used in the
            pending point transaction.
          properties:
            id:
              type: string
              description: Unique identifier of the loyalty tier, assigned by Voucherify.
            name:
              type: string
              description: User-defined name of the loyalty tier.
          required:
            - id
            - name
        holder_loyalty_tier:
          type: object
          description: >-
            Loyalty tier of the loyalty card holder at the moment when the
            transaction occurred. The loyalty tier is the tier in which the
            holder was at the moment pending points were created.
          properties:
            id:
              type: string
              description: Unique identifier of the loyalty tier, assigned by Voucherify.
            name:
              type: string
              description: User-defined name of the loyalty tier.
          required:
            - id
            - name
        event:
          type: object
          description: Details about the event that created pending points.
          properties:
            id:
              type: string
              description: Unique event identifier, assigned by Voucherify.
            type:
              type: string
              description: Type of the event that triggered the creation of pending points.
              enum:
                - customer.order.paid
            group_id:
              type: string
              description: >-
                Unique identifier of the request that triggered the event,
                assigned by Voucherify.
            entity_id:
              type: string
              description: >-
                Unique identifier of the entity that triggered the event,
                assigned by Voucherify. For pending points, it is the
                `customer_id` of the customer who paid for the order.
            created_at:
              type: string
              description: >-
                Timestamp representing the date and time when the event
                occurred. The value is shown in the ISO 8601 format.
              format: date-time
            category:
              type: string
              description: Type of the event.
              enum:
                - ACTION
                - EFFECT
            event_source:
              $ref: '#/components/schemas/EventSource'
        earning_rule:
          type: object
          description: Contains information about the earning rule.
          properties:
            id:
              type: string
              description: Unique identifier of an earning rule, assigned by Voucherify.
            source:
              type: object
              required:
                - banner
              description: Contains the custom earning rule name.
              properties:
                banner:
                  type: string
                  description: >-
                    Name of the earning rule. This is displayed as a header for
                    the earning rule in the Dashboard.
          required:
            - id
            - source
        order:
          type: object
          description: Details about the order that caused adding pending points.
          properties:
            id:
              type: string
              description: Unique order identifier, assigned by Voucherify.
            source_id:
              nullable: true
              type: string
              description: User-defined order identifier.
          required:
            - id
            - source_id
      required:
        - event
        - earning_rule
        - order
    Gift:
      title: Gift
      type: object
      description: Contains current gift card balance information.
      properties:
        amount:
          type: number
          description: >-
            Total gift card income over the lifetime of the card. The value is
            multiplied by 100 to represent 2 decimal places. For example `10000
            cents` for `$100.00`.
        subtracted_amount:
          type: integer
          description: Total amount of subtracted credits over the gift card lifetime.
        balance:
          type: number
          description: >-
            Available funds. The value is multiplied by 100 to represent 2
            decimal places. For example `10000 cents` for `$100.00`. `balance` =
            `amount` - `subtracted_amount` - `redemption.redeemed_amount`.
        effect:
          type: string
          enum:
            - APPLY_TO_ORDER
            - APPLY_TO_ITEMS
          description: Defines how the credits are applied to the customer's order.
      required:
        - amount
        - balance
    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'
    SimpleLoyaltyCard:
      title: Simple Loyalty Card
      type: object
      description: Simplified loyalty card data.
      required:
        - points
      properties:
        points:
          type: integer
          description: Total number of points added to the loyalty card over its lifespan.
        balance:
          type: integer
          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
          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.
    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
    EventSource:
      type: object
      title: Event Source
      description: Contains the source of the object that initiated the event.
      required:
        - channel
      properties:
        channel:
          type: string
          description: Determines the channel that initiated the event.
          enum:
            - USER_PORTAL
            - API
            - CLIENT_API
            - INTERNAL
          example: API
        user:
          type: object
          description: Determines the Voucherify user who triggered the event.
          properties:
            id:
              type: string
              description: Unique identifier of the user.
              example: user_xyzfghSTprSTUVWXYlk6tuvXYst7FGH7
          required:
            - id
        api_key:
          type: object
          description: Determines the API key used to initiate the event.
          required:
            - name
            - app_id
          properties:
            name:
              type: string
              description: Channel name in the application keys.
            app_id:
              type: string
              description: Contains the application ID from the Voucherify API key pair.
              example: 1XXXX5XX-0XXX-XXXb-X7XX-XX2XXaXXX6XX
    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
  parameters:
    limit:
      name: limit
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/ParameterLimit'
      description: >-
        Limits the number of objects to be returned. The limit can range between
        1 and 100 items. If no limit is set, it returns 10 items.
  securitySchemes:
    X-App-Id:
      type: apiKey
      name: X-App-Id
      in: header
    X-App-Token:
      type: apiKey
      name: X-App-Token
      in: header
    X-Voucherify-OAuth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://api.voucherify.io/v1/oauth/token
          scopes:
            api: Gives access to whole server-side API.
            vouchers: >-
              Gives access to all endpoints and methods starting with
              `v1/vouchers`.
            client_api: Gives access to whole client-side API.
            client_vouchers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/vouchers`.
            promotions: >-
              Gives access to all endpoints and methods starting with
              `/v1/promotions`.
            client_promotions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/promotions`
            campaigns: >-
              Gives access to all endpoints and methods starting with
              `v1/campaigns`.
            client_publish: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/publish`.
            exports: >-
              Gives access to all endpoints and methods starting with
              `/v1/exports`.
            publications: >-
              Gives access to all endpoints and methods starting with
              `/v1/publications`.
            client_validate: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validate`.
            validations: >-
              Gives access to all endpoints and methods starting with
              `/v1/validations`.
            client_validations: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validations`.
            qualifications: >-
              Gives access to all endpoints and methods starting with
              `/v1/qualifications`.
            client_qualifications: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/qualifications`.
            client_redeem: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redeem
            redemptions: >-
              Gives access to all endpoints and methods starting with
              `/v1/redemptions`.
            client_redemptions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redemptions`
            customers: >-
              Gives access to all endpoints and methods starting with
              `/v1/customers`.
            client_customers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/customers`.
            orders: >-
              Gives access to all endpoints and methods starting with
              `/v1/orders`.
            products: >-
              Gives access to all endpoints and methods starting with
              `/v1/products`.
            skus: >-
              Gives access to all endpoints and methods starting with
              `/v1/SKUs`.
            validation-rules: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules`.
            validation-rules-assignments: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules-assignments
            segments: >-
              Gives access to all endpoints and methods starting with
              `/v1/segments`.
            events: >-
              Gives access to all endpoints and methods starting with
              `/v1/events`.
            client_events: >-
              Gives access to all endpoints and methods starting with
              `client/v1/events`.
            rewards: >-
              Gives access to all endpoints and methods starting with
              `/v1/rewards`.
            assets: >-
              Gives access to all endpoints and methods starting with
              `/v1/assets`.
            task-results: >-
              Gives access to all endpoints and methods starting with
              `/v1/task-results`.
            loyalties: >-
              Gives access to all endpoints and methods starting with
              `/v1/loyalties`.
            client_consents: >-
              Gives access to all endpoints and methods starting with
              `client/v1/consents`.
            consents: >-
              Gives access to all endpoints and methods starting with
              `/v1/consents`.
            async-actions: >-
              Gives access to all endpoints and methods starting with
              `/v1/async-actions`.
            product-collections: >-
              Gives access to all endpoints and methods starting with
              `/v1/product-collections`.
            categories: >-
              Gives access to all endpoints and methods starting with
              `/v1/categories`.
            metadata-schemas: >-
              Gives access to all endpoints and methods starting with
              `/v1/metadata-schemas`.
            locations: >-
              Gives access to all endpoints and methods starting with
              `/v1/locations`.
            referrals: >-
              Gives access to all endpoints and methods starting with
              `/v1/referrals`.
            trash-bin: >-
              Gives access to all endpoints and methods starting with
              `/v1/trash-bin`.
            templates: >-
              Gives access to all endpoints and methods starting with
              `/v1/templates`.

````