> ## 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 Loyalty Campaign Transactions

> Retrieves all transactions for the campaign with the given campaign ID or campaign name.



## OpenAPI

````yaml /openapi/loyalties.json get /v1/loyalties/{campaignId}/transactions
openapi: 3.0.1
info:
  title: Voucherify API - Loyalties
  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/loyalties/{campaignId}/transactions:
    parameters:
      - in: path
        name: campaignId
        description: >-
          You can either pass the campaign ID, which was assigned by Voucherify,
          or the name of the campaign as the path parameter value.
        schema:
          $ref: '#/components/schemas/ParameterCampaignId'
        required: true
    get:
      tags:
        - Loyalties
      summary: List Loyalty Campaign Transactions
      description: >-
        Retrieves all transactions for the campaign with the given campaign ID
        or campaign name.
      operationId: list-loyalty-campaign-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.
        - name: filters
          in: query
          schema:
            $ref: '#/components/schemas/ParametersFiltersListCampaignTransactions'
          description: >-
            Filters for listing responses. The `id` filter denotes the unique
            transaction identifier.
          style: deepObject
          explode: true
      responses:
        '200':
          description: >-
            Returns a dictionary with a `data` property that contains an array
            of transactions. The maximum number of transactions returned is
            determined by the `limit` query parameter. Each entry in the array
            is a separate transaction object. If more results are available, the
            `has_more` flag has value `true` and the value of the
            `more_starting_after` property can be used to retrieve another page
            of results.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoyaltiesTransactionsListResponseBody'
              examples:
                Loyalty campaign transactions:
                  value:
                    object: list
                    data_ref: data
                    data:
                      - id: vtx_0f9159e2a055e41e16
                        source_id: null
                        voucher_id: v_GNSRFoVlW2ny8uTOHhXRGvkwocR9jQ44
                        campaign_id: camp_5Hn0NM3Uf77tC3IV3kX5un36
                        source: null
                        reason: null
                        type: POINTS_REDEMPTION
                        details:
                          balance:
                            type: loyalty_card
                            total: 283
                            object: balance
                            points: -50
                            balance: 23
                            operation_type: AUTOMATIC
                            related_object:
                              id: v_GNSRFoVlW2ny8uTOHhXRGvkwocR9jQ44
                              type: voucher
                          redemption:
                            id: r_0f9159e29815e41e08
                          reward:
                            id: rew_GCq9usMjLffVacs0mlyMmDZo
                            name: Material
                        related_transaction_id: null
                        created_at: '2024-10-24T12:19:45.597Z'
                      - id: vtx_0f9159e1a48b219c95
                        source_id: null
                        voucher_id: v_GNSRFoVlW2ny8uTOHhXRGvkwocR9jQ44
                        campaign_id: camp_5Hn0NM3Uf77tC3IV3kX5un36
                        source: voucherify-web-ui
                        reason: Apology addition
                        type: POINTS_ADDITION
                        details:
                          balance:
                            type: loyalty_card
                            total: 283
                            object: balance
                            points: 50
                            balance: 73
                            operation_type: MANUAL
                            related_object:
                              id: v_GNSRFoVlW2ny8uTOHhXRGvkwocR9jQ44
                              type: voucher
                        related_transaction_id: null
                        created_at: '2024-10-24T12:19:44.902Z'
                    has_more: true
                    more_starting_after: vtx_0f9159e1a48b219c95
                Other campaign types - empty data:
                  value:
                    object: list
                    data_ref: data
                    data: []
                    total: 0
      security:
        - X-App-Id: []
          X-App-Token: []
        - X-Voucherify-OAuth:
            - api
            - loyalties
components:
  schemas:
    ParameterCampaignId:
      type: string
      example: camp_rRsfatlwN7unSeUIJDCYedal
    ParameterOrderListTransactions:
      type: string
      enum:
        - id
        - '-id'
    ParameterString:
      type: string
    ParametersFiltersListCampaignTransactions:
      type: object
      properties:
        junction:
          $ref: '#/components/schemas/Junction'
        id:
          $ref: '#/components/schemas/FilterConditionsString'
        voucher_id:
          $ref: '#/components/schemas/FilterConditionsString'
    LoyaltiesTransactionsListResponseBody:
      type: object
      title: Loyalties Transactions List Response Body
      description: >-
        Response body schema for **GET**
        `v1/loyalties/{campaignId}/transactions`.
      properties:
        object:
          type: string
          default: list
          description: The type of the object represented by JSON.
          enum:
            - list
        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/LoyaltyCardTransaction'
          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
    ParameterLimit:
      type: integer
      minimum: 1
      maximum: 100
    Junction:
      title: Junction
      description: >-
        Logical Operator Between Filters. Filter by conditions set on the
        `junction` parameter indicating how the `conditions` should be accounted
        for in the query. An `AND` is an all-inclusive logical operator, meaning
        the `AND` operator displays a record if **ALL** the conditions separated
        by AND are TRUE, while  an `OR` operator displays a record if **ANY** of
        the conditions separated by OR is TRUE.
      enum:
        - and
        - or
      type: string
    FilterConditionsString:
      title: Filter by conditions
      type: object
      description: >-
        Data filters used to narrow down the data records to be returned in the
        result.
      properties:
        $in:
          type: array
          description: >-
            Array of resource values that should be included in the results
            (multiple values).
          items:
            type: string
        $not_in:
          type: array
          description: >-
            Array of resource values that should be included in the results
            (multiple values).
          items:
            type: string
        $is:
          type: string
          description: Value is exactly this value (single value).
        $is_not:
          type: string
          description: Results omit this value (single value).
        $has_value:
          type: string
          description: Value is NOT null. The value for this parameter is an empty string.
        $is_unknown:
          type: string
          description: Value is null. The value for this parameter is an empty string.
        $starts_with:
          type: string
          description: Value starts with the specified string.
        $ends_with:
          type: string
          description: Value ends with the specified string.
        $contains:
          type: string
          description: Value includes the specified string.
        $not_contain:
          type: string
          description: Value does NOT include the specified string.
    LoyaltyCardTransaction:
      title: Loyalty Card 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
                    name:
                      type: string
                  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 redemption rollback ID.
                  required:
                    - id
                custom_event:
                  type: object
                  description: >-
                    Contains information about the custom event that triggers
                    the point accrual.
                  properties:
                    id:
                      type: string
                      description: Unique event ID.
                    type:
                      type: string
                      description: Type of custom event.
                  required:
                    - id
                    - type
                event_schema:
                  type: object
                  description: Contains information about the custom event metadata schema.
                  properties:
                    id:
                      type: string
                      description: Unique metadata schema ID.
                    name:
                      type: string
                      description: Type of 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:
              $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
    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
          description: Defines how the credits are applied to the customer's order.
          enum:
            - APPLY_TO_ORDER
            - APPLY_TO_ITEMS
      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`.

````