> ## 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 Member Activity

> 
> 📘 Alternative endpoint
> This endpoint is an alternative to this [endpoint](/api-reference/loyalties/list-member-activity-with-campaign-id). The URL was re-designed to allow you to get member activities without having to provide the `campaignId` as a path parameter.

Retrieves the list of activities for the given member ID related to a voucher and customer who is the holder of the voucher.



## OpenAPI

````yaml /openapi/loyalties.json get /v1/loyalties/members/{memberId}/activity
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/members/{memberId}/activity:
    parameters:
      - schema:
          $ref: '#/components/schemas/ParameterMemberId'
        name: memberId
        in: path
        required: true
        description: Unique loyalty card assigned to a particular customer.
    get:
      tags:
        - Loyalties
      summary: List Member Activity
      description: >-

        > 📘 Alternative endpoint

        > This endpoint is an alternative to this
        [endpoint](/api-reference/loyalties/list-member-activity-with-campaign-id).
        The URL was re-designed to allow you to get member activities without
        having to provide the `campaignId` as a path parameter.


        Retrieves the list of activities for the given member ID related to a
        voucher and customer who is the holder of the voucher.
      operationId: list-member-activity
      parameters:
        - $ref: '#/components/parameters/limit'
        - schema:
            $ref: '#/components/schemas/ParameterOrderCreatedAt'
          in: query
          name: order
          description: >-
            Apply this filter to order the events according the date and time
            when it was created. 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 events starting after an
            event with the given ID.
      responses:
        '200':
          description: Returns a list of event objects related to the loyalty card.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoyaltiesMemberActivityListResponseBody'
        '404':
          description: Returns an error if the member ID could not be found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Member Not Found:
                  value:
                    code: 404
                    key: not_found
                    message: Resource not found
                    details: Cannot find voucher with id NoSuchMemberId
                    request_id: v-0fa4db65ae10686179
                    resource_id: NoSuchMemberId
                    resource_type: voucher
      security:
        - X-App-Id: []
          X-App-Token: []
        - X-Voucherify-OAuth:
            - api
            - loyalties
components:
  schemas:
    ParameterMemberId:
      type: string
      example: MmFAzfDe
    ParameterOrderCreatedAt:
      type: string
      enum:
        - created_at
        - '-created_at'
    ParameterString:
      type: string
    LoyaltiesMemberActivityListResponseBody:
      type: object
      title: Member Activity List Response Body
      description: Response body schema for retrieving member activity.
      properties:
        object:
          type: string
          default: list
          description: >-
            The type of the object represented by JSON. This object stores
            information about member activities in a dictionary.
          enum:
            - list
        data_ref:
          type: string
          default: data
          description: >-
            Identifies the name of the attribute that contains the array of
            member activity objects.
        data:
          type: array
          description: Array of member activity objects.
          items:
            $ref: '#/components/schemas/MemberActivity'
        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
            `starting_after_id` query or a different limit 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 event ID in the `starting_after_id` query parameter to
            display another page of the results starting after the event 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
      minimum: 1
      maximum: 100
    MemberActivity:
      title: Member Activity
      type: object
      description: >-
        This is an object representing member activity.  


        This is a general object which presents moments from members' activity.
        There are all types of different events that members perform during
        their journey once they participate in a loyalty program. Events
        describe moments when the members redeem loyalty cards and earn points
        or rewards. The list of all types of activities is listed below.


        The details describing the activity are collected in an array property
        named `data`. In this object, software integrators can find all further
        information explaining the event context.
      properties:
        id:
          type: string
          description: Unique event ID, assigned by Voucherify.
          example: evcus_0c150c51730c6b60b1
        type:
          type: string
          description: Event type.
          enum:
            - customer.loyalty.tier.upgraded
            - customer.loyalty.tier.downgraded
            - customer.loyalty.tier.prolonged
            - customer.loyalty.tier.expiration.changed
            - customer.loyalty.tier.joined
            - customer.loyalty.tier.left
            - customer.publication.succeeded
            - customer.publication.failed
            - customer.redemption.failed
            - customer.redemption.succceeded
            - customer.redemption.rollback.failed
            - customer.redemption.rollback.succceeded
            - customer.rewarded
            - customer.rewarded.loyalty_points
            - customer.reward_redemptions.created
            - customer.reward_redemptions.pending
            - customer.reward_redemptions.completed
            - customer.reward_redemptions.rolledback
            - customer.voucher.deleted
            - customer.voucher.loyalty_card.pending_points.activated
            - customer.voucher.loyalty_card.pending_points.added
            - customer.voucher.loyalty_card.pending_points.canceled
            - customer.voucher.loyalty_card.pending_points.updated
            - customer.voucher.loyalty_card.points_added
            - customer.voucher.loyalty_card.points_transferred
            - customer.voucher.loyalty_card.points_expired
        data:
          type: object
          description: >-
            Contains details about the event. The objects that are returned in
            the data attribute differ based on the context of the event type.
          properties:
            data:
              $ref: '#/components/schemas/MemberActivityData'
            event_source:
              $ref: '#/components/schemas/EventSource'
        created_at:
          type: string
          description: >-
            Timestamp representing the date and time when the member activity
            occurred in ISO 8601 format.
          example: '2022-08-30T09:14:07.660Z'
          format: date-time
        group_id:
          type: string
          description: Unique identifier of the request that caused the event.
          example: w-0e30613abc1f044513
    MemberActivityData:
      title: Member Activity Data
      description: Event data object schema.
      oneOf:
        - $ref: '#/components/schemas/EventCustomerLoyaltyTierUpgraded'
        - $ref: '#/components/schemas/EventCustomerLoyaltyTierDowngraded'
        - $ref: '#/components/schemas/EventCustomerLoyaltyTierProlonged'
        - $ref: '#/components/schemas/EventCustomerLoyaltyTierExpirationChanged'
        - $ref: '#/components/schemas/EventCustomerLoyaltyTierJoined'
        - $ref: '#/components/schemas/EventCustomerLoyaltyTierLeft'
        - $ref: '#/components/schemas/EventCustomerPublicationSucceeded'
        - $ref: '#/components/schemas/EventCustomerPublicationFailed'
        - $ref: '#/components/schemas/EventCustomerRedemptionFailed'
        - $ref: '#/components/schemas/EventCustomerRedemptionSucceeded'
        - $ref: '#/components/schemas/EventCustomerRedemptionRollbackFailed'
        - $ref: '#/components/schemas/EventCustomerRedemptionRollbackSucceeded'
        - $ref: '#/components/schemas/EventCustomerRewarded'
        - $ref: '#/components/schemas/EventCustomerRewardedLoyaltyPoints'
        - $ref: '#/components/schemas/EventCustomerRewardRedemptionsCreated'
        - $ref: '#/components/schemas/EventCustomerRewardRedemptionsPending'
        - $ref: '#/components/schemas/EventCustomerRewardRedemptionsCompleted'
        - $ref: '#/components/schemas/EventCustomerRewardRedemptionsRolledBack'
        - $ref: '#/components/schemas/EventCustomerVoucherDeleted'
        - $ref: '#/components/schemas/EventCustomerLoyaltyCardPendingPointsActivated'
        - $ref: '#/components/schemas/EventCustomerLoyaltyCardPendingPointsAdded'
        - $ref: '#/components/schemas/EventCustomerLoyaltyCardPendingPointsCanceled'
        - $ref: '#/components/schemas/EventCustomerLoyaltyCardPendingPointsUpdated'
        - $ref: '#/components/schemas/EventCustomerLoyaltyCardPointsAdded'
        - $ref: '#/components/schemas/EventCustomerLoyaltyCardPointsTransferred'
        - $ref: '#/components/schemas/EventCustomerVouchersLoyaltyPointsExpired'
    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
    EventCustomerLoyaltyTierUpgraded:
      title: Event Customer Loyalty Tier Upgraded
      description: Event data object schema for `customer.loyalty.tier.upgraded`.
      allOf:
        - $ref: '#/components/schemas/EventCustomerLoyaltyTierBase'
        - title: Loyalty Tier Upgraded
          type: object
          properties:
            loyalty_tier_from:
              $ref: '#/components/schemas/LoyaltyTier'
            loyalty_tier_to:
              $ref: '#/components/schemas/LoyaltyTier'
            created_at:
              type: string
              example: '2022-02-25T13:32:08.734Z'
              format: date-time
          required:
            - created_at
            - loyalty_tier_to
    EventCustomerLoyaltyTierDowngraded:
      title: Event Customer Loyalty Tier Downgraded
      description: Event data object schema for `customer.loyalty.tier.downgraded`.
      allOf:
        - $ref: '#/components/schemas/EventCustomerLoyaltyTierBase'
        - title: Loyalty Tier Downgraded
          type: object
          properties:
            loyalty_tier_from:
              $ref: '#/components/schemas/LoyaltyTier'
            loyalty_tier_to:
              $ref: '#/components/schemas/LoyaltyTier'
            created_at:
              type: string
              example: '2022-02-25T13:32:08.734Z'
              format: date-time
          required:
            - created_at
            - loyalty_tier_from
    EventCustomerLoyaltyTierProlonged:
      title: Event Customer Loyalty Tier Prolonged
      description: Event data object schema for `customer.loyalty.tier.prolonged`.
      allOf:
        - $ref: '#/components/schemas/EventCustomerLoyaltyTierBase'
        - title: Loyalty Tier Prolonged
          type: object
          properties:
            loyalty_tier:
              $ref: '#/components/schemas/LoyaltyTier'
            created_at:
              type: string
              example: '2022-02-25T13:32:08.734Z'
              format: date-time
          required:
            - created_at
            - loyalty_tier
    EventCustomerLoyaltyTierExpirationChanged:
      title: Event Customer Loyalty Tier Expiration Changed
      description: Event data object schema for `customer.loyalty.tier.expiration.changed`.
      allOf:
        - $ref: '#/components/schemas/EventCustomerLoyaltyTierBase'
        - title: Loyalty Tier Expiration Changed
          type: object
          properties:
            loyalty_tier:
              $ref: '#/components/schemas/LoyaltyTier'
            created_at:
              type: string
              example: '2022-02-25T13:32:08.734Z'
              format: date-time
            expiration_date:
              type: string
              example: '2022-02-25T13:32:08.734Z'
              format: date-time
          required:
            - created_at
            - loyalty_tier
            - expiration_date
    EventCustomerLoyaltyTierJoined:
      title: Event Customer Loyalty Tier Joined
      description: Event data object schema for `customer.loyalty.tier.joined`.
      allOf:
        - $ref: '#/components/schemas/EventCustomerLoyaltyTierBase'
        - title: Loyalty Tier Joined
          type: object
          properties:
            loyalty_tier:
              $ref: '#/components/schemas/LoyaltyTier'
            created_at:
              type: string
              example: '2022-02-25T13:32:08.734Z'
              format: date-time
          required:
            - created_at
            - loyalty_tier
    EventCustomerLoyaltyTierLeft:
      title: Event Customer Loyalty Tier Left
      description: Event data object schema for `customer.loyalty.tier.left`.
      allOf:
        - $ref: '#/components/schemas/EventCustomerLoyaltyTierBase'
        - title: Loyalty Tier Left
          type: object
          properties:
            loyalty_tier:
              $ref: '#/components/schemas/LoyaltyTier'
            created_at:
              type: string
              example: '2022-02-25T13:32:08.734Z'
              format: date-time
          required:
            - created_at
            - loyalty_tier
    EventCustomerPublicationSucceeded:
      title: Event Customer Publication Succeeded
      description: Event data object schema for `customer.publication.succeeded`.
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/SimpleCustomer'
        campaign:
          $ref: '#/components/schemas/SimpleCampaign'
        publication:
          $ref: '#/components/schemas/ListPublicationsItemValidSingleVoucher'
    EventCustomerPublicationFailed:
      title: Event Customer Publication Failed
      description: Event data object schema for `customer.publication.failed`.
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/SimpleCustomer'
        campaign:
          $ref: '#/components/schemas/SimpleCampaign'
        publication:
          $ref: '#/components/schemas/ListPublicationsItemValidSingleVoucher'
    EventCustomerRedemptionFailed:
      title: Event Customer Redemption Failed
      description: Event data object schema for `customer.redemption.failed`.
      allOf:
        - $ref: '#/components/schemas/EventCustomerRedemption'
    EventCustomerRedemptionSucceeded:
      title: Event Customer Redemption Succeeded
      description: Event data object schema for `customer.redemption.succeeded`.
      allOf:
        - $ref: '#/components/schemas/EventCustomerRedemption'
    EventCustomerRedemptionRollbackFailed:
      title: Event Customer Redemption Rollback Failed
      description: Event data object schema for `customer.redemption.rollback.failed`.
      allOf:
        - $ref: '#/components/schemas/EventCustomerRedemption'
        - type: object
          properties:
            redemption_rollback:
              $ref: '#/components/schemas/SimpleRedemption'
    EventCustomerRedemptionRollbackSucceeded:
      title: Event Customer Redemption Rollback Succeeded
      description: Event data object schema for `customer.redemption.rollback.succeeded`.
      allOf:
        - $ref: '#/components/schemas/EventCustomerRedemption'
        - type: object
          properties:
            redemption_rollback:
              $ref: '#/components/schemas/SimpleRedemption'
    EventCustomerRewarded:
      title: Event Customer Rewarded
      description: Event data object schema for `customer.rewarded`.
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/SimpleCustomer'
        holder:
          $ref: '#/components/schemas/SimpleCustomer'
        voucher:
          $ref: '#/components/schemas/SimpleVoucher'
        campaign:
          $ref: '#/components/schemas/SimpleCampaign'
        redemption:
          $ref: '#/components/schemas/RedemptionInternal'
        reward:
          $ref: '#/components/schemas/SimpleRedemptionRewardResult'
        referral_tier:
          $ref: '#/components/schemas/SimpleReferralTier'
        balance:
          nullable: true
          type: object
          description: >-
            Balance changed by the event. The `amount` property details a change
            in a gift card. The `points` property details a change in a loyalty
            card.
          properties:
            amount:
              type: integer
            points:
              type: integer
        custom_event:
          $ref: '#/components/schemas/CustomEvent'
        customer_event:
          nullable: true
          type: object
          properties:
            segment:
              $ref: '#/components/schemas/SimpleSegment'
            event_type:
              type: string
              description: Type of activity that triggered the event.
    EventCustomerRewardedLoyaltyPoints:
      title: Event Customer Rewarded Loyalty Points
      description: Event data object schema for `customer.rewarded.loyalty_points`.
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/SimpleCustomer'
        holder:
          $ref: '#/components/schemas/SimpleCustomer'
        voucher:
          $ref: '#/components/schemas/SimpleVoucher'
        campaign:
          $ref: '#/components/schemas/SimpleCampaign'
        loyalty_tier:
          $ref: '#/components/schemas/LoyaltyTier'
        earning_rule:
          $ref: '#/components/schemas/EarningRule'
        balance:
          $ref: '#/components/schemas/VoucherBalance'
        order:
          allOf:
            - $ref: '#/components/schemas/OrderCalculated'
            - type: object
              properties:
                items:
                  type: array
                  description: >-
                    Array of items applied to the order. It can include up to
                    500 items.
                  items:
                    $ref: '#/components/schemas/OrderCalculatedItem'
        event:
          $ref: '#/components/schemas/SimpleEvent'
    EventCustomerRewardRedemptionsCreated:
      title: Event Customer Reward Redemptions Created
      description: Event data object schema for `customer.reward_redemptions.created`.
      allOf:
        - $ref: '#/components/schemas/EventCustomerRewardRedemptions'
    EventCustomerRewardRedemptionsPending:
      title: Event Customer Reward Redemptions Pending
      description: Event data object schema for `customer.reward_redemptions.pending`.
      allOf:
        - $ref: '#/components/schemas/EventCustomerRewardRedemptions'
    EventCustomerRewardRedemptionsCompleted:
      title: Event Customer Reward Redemptions Completed
      description: Event data object schema for `customer.reward_redemptions.completed`.
      allOf:
        - $ref: '#/components/schemas/EventCustomerRewardRedemptions'
    EventCustomerRewardRedemptionsRolledBack:
      title: Event Customer Reward Redemptions Rolled Back
      description: Event data object schema for `customer.reward_redemptions.rolledback`.
      allOf:
        - $ref: '#/components/schemas/EventCustomerRewardRedemptions'
    EventCustomerVoucherDeleted:
      title: Event Customer Voucher Deleted
      description: Event data object schema for `customer.voucher.deleted`.
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/SimpleCustomer'
        campaign:
          $ref: '#/components/schemas/SimpleCampaign'
        voucher:
          $ref: '#/components/schemas/SimpleVoucher'
    EventCustomerLoyaltyCardPendingPointsActivated:
      title: Event Customer Loyalty Card Pending Points Activated
      description: >-
        Event data object schema for
        `customer.voucher.loyalty_card.pending_points.activated`.
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/SimpleCustomer'
        campaign:
          $ref: '#/components/schemas/SimpleCampaign'
        voucher:
          $ref: '#/components/schemas/SimpleVoucher'
        balance:
          $ref: '#/components/schemas/VoucherBalance'
        order:
          $ref: '#/components/schemas/SimpleOrder'
        transaction:
          $ref: '#/components/schemas/VoucherTransaction'
        pending_points:
          $ref: '#/components/schemas/LoyaltyPendingPoints'
      required:
        - customer
        - campaign
        - voucher
        - balance
        - order
        - transaction
        - pending_points
    EventCustomerLoyaltyCardPendingPointsAdded:
      title: Event Customer Loyalty Card Pending Points Added
      description: >-
        Event data object schema for
        `customer.voucher.loyalty_card.pending_points.added`.
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/SimpleCustomer'
        campaign:
          $ref: '#/components/schemas/SimpleCampaign'
        voucher:
          $ref: '#/components/schemas/SimpleVoucher'
        voucher_pending_points_balance:
          $ref: '#/components/schemas/VoucherBalance'
        order:
          $ref: '#/components/schemas/SimpleOrder'
        pending_points:
          $ref: '#/components/schemas/LoyaltyPendingPoints'
      required:
        - customer
        - campaign
        - voucher
        - voucher_pending_points_balance
        - order
        - pending_points
    EventCustomerLoyaltyCardPendingPointsCanceled:
      title: Event Customer Loyalty Card Pending Points Canceled
      description: >-
        Event data object schema for
        `customer.voucher.loyalty_card.pending_points.canceled`.
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/SimpleCustomer'
        campaign:
          $ref: '#/components/schemas/SimpleCampaign'
        voucher:
          $ref: '#/components/schemas/SimpleVoucher'
        voucher_pending_points_balance:
          $ref: '#/components/schemas/VoucherBalance'
        order:
          $ref: '#/components/schemas/SimpleOrder'
        pending_points:
          $ref: '#/components/schemas/LoyaltyPendingPoints'
      required:
        - customer
        - campaign
        - voucher
        - voucher_pending_points_balance
        - order
        - pending_points
    EventCustomerLoyaltyCardPendingPointsUpdated:
      title: Event Customer Loyalty Card Pending Points Updated
      description: >-
        Event data object schema for
        `customer.voucher.loyalty_card.pending_points.updated`.
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/SimpleCustomer'
        campaign:
          $ref: '#/components/schemas/SimpleCampaign'
        voucher:
          $ref: '#/components/schemas/SimpleVoucher'
        voucher_pending_points_balance:
          $ref: '#/components/schemas/VoucherBalance'
        order:
          $ref: '#/components/schemas/SimpleOrder'
        pending_points:
          $ref: '#/components/schemas/LoyaltyPendingPoints'
      required:
        - customer
        - campaign
        - voucher
        - voucher_pending_points_balance
        - order
        - pending_points
    EventCustomerLoyaltyCardPointsAdded:
      title: Event Customer Loyalty Card Points Added
      description: >-
        Event data object schema for
        `customer.voucher.loyalty_card.points_added`.
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/SimpleCustomer'
        campaign:
          $ref: '#/components/schemas/SimpleCampaign'
        voucher:
          $ref: '#/components/schemas/SimpleVoucher'
        balance:
          $ref: '#/components/schemas/VoucherBalance'
        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.
                      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
                    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
                    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
                    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:
                  type: string
                  description: Transaction type concerning loyalty card points.
                  enum:
                    - POINTS_ACCRUAL
    EventCustomerLoyaltyCardPointsTransferred:
      title: Event Customer Loyalty Card Points Transferred
      description: >-
        Event data object schema for
        `customer.voucher.loyalty_card.points_transferred`.
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/SimpleCustomer'
        campaign:
          $ref: '#/components/schemas/SimpleCampaign'
        voucher:
          $ref: '#/components/schemas/SimpleVoucher'
        source_voucher:
          $ref: '#/components/schemas/SimpleVoucher'
        destination_voucher:
          $ref: '#/components/schemas/SimpleVoucher'
        balance:
          $ref: '#/components/schemas/VoucherBalance'
        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.
                      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
                    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
                    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
                    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:
                  type: string
                  description: Transaction type concerning loyalty card points.
                  enum:
                    - POINTS_TRANSFER_IN
                    - POINTS_TRANSFER_OUT
    EventCustomerVouchersLoyaltyPointsExpired:
      title: Event Customer Loyalty Card Points Expired
      description: >-
        Event data object schema for
        `customer.voucher.loyalty_card.points_expired`.
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/SimpleCustomer'
        campaign:
          $ref: '#/components/schemas/SimpleCampaign'
        voucher:
          $ref: '#/components/schemas/SimpleVoucher'
        points:
          type: integer
          description: The number of expired points.
        buckets:
          type: array
          items:
            $ref: '#/components/schemas/LoyaltyPointsBucket'
        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.
                      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
                    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
                    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
                    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:
                  type: string
                  description: Transaction type concerning loyalty card points.
                  enum:
                    - POINTS_EXPIRATION
    EventCustomerLoyaltyTierBase:
      title: Event Customer Loyalty Tier Base
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/SimpleCustomer'
        campaign:
          $ref: '#/components/schemas/SimpleCampaign'
      required:
        - created_at
        - loyalty_tier_to
    LoyaltyTier:
      title: Loyalty Tier
      allOf:
        - $ref: '#/components/schemas/LoyaltyTierBase'
        - type: object
          properties:
            id:
              type: string
              description: Unique loyalty tier ID.
            campaign_id:
              type: string
              description: Unique parent campaign ID.
            metadata:
              type: object
              nullable: true
              description: >-
                The metadata object stores all custom attributes assigned to the
                loyalty tier. A set of key/value pairs that you can attach to a
                loyalty tier object. It can be useful for storing additional
                information about the loyalty tier in a structured format.
            created_at:
              type: string
              format: date-time
              description: >-
                Timestamp representing the date and time when the loyalty tier
                was created. The value is shown in the ISO 8601 format.
            updated_at:
              type: string
              nullable: true
              format: date-time
              description: >-
                Timestamp representing the date and time when the loyalty tier
                was updated. The value is shown in the ISO 8601 format.
            config:
              type: object
              description: Defines loyalty tier range in points.
              required:
                - points
              properties:
                points:
                  type: object
                  description: Defines range of loyalty tier in points.
                  properties:
                    from:
                      type: integer
                      description: Bottom points threshold value.
                    to:
                      type: integer
                      description: Top points threshold value.
            expiration:
              $ref: '#/components/schemas/LoyaltyTierExpiration'
            object:
              type: string
              default: loyalty_tier
              enum:
                - loyalty_tier
              description: >-
                The type of the object represented by JSON. This object stores
                information about the loyalty.
          required:
            - id
            - campaign_id
            - metadata
            - created_at
            - config
            - object
    SimpleCustomer:
      title: Simple Customer
      type: object
      description: Simplified customer data.
      properties:
        id:
          type: string
          description: >-
            Unique identifier of an existing customer. It is assigned by
            Voucherify.
        name:
          type: string
          description: Customer's first and last name.
        email:
          type: string
          description: Customer's email address.
        source_id:
          type: string
          description: >-
            A unique identifier of the customer. It can be a customer ID or
            email from a CRM system, database, or a third-party service.
        metadata:
          type: object
          description: >-
            A set of custom key/value pairs that are attached to the customer.
            It stores all custom attributes assigned to the customer.
        object:
          type: string
          description: The type of the object represented by JSON.
          enum:
            - customer
    SimpleCampaign:
      title: Simple Campaign
      type: object
      description: Simplified campaign data.
      properties:
        id:
          type: string
          description: Campaign ID.
        name:
          type: string
          description: Campaign name.
        campaign_type:
          type: string
          description: Type of campaign.
        type:
          type: string
          description: >-
            Defines whether the campaign can be updated with new vouchers after
            campaign creation or if the campaign consists of generic
            (standalone) vouchers.


            - `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will
            generate based on set criteria

            -  `STATIC`: vouchers need to be manually published

            - `STANDALONE`: campaign for single vouchers
          enum:
            - AUTO_UPDATE
            - STATIC
            - STANDALONE
        is_referral_code:
          type: boolean
          description: >-
            Flag indicating whether this voucher is a referral code; `true` for
            campaign type `REFERRAL_PROGRAM`.
        voucher:
          $ref: '#/components/schemas/SimpleCampaignVoucher'
        referral_program:
          $ref: '#/components/schemas/ReferralProgram'
        auto_join:
          type: boolean
          description: >-
            Indicates whether customers will be able to auto-join the campaign
            if any earning rule is fulfilled.
        join_once:
          type: boolean
          description: >-
            If this value is set to `true`, customers will be able to join the
            campaign only once. It is always `false` for generic (standalone)
            vouchers campaigns and it cannot be changed in them. It is always
            `true` for loyalty campaigns and it cannot be changed in them.
        active:
          type: boolean
          description: Indicates whether the campaign is active.
        category_id:
          nullable: true
          type: string
          description: The unique category ID that this campaign belongs to.
        category:
          type: string
          description: Unique category name.
        categories:
          type: array
          description: Contains details about the category.
          items:
            $ref: '#/components/schemas/Category'
        metadata:
          type: object
          description: >-
            A set of custom key/value pairs that you can attach to a campaign.
            The metadata object stores all custom attributes assigned to the
            campaign.
        start_date:
          type: string
          format: date-time
          description: >-
            Activation timestamp defines when the campaign starts to be active
            in ISO 8601 format. Campaign is inactive *before* this date. 
          example: '2022-09-20T00:00:00.000Z'
        expiration_date:
          type: string
          format: date-time
          description: >-
            Expiration timestamp defines when the campaign expires in ISO 8601
            format.  Campaign is inactive *after* this date.
          example: '2022-09-30T00:00:00.000Z'
        description:
          type: string
          description: >-
            An optional field to keep extra textual information about the
            campaign such as a campaign description and details.
        created_at:
          type: string
          example: '2024-01-01T11:11:11.111Z'
          description: >-
            Timestamp representing the date and time when the campaign was
            created. The value is shown 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 campaign was
            updated in the ISO 8601 format.
          format: date-time
        object:
          type: string
          default: campaign
          enum:
            - campaign
          description: >-
            The type of the object represented by JSON. This object stores
            information about the campaign.
    ListPublicationsItemValidSingleVoucher:
      title: Valid Single Voucher
      type: object
      allOf:
        - $ref: '#/components/schemas/ListPublicationsItemBase'
        - type: object
          properties:
            result:
              type: string
              default: SUCCESS
              enum:
                - SUCCESS
              description: Status of the publication attempt.
            voucher:
              $ref: '#/components/schemas/ListPublicationsItemVoucher'
          required:
            - result
            - voucher
    EventCustomerRedemption:
      title: Event Customer Redemption
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/SimpleCustomer'
        order:
          $ref: '#/components/schemas/SimpleOrder'
        campaign:
          $ref: '#/components/schemas/SimpleCampaign'
        voucher:
          $ref: '#/components/schemas/SimpleVoucher'
        holder:
          $ref: '#/components/schemas/SimpleCustomer'
        promotion_tier:
          $ref: '#/components/schemas/SimplePromotionTier'
        promotion_stack:
          $ref: '#/components/schemas/SimplePromotionStack'
        redemption:
          $ref: '#/components/schemas/SimpleRedemption'
    SimpleRedemption:
      type: object
      title: Simple Redemption
      description: Simplified redemption data.
      properties:
        id:
          type: string
          example: r_0bc92f81a6801f9bca
          description: Unique redemption ID.
        customer_id:
          type: string
          nullable: true
          example: cust_i8t5Tt6eiKG5K79KQlJ0Vs64
          description: Unique customer ID of the redeeming customer.
        tracking_id:
          type: string
          description: Hashed customer source ID.
        date:
          type: string
          example: '2021-12-22T10:13:06.487Z'
          description: >-
            Timestamp representing the date and time when the redemption was
            created in the ISO 8601 format.
          format: date-time
        amount:
          type: integer
          description: >-
            For gift cards, this is a positive integer in the smallest currency
            unit (e.g. 100 cents for $1.00) representing the number of redeemed
            credits.

            For loyalty cards, this is the number of loyalty points used in the
            transaction.

            In the case of redemption rollback, the numbers are expressed as
            negative integers.
          example: 10000
        order:
          $ref: '#/components/schemas/SimpleOrder'
        reward:
          $ref: '#/components/schemas/SimpleRedemptionRewardResult'
        customer:
          $ref: '#/components/schemas/SimpleCustomer'
        result:
          type: string
          enum:
            - SUCCESS
            - FAILURE
          description: Redemption result.
        status:
          type: string
          nullable: true
          enum:
            - SUCCEEDED
            - FAILED
            - ROLLED BACK
        voucher:
          description: Defines the details of the voucher being redeemed.
          allOf:
            - $ref: '#/components/schemas/SimpleVoucher'
        promotion_tier:
          $ref: '#/components/schemas/SimplePromotionTier'
        redemption:
          type: string
          description: Unique redemption ID of the parent redemption.
          example: r_0c656311b5878a2031
        metadata:
          type: object
          description: >-
            The metadata object stores all custom attributes in the form of
            key/value pairs assigned to the redemption.
        failure_code:
          type: string
          example: customer_rules_violated
          description: >-
            If the result is `FAILURE`, this parameter will provide a generic
            reason as to why the redemption failed.
        failure_message:
          type: string
          description: >-
            If the result is `FAILURE`, this parameter will provide an expanded
            reason as to why the redemption failed.
        reason:
          type: string
          description: The reason for the redemption rollback.
        channel:
          type: object
          description: >-
            Defines the details of the channel through which the redemption was
            issued.
          properties:
            channel_id:
              type: string
              description: >-
                Unique channel ID of the user performing the redemption. This is
                either a user ID from a user using the Voucherify Dashboard, an
                X-APP-Id of a user using the API, or the reward assignment ID
                for automatic reward redemption.
            channel_type:
              type: string
              description: >-
                The source of the channel for the redemption:

                `USER` - the redemption was made in the Voucherify Dashboard by
                a user,
                 `API` - redemption was made through the API,
                `AUTO_REDEEM` - the redemption was made automatically for a
                reward.
              enum:
                - API
                - AUTO_REDEEM
                - USER
        object:
          type: string
          description: >-
            The type of the object represented by the JSON. This object stores
            information about the `redemption`.
          default: redemption
      required:
        - id
        - date
        - metadata
        - status
        - object
    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
    RedemptionInternal:
      title: Redemption Internal
      description: Model Used for internal communication
      type: object
      properties:
        id:
          type: string
          example: r_0bc92f81a6801f9bca
          description: Unique redemption ID.
        object:
          type: string
          description: >-
            The type of the object represented by the JSON. This object stores
            information about the `redemption`.
          default: redemption
        created_at:
          type: string
          example: '2021-12-22T10:13:06.487Z'
          description: >-
            Timestamp representing the date and time when the redemption was
            created. The value is shown in the ISO 8601 format.
          format: date-time
        tracking_id:
          type: string
          description: Hashed customer source ID.
        metadata:
          type: object
          description: >-
            The metadata object stores all custom attributes assigned to the
            redemption.
        channel_type:
          type: string
          description: >-
            The source of the channel for the redemption rollback. A `USER`
            corresponds to the Voucherify Dashboard and an `API` corresponds to
            the API.
          enum:
            - USER
            - API
        channel_id:
          type: string
          example: user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH
          description: >-
            Unique channel ID of the user performing the redemption. This is
            either a user ID from a user using the Voucherify Dashboard or an
            X-APP-Id of a user using the API.
        failure_code:
          type: string
          example: customer_rules_violated
          description: >-
            If the result is `FAILURE`, this parameter will provide a generic
            reason as to why the redemption failed.
        failure_message:
          type: string
          description: >-
            If the result is `FAILURE`, this parameter will provide a more
            expanded reason as to why the redemption failed.
        order:
          allOf:
            - $ref: '#/components/schemas/OrderCalculated'
            - type: object
              properties:
                items:
                  type: array
                  description: >-
                    Array of items applied to the order. It can include up to
                    500 items.
                  items:
                    $ref: '#/components/schemas/OrderCalculatedItem'
        previous_order:
          allOf:
            - $ref: '#/components/schemas/OrderCalculated'
            - type: object
              properties:
                items:
                  type: array
                  description: >-
                    Array of items applied to the order. It can include up to
                    500 items.
                  items:
                    $ref: '#/components/schemas/OrderCalculatedItem'
        reward:
          $ref: '#/components/schemas/RedemptionRewardResult'
        amount:
          type: integer
          description: >-
            For gift cards, this is a positive integer in the smallest currency
            unit (e.g. 100 cents for $1.00) representing the number of redeemed
            credits.

            For loyalty cards, this is the number of loyalty points used in the
            transaction.
          example: 10000
        reason:
          type: string
          description: >-
            System generated cause for the redemption being invalid in the
            context of the provided parameters.
        result:
          type: string
          enum:
            - SUCCESS
            - FAILURE
          description: Redemption result.
        status:
          type: string
          enum:
            - SUCCEEDED
            - FAILED
          description: Redemption status.
        related_redemptions:
          type: object
          properties:
            rollbacks:
              type: array
              items:
                title: Redemption Internal Related Redemptions Rollbacks Item
                type: object
                properties:
                  id:
                    type: string
                    example: rr_0bc92f81a6801f9bca
                    description: Unique rollback redemption ID.
                  date:
                    type: string
                    example: '2021-12-22T10:13:06.487Z'
                    description: >-
                      Timestamp representing the date and time when the object
                      was created. The value is shown in the ISO 8601 format.
                    format: date-time
            redemptions:
              type: array
              items:
                title: Redemption Internal Related Redemptions Item
                type: object
                properties:
                  id:
                    type: string
                    example: r_0bc92f81a6801f9bca
                    description: Unique redemption ID.
                  date:
                    type: string
                    example: '2021-12-22T10:13:06.487Z'
                    description: >-
                      Timestamp representing the date and time when the object
                      was created. The value is shown in the ISO 8601 format.
                    format: date-time
        parent_redemption_id:
          type: string
          description: Unique redemption ID of the parent redemption.
          example: r_0c656311b5878a2031
        redemption:
          type: string
          description: Unique redemption ID of the parent redemption.
          example: r_0c656311b5878a2031
        customer:
          $ref: '#/components/schemas/SimpleCustomer'
        customer_id:
          type: string
          nullable: true
          example: cust_i8t5Tt6eiKG5K79KQlJ0Vs64
          description: Unique customer ID of the redeeming customer.
        related_object_type:
          type: string
          description: Defines the related object.
          enum:
            - voucher
            - promotion_tier
        related_object_id:
          type: string
          description: >-
            Unique related object ID assigned by Voucherify, i.e.
            v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher.
        related_object_parent_id:
          type: string
          description: >-
            Unique related parent object ID assigned by Voucherify, i.e.
            v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher.
        campaign_name:
          type: string
          description: Campaign name
        voucher:
          description: Defines the details of the voucher being redeemed.
          allOf:
            - $ref: '#/components/schemas/Voucher'
            - $ref: '#/components/schemas/VoucherHolder'
        promotion_tier:
          description: Contains details of the promotion tier and the parent campaign.
          allOf:
            - $ref: '#/components/schemas/PromotionTier'
    SimpleRedemptionRewardResult:
      title: Simple Redemption Reward Result
      type: object
      description: Simplified redemption reward result data
      properties:
        customer:
          $ref: '#/components/schemas/SimpleCustomer'
        assignment_id:
          type: string
          description: Unique reward assignment ID assigned by Voucherify.
        voucher:
          allOf:
            - $ref: '#/components/schemas/SimpleVoucher'
        product:
          allOf:
            - $ref: '#/components/schemas/SimpleProduct'
        sku:
          allOf:
            - $ref: '#/components/schemas/SimpleSku'
        loyalty_tier_id:
          type: string
          description: Unique loyalty tier ID assigned by Voucherify.
        id:
          type: string
          example: rew_nIy4gHpQHle2c3pNMwuj7G6j
          description: Unique reward ID, assigned by Voucherify.
        object:
          type: string
          default: reward
          enum:
            - reward
          description: >-
            The type of the object represented by the JSON. This object stores
            information about the reward.
        name:
          type: string
          description: Reward name.
        created_at:
          type: string
          description: >-
            Timestamp representing the date and time when the reward was
            created. The value is shown in the ISO 8601 format.
          example: '2024-01-01T11:11:11.111Z'
          format: date-time
        updated_at:
          type: string
          nullable: true
          description: >-
            Timestamp representing the date and time when the reward was
            updated. The value is shown in the ISO 8601 format.
          example: '2024-01-01T11:11:11.111Z'
          format: date-time
        parameters:
          description: Defines how the reward is generated.
          type: object
          allOf:
            - $ref: '#/components/schemas/RewardType'
        metadata:
          type: object
          description: >-
            A set of custom key/value pairs that you can attach to a reward. The
            metadata object stores all custom attributes assigned to the reward.
        type:
          type: string
          enum:
            - CAMPAIGN
            - COIN
            - MATERIAL
          description: Reward type.
    SimpleReferralTier:
      title: Simple Referral Tier
      type: object
      properties:
        id:
          type: string
          description: Unique referral tier ID.
          example: seg_DNAOhUtJffvX0f57ajLMFBYR
        campaign_id:
          type: string
          description: Campaign Id.
        banner:
          type: string
          description: Text to be displayed to your customers on your website.
        parameters:
          type: object
          description: Referral tier parameters
    CustomEvent:
      title: Custom Event
      type: object
      properties:
        id:
          type: string
          description: Unique custom event ID.
        object:
          type: string
          default: event
          description: The object represented is an `event`.
          enum:
            - event
        type:
          type: string
          description: The event name.
        customer:
          description: A simple customer object
          allOf:
            - $ref: '#/components/schemas/SimpleCustomerRequiredObjectType'
        referral:
          type: object
          description: Referral object.
          properties:
            referrer_id:
              type: string
              description: Unique referrer ID.
              example: cust_nM4jqPiaXUvQdVSA6vTRUnix
            code:
              type: string
              description: Voucher code.
            id:
              type: string
              description: Unique voucher ID.
        loyalty:
          type: object
          description: Loyalty object.
          properties:
            code:
              type: string
              description: Loyalty card code.
        metadata:
          type: object
          description: >-
            A set of custom key/value pairs that you can attach to a customer.
            The metadata object stores all custom attributes assigned to the
            customer object.
        created_at:
          type: string
          example: '2021-12-22T10:13:06.487Z'
          description: >-
            Timestamp representing the date and time when the custom event was
            created. The value is shown in the ISO 8601 format.
          format: date-time
      required:
        - object
        - type
        - customer
        - referral
        - loyalty
    SimpleSegment:
      title: Simple Segment
      type: object
      properties:
        id:
          type: string
          description: Unique segment ID.
          example: seg_DNAOhUtJffvX0f57ajLMFBYR
        name:
          type: string
          description: Segment name.
        object:
          type: string
          description: The type of the object represented by the ID.
          default: segment
          enum:
            - segment
      required:
        - id
        - name
        - object
    EarningRule:
      title: Earning Rule
      allOf:
        - $ref: '#/components/schemas/EarningRuleBase'
        - type: object
          properties:
            validation_rule_id:
              type: string
              nullable: true
              description: >-
                A unique validation rule identifier assigned by the Voucherify
                API. The validation rule is verified before points are added to
                the balance.
            updated_at:
              type: string
              nullable: true
              format: date-time
              description: >-
                Timestamp representing the date and time when the earning rule
                was last updated in ISO 8601 format.
            active:
              type: boolean
              description: >-
                A flag to toggle the earning rule on or off. You can disable an
                earning rule even though it's within the active period defined
                by the start_date and expiration_date of the campaign or the
                earning rule's own start_date and expiration_date.


                - `true` indicates an active earning rule

                - `false` indicates an inactive earning rule
          required:
            - validation_rule_id
            - updated_at
            - active
    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
    OrderCalculated:
      title: Order Calculated No Customer Data
      type: object
      description: Order information.
      properties:
        id:
          type: string
          description: >-
            Unique ID assigned by Voucherify of an existing order that will be
            linked to the redemption of this request.
        source_id:
          type: string
          nullable: true
          description: >-
            Unique source ID of an existing order that will be linked to the
            redemption of this request.
        status:
          type: string
          description: The order status.
          enum:
            - CREATED
            - PAID
            - CANCELED
            - FULFILLED
        amount:
          type: integer
          description: >-
            This is the sum of the order items' amounts. It is expressed as an
            integer in the smallest currency unit (e.g. 100 cents for $1.00).
        initial_amount:
          type: integer
          description: >-
            This is the sum of the order items' amounts before any discount or
            other effect (e.g. add missing units) is applied. It is expressed as
            an integer in the smallest currency unit (e.g. 100 cents for $1.00).
        discount_amount:
          type: integer
          description: >-
            Sum of all order-level discounts applied to the order. It is
            expressed as an integer in the smallest currency unit (e.g. 100
            cents for $1.00).
        items_discount_amount:
          type: integer
          description: >-
            Sum of all product-specific discounts applied to the order. It is
            expressed as an integer in the smallest currency unit (e.g. 100
            cents for $1.00).
        total_discount_amount:
          type: integer
          description: >-
            Sum of all order-level AND all product-specific discounts applied to
            the order. It is expressed as an integer in the smallest currency
            unit (e.g. 100 cents for $1.00).
        total_amount:
          type: integer
          description: >-
            Order amount after undoing all the discounts through the rollback
            redemption. It is expressed as an integer in the smallest currency
            unit (e.g. 100 cents for $1.00).
        applied_discount_amount:
          type: integer
          description: >-
            This field shows the order-level discount applied. It is expressed
            as an integer in the smallest currency unit (e.g. 100 cents for
            $1.00).
        items_applied_discount_amount:
          type: integer
          description: >-
            Sum of all product-specific discounts applied in a particular
            request. It is expressed as an integer in the smallest currency unit
            (e.g. 100 cents for $1.00).  

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

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

            `subtotal_amount`=`amount`-`applied_discount_amount`
        product:
          type: object
          description: An object containing details of the related product.
          properties:
            id:
              type: string
              description: >-
                A unique identifier that represents the product and is assigned
                by Voucherify.
            source_id:
              type: string
              description: >-
                The merchant's product ID (if it is different than Voucherify's
                product ID). It is really useful in case of integration between
                multiple systems. It can be an ID from an eCommerce site, a
                database or a 3rd party service.
            override:
              type: boolean
              description: >-
                The override set to `true` is used to store the product
                information in the system. If the product does not exist, it
                will be created with a source_id; if it does exist, the provided
                values for the name, price, and metadata will replace those
                already stored in the system.
            name:
              type: string
              description: Product name.
            metadata:
              type: object
              description: >-
                A set of custom key/value pairs that you can attach to a
                product. It can be useful for storing additional information
                about the product in a structured format. It can be used to
                create product collections.
            price:
              type: number
              description: >-
                Product price. A positive integer in the smallest currency unit
                (e.g. 100 cents for $1.00).
        sku:
          type: object
          description: An object containing details of the related SKU.
          properties:
            id:
              type: string
              description: >-
                A unique identifier that represents the SKU and is assigned by
                Voucherify.
            source_id:
              type: string
              description: >-
                The merchant's SKU ID (if it is different than Voucherify's SKU
                ID). It is really useful in case of integration between multiple
                systems. It can be an ID from an eCommerce site, a database or a
                3rd party service.
            override:
              type: boolean
              description: >-
                The override set to `true` is used to store the product
                information in the system. If the product does not exist, it
                will be created with a source_id; if it does exist, the provided
                values for the name, price, and metadata will replace those
                already stored in the system.
            sku:
              type: string
              description: The SKU name.
            price:
              type: number
              description: >-
                SKU price. A positive integer in the smallest currency unit
                (e.g. 100 cents for $1.00).
            metadata:
              type: object
              description: >-
                A set of custom key/value pairs that you can attach to an SKU.
                It can be useful for storing additional information about the
                SKU in a structured format. It can be used to create product
                collections.
        object:
          type: string
          default: order_item
          enum:
            - order_item
          description: The type of the object represented by JSON.
        metadata:
          type: object
          description: >-
            A set of custom key/value pairs that you can attach to an item
            object. It can be useful for storing additional information about
            the item in a structured format. It can be used to define business
            validation rules or discount formulas.
      required:
        - object
    SimpleEvent:
      title: Simple Event
      type: object
      description: Simplified event data.
      properties:
        id:
          type: string
          description: >-
            Unique identifier assigned by Voucherify that will be linked to the
            this event.
          example: evcus_0e3070fef399b70b00
        type:
          type: string
          description: Type of the triggering event.
          example: customer.order.paid
        category:
          type: string
          description: Type of the event.
          enum:
            - EFFECT
            - ACTION
        entity_id:
          type: string
          description: ID of the entity that initiated the event.
          example: cust_ADqZIwGvWFvugWXVbrHwXRHO
        created_at:
          type: string
          format: date-time
          example: '2024-01-01T11:11:11.111Z'
          description: >-
            Timestamp representing the date and time when the event was created
            in the ISO 8601 format.
        group_id:
          type: string
          description: Unique identifier of the request that triggered the event.
          example: v-1f36113948e50fc4ge
    EventCustomerRewardRedemptions:
      title: Event Customer Reward Redemptions
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/SimpleCustomer'
        holder:
          $ref: '#/components/schemas/SimpleCustomer'
        voucher:
          $ref: '#/components/schemas/SimpleVoucher'
        campaign:
          $ref: '#/components/schemas/SimpleCampaign'
        reward_redemption:
          type: object
        reward:
          $ref: '#/components/schemas/SimpleRedemptionRewardResult'
        reward_assignment:
          $ref: '#/components/schemas/RewardAssignment'
        source:
          type: string
        balance:
          type: integer
    SimpleOrder:
      title: Simple Order
      type: object
      description: Order information.
      properties:
        id:
          type: string
          description: >-
            Unique identifier of an existing order that will be linked to the
            redemption of this request.
        source_id:
          type: string
          description: >-
            Unique source identifier of an existing order that will be linked to
            the redemption of this request.
        status:
          type: string
          description: The order status.
          enum:
            - CREATED
            - PAID
            - CANCELED
            - FULFILLED
        customer_id:
          type: string
          nullable: true
          description: >-
            Unique customer identifier of the customer making the purchase. The
            ID is assigned by Voucherify.
          example: cust_7iUa6ICKyU6gH40dBU25kQU1
        referrer_id:
          type: string
          nullable: true
          description: Unique identifier of the referrer assigned by Voucherify.
          example: cust_nM4jqPiaXUvQdVSA6vTRUnix
        amount:
          type: integer
          description: >-
            A positive integer in the smallest currency unit (e.g. 100 cents for
            $1.00) representing the total amount of the order. This is the sum
            of the order items' amounts.
        discount_amount:
          type: integer
          description: >-
            Sum of all order-level discounts applied to the order. It is
            expressed as an integer in the smallest currency unit (e.g. 100
            cents for $1.00).
        applied_discount_amount:
          type: integer
          description: >-
            This field shows the order-level discount applied. It is expressed
            as an integer in the smallest currency unit (e.g. 100 cents for
            $1.00).
        items_discount_amount:
          type: integer
          description: >-
            Sum of all product-specific discounts applied to the order.  It is
            expressed as an integer in the smallest currency unit (e.g. 100
            cents for $1.00).
        items_applied_discount_amount:
          type: integer
          description: >-
            Sum of all product-specific discounts applied in a particular
            request. It is expressed as an integer in the smallest currency unit
            (e.g. 100 cents for $1.00).  

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

            `total_applied_discount_amount` = `applied_discount_amount` +
            `items_applied_discount_amount`
        total_amount:
          type: integer
          description: >-
            Order amount after undoing all the discounts through the rollback
            redemption. It is expressed as an integer in the smallest currency
            unit (e.g. 100 cents for $1.00).
        items:
          type: array
          description: Array of items applied to the order. It can include up to 500 items.
          items:
            $ref: '#/components/schemas/SimpleOrderItem'
        metadata:
          type: object
          description: >-
            A set of custom key/value pairs that you can attach to an order. It
            can be useful for storing additional information about the order in
            a structured format. It can be used to define business validation
            rules or discount formulas.
        object:
          type: string
          description: The type of the object represented by JSON.
          default: order
          enum:
            - order
      required:
        - object
    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'
    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
    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
    LoyaltyPointsBucket:
      type: object
      title: Loyalty Point Bucket
      description: Contains the details about expiring loyalty points.
      properties:
        id:
          type: string
          description: Unique identifier of the loyalty points bucket.
        voucher_id:
          type: string
          description: Unique identifier of the parent loyalty card.
        campaign_id:
          type: string
          description: Unique identifier of the parent campaign.
        bucket:
          type: object
          required:
            - total_points
          description: Defines the number of points stored in this loyalty point bucket.
          properties:
            total_points:
              type: integer
              description: Total number of points in the loyalty point bucket.
        status:
          type: string
          description: Loyalty point bucket status.
        expires_at:
          type: string
          format: date
          description: >-
            Date when the number of points defined in the bucket object are due
            to expire.
        created_at:
          type: string
          description: >-
            Timestamp representing the date and time when the loyalty point
            bucket object was created in ISO 8601 format.
          format: date-time
        updated_at:
          type: string
          format: date-time
          description: >-
            Timestamp representing the date and time when the loyalty point
            bucket object was updated in ISO 8601 format.
        object:
          type: string
          enum:
            - loyalty_points_bucket
          description: >-
            The type of the object represented by JSON. This object stores
            information about the loyalty point bucket.
      required:
        - id
        - voucher_id
        - campaign_id
        - bucket
        - created_at
        - status
        - expires_at
        - object
    LoyaltyTierBase:
      title: Loyalty Tier Base
      type: object
      properties:
        name:
          type: string
          description: Loyalty Tier name.
        earning_rules:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/MappingPoints'
          description: >-
            Contains a list of earning rule IDs and their points mapping for the
            given earning rule.
        rewards:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/MappingPoints'
          description: >-
            Contains a list of reward IDs and their points mapping for the given
            reward.
        points:
          type: object
          description: Defines range of loyalty tier in points.
          properties:
            from:
              type: integer
              description: Bottom points threshold value.
            to:
              type: integer
              description: Top points threshold value.
      required:
        - name
        - points
    LoyaltyTierExpiration:
      title: Loyalty Tier Expiration
      description: Defines loyalty tier expiration date.
      type: object
      properties:
        customer_id:
          type: string
          description: >-
            Unique customer identifier of the customer making the purchase. The
            ID is assigned by Voucherify.
          example: cust_7iUa6ICKyU6gH40dBU25kQU1
        campaign_id:
          type: string
          description: Unique campaign ID, assigned by Voucherify.
          example: camp_rRsfatlwN7unSeUIJDCYedal
        tier_id:
          type: string
          description: Unique tier ID, assigned by Voucherify.
        start_date:
          type: string
          description: >-
            Activation timestamp defines when the loyalty tier starts to be
            active in ISO 8601 format. Loyalty tier is inactive before this
            date.
        expiration_date:
          type: string
          description: >-
            Expiration timestamp defines when the loyalty tier expires in ISO
            8601 format. Loyalty tier is inactive after this date.
        created_at:
          type: string
          example: '2021-12-22T10:13:06.487Z'
          description: >-
            Timestamp representing the date and time when the loyalty tier was
            created. The value is shown in the ISO 8601 format.
          format: date-time
        updated_at:
          type: string
          example: '2021-12-22T10:13:06.487Z'
          description: >-
            Timestamp representing the date and time when the loyalty tier was
            updated. The value is shown in the ISO 8601 format.
          format: date-time
      required:
        - customer_id
        - campaign_id
        - tier_id
        - created_at
    SimpleCampaignVoucher:
      type: object
      description: Simplified campaign voucher data.
      title: Simple Campaign Voucher
      properties:
        type:
          type: string
          description: Type of the voucher.
          enum:
            - DISCOUNT_VOUCHER
            - LOYALTY_CARD
            - GIFT_VOUCHER
        discount:
          description: Defines the voucher discount type and details.
          allOf:
            - $ref: '#/components/schemas/Discount'
        gift:
          description: Defines the voucher gift details.
          allOf:
            - $ref: '#/components/schemas/Gift'
        loyalty_card:
          description: Defines the voucher loyalty card details.
          allOf:
            - $ref: '#/components/schemas/CampaignLoyaltyCard'
        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.
          required:
            - quantity
            - redeemed_quantity
        code_config:
          allOf:
            - $ref: '#/components/schemas/CodeConfig'
          required:
            - length
            - charset
            - pattern
      required:
        - type
        - redemption
        - code_config
    ReferralProgram:
      title: Referral Program
      description: >-
        Defines the referee reward and the way a referral is triggered. Context:
        `REFERRAL_PROGRAM`.
      type: object
      properties:
        conversion_event_type:
          type: string
          enum:
            - redemption
            - custom_event
          description: Define how a referral is triggered.
        custom_event:
          type: object
          description: Contains details about the custom event.
          properties:
            id:
              type: string
              example: ms_Ll9enAm2BCN0M1s4VxWobLFM
              description: Unique custom event ID.
            name:
              type: string
              description: Custom event name.
        referee_reward:
          type: object
          description: Defines the referee reward.
          properties:
            related_object_parent:
              type: object
              description: Details of the resource from which the reward originates.
              properties:
                id:
                  type: string
                  example: camp_kdxp3vf1clQ9CFs1jpqv3tZe
                  description: Unique ID of the reward source.
                name:
                  type: string
                  description: Name of the reward source.
                object:
                  type: string
                  default: CAMPAIGN
                  enum:
                    - CAMPAIGN
                  description: Type of resource represented by the source of the reward.
            type:
              type: string
              enum:
                - LOYALTY_CARD
                - GIFT_VOUCHER
              description: Type of reward.
            amount:
              type: integer
              description: >-
                Define the number of `points` to add to a loyalty card or
                `credits` to the balance on a gift card. In case of the gift
                card, the value is multiplied by 100 to precisely represent 2
                decimal places. For example, $100 amount is written as 10000.
    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
    ListPublicationsItemBase:
      title: List Publications Item Base
      type: object
      properties:
        id:
          type: string
          example: pub_BbjAXnmm8e0SIm3zG8qvvFCP0KuLywtp
          description: Unique publication ID, assigned by Voucherify.
        object:
          type: string
          default: publication
          enum:
            - publication
          description: >-
            The type of the object represented by the JSON. This object stores
            information about the `publication`.
        created_at:
          type: string
          example: '2022-09-23T09:57:00.434Z'
          description: >-
            Timestamp representing the date and time when the publication was
            created. The value is shown in the ISO 8601 format.
          format: date-time
        customer_id:
          type: string
          example: cust_eWgXlBBiY6THFRJwX45Iakv4
          description: Unique customer ID of the customer receiving the publication.
        tracking_id:
          type: string
          description: Customer's `source_id`.
        metadata:
          type: object
          description: >-
            The metadata object stores all custom attributes assigned to the
            publication. A set of key/value pairs that you can attach to a
            publication object. It can be useful for storing additional
            information about the publication in a structured format.
          properties:
            source_type:
              type: string
              description: Defines the type of the distribution source.
            source_id:
              type: string
              description: Unique identifier of the distribution source.
            distribution_id:
              type: string
              description: Unique identifier of the distribution.
        channel:
          type: string
          description: >-
            How the publication was originated. It can be your own custom
            channel or an example value provided here.
        source_id:
          type: string
          nullable: true
          description: >-
            The merchant's publication ID if it is different from the Voucherify
            publication ID. It's an optional tracking identifier of a
            publication. It is really useful in case of an integration between
            multiple systems. It can be a publication ID from a CRM system,
            database or 3rd-party service. 
        customer:
          $ref: '#/components/schemas/CustomerWithSummaryLoyaltyReferrals'
        vouchers:
          type: array
          description: Contains the voucher IDs that was assigned by Voucherify.
          items:
            type: string
            example: ZFMKNAEK
        vouchers_id:
          type: array
          description: >-
            Contains the unique internal voucher IDs that was assigned by
            Voucherify.
          items:
            type: string
            example: v_Bw3qWZWv47yb1Onra8F2LlFI1enLakfA
      required:
        - id
        - object
        - created_at
        - customer_id
        - metadata
        - channel
        - source_id
        - customer
        - vouchers_id
    ListPublicationsItemVoucher:
      type: object
      title: List Publications Item Voucher
      properties:
        code:
          type: string
          description: Voucher code.
        object:
          type: string
          description: The type of the object represented by JSON.
          default: voucher
          enum:
            - voucher
        campaign:
          type: string
          description: Campaign name
        gift:
          description: Gift object response
          allOf:
            - $ref: '#/components/schemas/Gift'
        loyalty_card:
          description: Defines the loyalty card details.
          type: object
        discount:
          $ref: '#/components/schemas/Discount'
        is_referral_code:
          type: boolean
          description: >-
            Flag indicating whether this voucher is a referral code; `true` for
            campaign type `REFERRAL_PROGRAM`.
      required:
        - code
        - object
        - campaign
    SimplePromotionTier:
      title: Simple Promotion Tier
      type: object
      description: >-
        This is an object representing a simple promotion tier. Promotion tiers
        are always assigned to a campaign and cannot be used standalone.
      properties:
        id:
          type: string
          example: promo_63fYCt81Aw0h7lzyRkrGZh9p
          description: Unique promotion tier ID.
        name:
          type: string
          description: Name of the promotion tier.
        banner:
          type: string
          description: Text to be displayed to your customers on your website.
        campaign:
          type: object
          description: Contains details about promotion tier's parent campaign.
          properties:
            id:
              type: string
              description: Unique campaign ID.
        metadata:
          type: object
          description: >-
            A set of custom key/value pairs that you can attach to a promotion
            tier. The metadata object stores all custom attributes assigned to
            the promotion tier.
    SimplePromotionStack:
      title: Simple Promotion Stack
      type: object
      description: Represents simplified promotion stack data.
      properties:
        id:
          type: string
          description: Unique identifier of the promotion stack.
        name:
          type: string
          description: Name of the promotion stack.
        category_id:
          type: string
          description: Unique identifier of the category of the promotion stack.
        campaign:
          type: object
          description: Represents simplified promotion stack campaign data.
          properties:
            id:
              type: string
              description: Unique identifier of the campaign.
        tiers:
          type: object
          required:
            - ids
          description: >-
            Contains the tier configuration. A promotion stack can include up to
            30 tiers.
          properties:
            ids:
              type: array
              minItems: 1
              description: Contains the list of tiers in a pre-defined sequence.
              items:
                type: string
            hierarchy_mode:
              type: string
              default: MANUAL
              enum:
                - MANUAL
    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.
    RedemptionRewardResult:
      title: Redemption Reward Result
      type: object
      properties:
        customer:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/SimpleCustomer'
        assignment_id:
          type: string
          nullable: true
          description: Unique reward assignment ID assigned by Voucherify.
        voucher:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/Voucher'
        product:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/Product'
        sku:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/Sku'
        loyalty_tier_id:
          type: string
          nullable: true
          description: Unique loyalty tier ID assigned by Voucherify.
        id:
          type: string
          example: rew_0bc92f81a6801f9bca
          description: Unique reward ID.
        name:
          type: string
          example: Reward Name
          description: Name of the reward.
        object:
          type: string
          description: The type of the object represented by the JSON
          default: reward
          enum:
            - reward
        created_at:
          type: string
          example: '2021-12-22T10:13:06.487Z'
          description: >-
            Timestamp representing the date and time when the redemption was
            created. The value is shown in the ISO 8601 format.
          format: date-time
        updated_at:
          type: string
          format: date-time
          example: '2022-10-03T12:24:58.008Z'
          description: Timestamp in ISO 8601 format indicating when the reward was updated.
        parameters:
          type: object
          description: These are parameters representing a material reward.
          properties:
            campaign:
              type: object
              description: Defines the product redeemed as a reward.
              properties:
                id:
                  type: string
                  description: Campaign unique ID.
                  example: camp_13BbZ0kQsNinhqsX3wUts2UP
                balance:
                  type: integer
                  description: >-
                    Points available for reward redemption. This is calculated
                    as follows: `balance` = `points` - `expired_points` -
                    `subtracted_points` - `redemption.redeemed_points`.
                type:
                  type: string
                  description: Defines the type of the campaign.
            product:
              type: object
              description: Defines the product redeemed as a reward.
              properties:
                id:
                  type: string
                  example: prod_0b7d7dfb05cbe5c616
                  description: 'Unique product ID, assigned by Voucherify. '
                sku_id:
                  type: string
                  description: Unique identifier of the SKU. It is assigned by Voucherify.
                  example: sku_0a41e31c7b41c28358
            coin:
              type: object
              description: >-
                Defines the ratio by mapping the number of loyalty points in
                `points_ratio` to a predefined cash amount in `exchange_ratio`.
              properties:
                exchange_ratio:
                  type: integer
                  description: >-
                    The cash equivalent of the points defined in the
                    `points_ratio` property.
                points_ratio:
                  type: integer
                  description: >-
                    The number of loyalty points that will map to the predefined
                    cash amount defined by the `exchange_ratio` property.
        metadata:
          type: object
          description: >-
            A set of custom key/value pairs that you can attach to a reward. The
            metadata object stores all custom attributes assigned to the reward.
        type:
          type: string
          enum:
            - CAMPAIGN
            - COIN
            - MATERIAL
          description: Reward type.
      required:
        - reward
        - customer
        - assignment_id
        - voucher
        - product
        - sku
        - loyalty_tier_id
    Voucher:
      title: Voucher
      description: >-
        This is an object representing a voucher with categories and validation
        rules assignments.
      allOf:
        - $ref: '#/components/schemas/VoucherBase'
        - type: object
          properties:
            categories:
              type: array
              description: Contains details about the category.
              items:
                $ref: '#/components/schemas/Category'
            validation_rules_assignments:
              $ref: '#/components/schemas/ValidationRulesAssignmentsList'
    VoucherHolder:
      title: Voucher Holder
      type: object
      description: This is an object representing a voucher holder.
      properties:
        holder:
          $ref: '#/components/schemas/SimpleCustomer'
    PromotionTier:
      type: object
      description: >-
        This is an object representing a promotion tier. Promotion tiers are
        always assigned to a campaign and cannot be used standalone.
      title: Promotion Tier
      properties:
        id:
          type: string
          example: promo_63fYCt81Aw0h7lzyRkrGZh9p
          description: Unique promotion tier ID.
        created_at:
          type: string
          example: '2021-12-15T11:34:01.333Z'
          format: date-time
          description: >-
            Timestamp representing the date and time when the promotion tier was
            created. The value is shown in the ISO 8601 format.
        updated_at:
          type: string
          example: '2022-02-09T09:20:05.603Z'
          format: date-time
          description: >-
            Timestamp representing the date and time when the promotion tier was
            updated. The value is shown in the ISO 8601 format.
        name:
          type: string
          description: Name of the promotion tier.
        banner:
          type: string
          description: Text to be displayed to your customers on your website.
        action:
          type: object
          description: Contains details about the discount applied by the promotion tier.
          properties:
            discount:
              $ref: '#/components/schemas/Discount'
        metadata:
          type: object
          description: >-
            The metadata object stores all custom attributes assigned to the
            promotion tier. A set of key/value pairs that you can attach to a
            promotion tier object. It can be useful for storing additional
            information about the promotion tier in a structured format.
        hierarchy:
          type: integer
          description: >-
            The promotions hierarchy defines the order in which the discounts
            from different tiers will be applied to a customer's order. If a
            customer qualifies for discounts from more than one tier, discounts
            will be applied in the order defined in the hierarchy.
        promotion_id:
          type: string
          description: Promotion unique ID.
        campaign:
          type: object
          description: Contains details about promotion tier's parent campaign.
          properties:
            id:
              type: string
              description: Unique campaign ID.
            start_date:
              type: string
              description: >-
                Activation timestamp defines when the campaign starts to be
                active in ISO 8601 format. Campaign is *inactive before* this
                date. 
              format: date-time
              example: '2022-09-22T00:00:00.000Z'
            expiration_date:
              type: string
              format: date-time
              description: >-
                Expiration timestamp defines when the campaign expires in ISO
                8601 format.  Campaign is *inactive after* this date.
              example: '2022-09-30T00:00:00.000Z'
            validity_timeframe:
              $ref: '#/components/schemas/ValidityTimeframe'
            validity_day_of_week:
              $ref: '#/components/schemas/ValidityDayOfWeek'
            validity_hours:
              $ref: '#/components/schemas/ValidityHours'
            active:
              type: boolean
              description: >-
                A flag indicating whether the campaign is active or not active.
                A campaign can be disabled even though it's within the active
                period defined by the `start_date` and `expiration_date` using
                the [Disable Campaign](/api-reference/disable-campaign)
                endpoint.  


                - `true` indicates an *active* campaign

                - `false` indicates an *inactive* campaign
            category_id:
              type: string
              example: cat_0b688929a2476386a6
              description: Unique category ID that this campaign belongs to.
            object:
              type: string
              description: >-
                The type of the object represented by the campaign object. This
                object stores information about the campaign.
              default: campaign
        campaign_id:
          type: string
          description: Promotion tier's parent campaign's unique ID.
        active:
          type: boolean
          description: >-
            A flag to toggle the promotion tier on or off. You can disable a
            promotion tier even though it's within the active period defined by
            the `start_date` and `expiration_date`.  


            - `true` indicates an *active* promotion tier

            - `false` indicates an *inactive* promotion tier
        start_date:
          type: string
          description: >-
            Activation timestamp defines when the promotion tier starts to be
            active in ISO 8601 format. Promotion tier is *inactive before* this
            date. 
          format: date-time
          example: '2022-09-23T00:00:00.000Z'
        expiration_date:
          type: string
          description: >-
            Activation timestamp defines when the promotion tier expires in ISO
            8601 format. Promotion tier is *inactive after* this date. 
          format: date-time
          example: '2022-09-26T00:00:00.000Z'
        validity_timeframe:
          $ref: '#/components/schemas/ValidityTimeframe'
        validity_day_of_week:
          $ref: '#/components/schemas/ValidityDayOfWeek'
        validity_hours:
          $ref: '#/components/schemas/ValidityHours'
        summary:
          type: object
          description: Contains statistics about promotion tier redemptions and orders.
          properties:
            redemptions:
              type: object
              description: Contains statistics about promotion tier redemptions.
              properties:
                total_redeemed:
                  type: integer
                  description: Number of times the promotion tier was redeemed.
            orders:
              type: object
              description: Contains statistics about orders related to the promotion tier.
              properties:
                total_amount:
                  type: integer
                  description: Sum of order totals.
                total_discount_amount:
                  type: integer
                  description: Sum of total discount applied using the promotion tier.
        object:
          type: string
          default: promotion_tier
          description: >-
            The type of the object represented by JSON. This object stores
            information about the promotion tier.
        validation_rule_assignments:
          $ref: '#/components/schemas/ValidationRuleAssignmentsList'
        category_id:
          type: string
          description: Promotion tier category ID.
          example: cat_0c9da30e7116ba6bba
        categories:
          type: array
          items:
            $ref: '#/components/schemas/Category'
    SimpleProduct:
      title: Simple Product
      type: object
      properties:
        id:
          type: string
          description: Unique product ID.
        source_id:
          type: string
          description: Product source id.
        name:
          type: string
          description: Product name.
    SimpleSku:
      title: Simple Sku
      type: object
      properties:
        id:
          type: string
          description: Unique sku ID.
        source_id:
          type: string
          description: Sku source id.
        sku:
          type: string
          description: Sku name.
    RewardType:
      title: Reward type
      oneOf:
        - $ref: '#/components/schemas/RewardTypeCampaign'
        - $ref: '#/components/schemas/RewardTypeCoin'
        - $ref: '#/components/schemas/RewardTypeMaterial'
    SimpleCustomerRequiredObjectType:
      type: object
      description: >-
        This is an object representing a customer with limited properties used
        in Event Tracking endpoints.
      title: Customer Object Required Object Type
      properties:
        id:
          type: string
          description: The unique ID of a customer that is assigned by Voucherify.
          example: cust_CSnYd37MXmrbS19XCrghjBsv
        source_id:
          type: string
          description: >-
            The merchant's customer ID if it is different from the Voucherify
            customer ID. It is really useful in case of an integration between
            multiple systems. It can be a customer ID from a CRM system,
            database or 3rd-party service.
        name:
          type: string
          description: Customer's first and last name.
        email:
          type: string
          description: Customer's email address.
        metadata:
          type: object
          description: >-
            A set of custom key/value pairs that you can attach to a customer.
            The metadata object stores all custom attributes assigned to the
            customer. It can be useful for storing additional information about
            the customer in a structured format. This metadata can be used for
            validating whether the customer qualifies for a discount or it can
            be used in building customer segments. 
        object:
          type: string
          description: >-
            The type of the object represented by the JSON. This object stores
            information about the customer.
          default: customer
      required:
        - object
    EarningRuleBase:
      title: EarningRuleBase
      type: object
      properties:
        id:
          type: string
          description: Assigned by the Voucherify API, identifies the earning rule object.
        created_at:
          type: string
          format: date-time
          description: >-
            Timestamp representing the date and time when the earning rule was
            created. The value is shown in the ISO 8601 format.
        loyalty:
          oneOf:
            - $ref: '#/components/schemas/EarningRuleFixed'
            - $ref: '#/components/schemas/EarningRuleProportional'
        event:
          description: >-
            Defines the event which triggers the earning rule to add points to a
            loyalty card.
          allOf:
            - $ref: '#/components/schemas/EarningRuleEvent'
        custom_event:
          description: Contains details about the custom event.
          type: object
          properties:
            schema_id:
              description: Unique identifier of the custom event schema
              type: string
          required:
            - schema_id
        segment:
          type: object
          description: >-
            Contains the ID of a customer segment. Required for the
            `customer.segment.entered` option in the event.
          properties:
            id:
              type: string
              description: >-
                Contains a unique identifier of a customer segment. Assigned by
                the Voucherify API.
          required:
            - id
        loyalty_tier:
          type: object
          description: Defines the tier associated with the earning rule definition.
          properties:
            id:
              type: string
              description: |-
                Unique loyalty tier ID associated with the earning rule.    

                - `__ANY__`: any loyalty tier within the campaign
              example: ltr_pudTGWasuIqxdiDM0go31OV1
        pending_points:
          type: object
          description: >-
            Defines the configuration for pending points. Pending points can be
            used only with the `order.paid` event.
          properties:
            period_type:
              type: string
              description: >-
                Defines the type of the period during which the points are in
                the pending state. Currently, only `DAY` value is accepted.
              enum:
                - DAY
            period_value:
              type: integer
              description: >-
                Defines for how long the points are in the pending state. The
                minimum value is 1, maximum is 90.
              minimum: 1
              maximum: 90
        source:
          type: object
          required:
            - object_id
            - object_type
          description: Contains the custom earning rule name and parent campaign.
          properties:
            banner:
              type: string
              description: >-
                Name of the earning rule. This is displayed as a header for the
                earning rule in the Dashboard.
            object_id:
              type: string
              description: A unique campaign identifier assigned by the Voucherify API.
            object_type:
              type: string
              description: >-
                Defines the object associated with the earning rule. Defaults to
                `campaign`.
              default: campaign
              enum:
                - campaign
        object:
          type: string
          default: earning_rule
          enum:
            - earning_rule
          description: The type of the object represented by JSON. Default is earning_rule.
        automation_id:
          type: string
          description: For internal use by Voucherify.
        start_date:
          type: string
          description: >-
            Start date defines when the earning rule starts to be active.
            Activation timestamp is presented in the ISO 8601 format. The
            earning rule is inactive before this date. If you do not define the
            start date for an earning rule, it will inherit the campaign start
            date by default.
        expiration_date:
          type: string
          description: >-
            Expiration date defines when the earning rule expires. Expiration
            timestamp is presented in the ISO 8601 format. The earning rule is
            inactive after this date. If you do not define the expiration date
            for an earning rule, it will inherit the campaign expiration date by
            default.
        validity_timeframe:
          $ref: '#/components/schemas/ValidityTimeframe'
        validity_day_of_week:
          $ref: '#/components/schemas/ValidityDayOfWeek'
        validity_hours:
          $ref: '#/components/schemas/ValidityHours'
        metadata:
          type: object
          description: >-
            The metadata object stores all custom attributes assigned to the
            earning rule. A set of key/value pairs that you can attach to an
            earning rule object. It can be useful for storing additional
            information about the earning rule in a structured format.
        expiration_rules:
          $ref: '#/components/schemas/EarningRuleExpirationRules'
      required:
        - id
        - created_at
        - loyalty
        - source
        - object
        - automation_id
        - metadata
    CustomerId:
      title: Customer Id
      type: object
      properties:
        id:
          type: string
          description: A unique identifier of an existing customer.
        object:
          type: string
          description: The type of the object represented by JSON.
          default: customer
          enum:
            - customer
      required:
        - id
        - object
    ReferrerId:
      title: Referrer Id
      allOf:
        - $ref: '#/components/schemas/CustomerId'
    OrderRedemptionsEntry:
      title: Order Redemptions
      type: object
      properties:
        date:
          type: string
          description: >-
            Timestamp representing the date and time when the redemption was
            created. The value is shown in the ISO 8601 format.
          example: '2022-09-02T17:06:56.649Z'
          format: date-time
        rollback_id:
          type: string
          description: Unique ID of the redemption rollback.
          example: rr_0c63c84eb78ee0a6c0
        rollback_date:
          type: string
          description: >-
            Timestamp representing the date and time when the redemption
            rollback was created. The value is shown in the ISO 8601 format.
          example: '2023-01-31T14:18:37.150Z'
          format: date-time
        related_object_type:
          type: string
          description: The source of the incentive.
          default: redemption
        related_object_id:
          type: string
          description: Unique ID of the parent redemption.
          example: r_0ba186c4824e4881e1
        related_object_parent_id:
          type: string
          description: >-
            Represent's the campaign ID of the voucher if the redemption was
            based on a voucher that was part of bulk codes generated within a
            campaign. In case of a promotion tier, this represents the campaign
            ID of the promotion tier's parent campaign.
        stacked:
          type: array
          description: >-
            Contains a list of unique IDs of child redemptions, which belong to
            the stacked incentives.
          items:
            type: string
        rollback_stacked:
          type: array
          description: >-
            Lists the rollback redemption IDs of the particular child
            redemptions.
          items:
            type: string
    RewardAssignment:
      title: Reward Assignment
      allOf:
        - $ref: '#/components/schemas/RewardAssignmentBase'
        - $ref: '#/components/schemas/RewardAssignmentParameters'
      type: object
    SimpleOrderItem:
      type: object
      title: Simple Order Item
      properties:
        id:
          type: string
          description: Unique identifier of the order line item.
        object:
          type: string
          default: order_item
          enum:
            - order_item
          description: >-
            The type of the object represented by JSON. This object stores
            information about the `order_item`.
        source_id:
          type: string
          description: >-
            The merchant's product/SKU ID (if it is different from the
            Voucherify product/SKU ID). It is useful in the integration between
            multiple systems. It can be an ID from an eCommerce site, a
            database, or a third-party service.
        related_object:
          type: string
          enum:
            - product
            - sku
          description: >-
            Used along with the `source_id` property, can be set to either SKU
            or product.
        product_id:
          type: string
          description: Unique identifier of the product. It is assigned by Voucherify.
        sku_id:
          type: string
          description: Unique identifier of the SKU. It is assigned by Voucherify.
        quantity:
          type: integer
          description: Quantity of the particular item in the cart.
        applied_quantity:
          type: integer
          description: >-
            Quantity of items changed by the application of a new quantity
            items. It can be positive when an item is added or negative if an
            item is replaced.
        applied_quantity_amount:
          type: integer
          description: >-
            Amount for the items changed by the application of a new quantity
            items. It can be positive when an item is added or negative if an
            item is replaced.
        discount_quantity:
          type: integer
          description: Number of discounted items.
        applied_discount_quantity:
          type: integer
          description: Number of the discounted items applied in the transaction.
        amount:
          type: integer
          description: Total amount of the order item (price * quantity).
        discount_amount:
          type: integer
          description: Sum of all order-item-level discounts applied to the order.
        applied_discount_amount:
          type: integer
          description: Order-level discount amount applied in the transaction.
        price:
          type: integer
          description: >-
            Unit price of an item. The value is multiplied by 100 to represent 2
            decimal places. For example `10000 cents` for `$100.00`.
        subtotal_amount:
          type: integer
          description: >-
            Final order item amount after the applied item-level discount.  If
            there are no item-level discounts applied, this item is equal to the
            `amount`.   

            `subtotal_amount`=`amount`-`discount_amount`
    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
    MappingPoints:
      title: MappingPoints
      type: object
      oneOf:
        - $ref: '#/components/schemas/MappingMultiply'
        - $ref: '#/components/schemas/MappingFixed'
    CampaignLoyaltyCard:
      type: object
      description: Schema model for a campaign loyalty card.
      title: Campaign Loyalty Card
      properties:
        points:
          type: integer
          description: >-
            The initial number of points to assign to the loyalty card. This is
            the current loyalty card score i.e. the number of loyalty points on
            the card.
        expiration_rules:
          type: object
          description: >-
            Defines the loyalty point expiration rule. This expiration rule
            applies when there are no `expiration_rules` defined for an earning
            rule.
          properties:
            period_type:
              type: string
              description: >-
                Type of period. Can be set for `MONTH` or `FIXED_DAY_OF_YEAR`.
                `MONTH` requires the `period_value` field. `FIXED_DAY_OF_YEAR`
                requires the `fixed_month` and `fixed_day` fields.
              enum:
                - FIXED_DAY_OF_YEAR
                - MONTH
            period_value:
              type: integer
              description: 'Value of the period. Required for the `period_type: MONTH`.'
            rounding_type:
              type: string
              description: >-
                Type of rounding of the expiration period. Optional for the
                `period_type: MONTH`.
              enum:
                - END_OF_MONTH
                - END_OF_QUARTER
                - END_OF_HALF_YEAR
                - END_OF_YEAR
                - PARTICULAR_MONTH
            rounding_value:
              type: integer
              description: >-
                Value of rounding of the expiration period. Required for the
                `rounding_type`.
            fixed_month:
              type: integer
              description: >-
                Determines the month when the points expire; `1` is January, `2`
                is February, and so on. Required for the `period_type:
                FIXED_DAY_OF_YEAR`.
              minimum: 1
              maximum: 12
            fixed_day:
              type: integer
              description: >-
                Determines the day of the month when the points expire. Required
                for the `period_type: FIXED_DAY_OF_YEAR`.
              minimum: 1
              maximum: 31
          required:
            - period_type
      required:
        - points
    CodeConfig:
      title: Code Config
      type: object
      description: >-
        Contains information about the config used for the voucher code. Defines
        the code's pattern (prefix, postfix, length, charset, etc).
      properties:
        length:
          type: number
          description: >-
            Number of characters in a generated code (excluding prefix and
            postfix).
        charset:
          type: string
          description: >-
            Characters that can appear in the code.  


            Examples:


            - Alphanumeric:
            `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` 

            - Alphabetic:
            `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` 

            - Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` 

            - Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` 

            - Numbers: `0123456789`  

            - Custom: a custom character set
        prefix:
          type: string
          description: A text appended before the code.
        postfix:
          type: string
          description: A text appended after the code.
        pattern:
          type: string
          description: >-
            A pattern for codes where hashes (#) will be replaced with random
            characters. Overrides `length`.
        initial_count:
          type: integer
          description: Internal value, does not change anything if provided.
    CustomerWithSummaryLoyaltyReferrals:
      title: Customer With Summary Loyalty Referrals
      allOf:
        - type: object
          title: Customer Response Data
          properties:
            id:
              type: string
              description: >-
                The ID of an existing customer that will be linked to redemption
                in this request.
            source_id:
              type: string
              description: >-
                A unique identifier of the customer who validates a voucher. It
                can be a customer ID or email from a CRM system, database, or a
                third-party service. If you also pass a customer ID (unique ID
                assigned by Voucherify), the source ID will be ignored.
            summary:
              nullable: true
              allOf:
                - $ref: '#/components/schemas/CustomerSummary'
            loyalty:
              nullable: true
              allOf:
                - $ref: '#/components/schemas/CustomerLoyalty'
            referrals:
              nullable: true
              allOf:
                - $ref: '#/components/schemas/CustomerReferrals'
            system_metadata:
              type: object
              description: Object used to store system metadata information.
            created_at:
              type: string
              description: >-
                Timestamp representing the date and time when the customer was
                created. The value is shown in the ISO 8601 format.
              example: '2022-08-30T06:32:07.380Z'
              format: date-time
            updated_at:
              type: string
              description: >-
                Timestamp representing the date and time when the customer was
                updated. The value is shown in the ISO 8601 format.
              example: '2022-08-31T06:32:07.380Z'
              format: date-time
            assets:
              type: object
              description: >-
                Contains information about the customer's cockpit.


                ⚠️ Warning: Customer cockpits were removed. The customer cockpit
                URLs redirect to customer preference center.
              properties:
                cockpit_url:
                  type: string
                  description: >-
                    URL address to customer preference center. Previously, a
                    customer's cockpit URL address.
                cockpit_preference_center_url:
                  type: string
                  description: URL address to customer preference center.
            object:
              type: string
              description: The type of the object represented by JSON.
              default: customer
              enum:
                - customer
          required:
            - summary
            - loyalty
            - referrals
            - object
        - $ref: '#/components/schemas/CustomerBase'
    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
    Product:
      type: object
      description: >-
        This is an object representing a product.  


        This entity should be used to map product items from your inventory
        management system. The aim of products is to build which reflect
        product-specific campaigns.
      title: Product
      allOf:
        - $ref: '#/components/schemas/ProductWithoutSkus'
        - type: object
          properties:
            skus:
              $ref: '#/components/schemas/SkusListForProduct'
    Sku:
      title: SKU Object
      type: object
      description: This is an object representing a product SKU.
      properties:
        id:
          type: string
          example: sku_0b1621b319d248b79f
          description: >-
            A unique identifier that represents the SKU and is assigned by
            Voucherify.
        source_id:
          type: string
          nullable: true
          example: sku_source_id_4
          description: A unique SKU identifier from your inventory system.
        product_id:
          type: string
          example: prod_0b15f6b9f650c16990
          description: The parent product's unique ID.
        sku:
          type: string
          nullable: true
          example: Large Pink Shirt
          description: Unique user-defined SKU name.
        price:
          type: integer
          nullable: true
          description: >-
            Unit price. It is represented by a value multiplied by 100 to
            accurately reflect 2 decimal places, such as `$100.00` being
            expressed as `10000`.
        currency:
          type: string
          nullable: true
          description: SKU price currency.
          example: USD
        attributes:
          type: object
          description: >-
            The attributes object stores values for all custom attributes
            inherited by the SKU from the parent product. A set of key/value
            pairs that are attached to a SKU object and are unique to each SKU
            within a product family.
        image_url:
          type: string
          nullable: true
          description: >-
            The HTTPS URL pointing to the .png or .jpg file that will be used to
            render the SKU image.
        metadata:
          type: object
          description: >-
            The metadata object stores all custom attributes assigned to the
            SKU. A set of key/value pairs that you can attach to a SKU object.
            It can be useful for storing additional information about the SKU in
            a structured format. It can be used to create product collections.
        created_at:
          type: string
          example: '2022-05-17T10:36:30.187Z'
          description: >-
            Timestamp representing the date and time when the SKU was created.
            The value is shown in the ISO 8601 format.
          format: date-time
        updated_at:
          type: string
          nullable: true
          example: '2022-05-17T10:55:09.137Z'
          description: >-
            Timestamp representing the date and time when the SKU was updated.
            The value is shown in the ISO 8601 format.
          format: date-time
        object:
          type: string
          default: sku
          description: >-
            The type of the object represented by JSON. This object stores
            information about the `SKU`.
          enum:
            - sku
      required:
        - id
        - source_id
        - product_id
        - sku
        - price
        - attributes
        - metadata
        - image_url
        - created_at
        - updated_at
        - object
    VoucherBase:
      title: Voucher Base
      description: This is an object representing a voucher.
      type: object
      properties:
        id:
          type: string
          example: v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV
          description: Assigned by the Voucherify API, identifies the voucher.
        code:
          type: string
          example: WVPblOYX
          description: >-
            A code that identifies a voucher. Pattern can use all letters of the
            English alphabet, Arabic numerals, and special characters.
        campaign:
          type: string
          example: Gift Card Campaign
          description: A unique campaign name, identifies the voucher's parent campaign.
        campaign_id:
          type: string
          example: camp_FNYR4jhqZBM9xTptxDGgeNBV
          description: >-
            Assigned by the Voucherify API, identifies the voucher's parent
            campaign.
        category:
          type: string
          description: >-
            Tag defining the category that this voucher belongs to. Useful when
            listing vouchers using the List Vouchers endpoint.
        category_id:
          type: string
          description: Unique category ID assigned by Voucherify.
          example: cat_0bb343dee3cdb5ec0c
        type:
          type: string
          enum:
            - GIFT_VOUCHER
            - DISCOUNT_VOUCHER
            - LOYALTY_CARD
          description: 'Defines the type of the voucher. '
        discount:
          $ref: '#/components/schemas/Discount'
        gift:
          type: object
          description: >-
            Object representing gift parameters. Child attributes are present
            only if `type` is `GIFT_VOUCHER`. Defaults to `null`.
          properties:
            amount:
              type: integer
              example: 10000
              description: >-
                Total gift card income over the lifetime of the card. The value
                is multiplied by 100 to represent 2 decimal places. For example
                `10000 cents` for `$100.00`.
            subtracted_amount:
              type: integer
              description: >-
                Total amount of subtracted credits over the gift card lifetime.
                The value is multiplied by 100 to represent 2 decimal places.
                For example `10000 cents` for `$100.00`.
            balance:
              type: integer
              example: 500
              description: >-
                Available funds. The value is multiplied by 100 to represent 2
                decimal places. For example `10000 cents` for `$100.00`.
            effect:
              type: string
              description: Defines how the credits are applied to the customer's order.
              enum:
                - APPLY_TO_ORDER
                - APPLY_TO_ITEMS
        loyalty_card:
          type: object
          description: >-
            Object representing loyalty card parameters. Child attributes are
            present only if `type` is `LOYALTY_CARD`. Defaults to `null`.
          properties:
            points:
              type: integer
              example: 7000
              description: >-
                Total number of points added to the loyalty card over its
                lifespan.
            balance:
              type: integer
              example: 6970
              description: >-
                Points available for reward redemption. This is calculated as
                follows: `balance` = `points` - `expired_points` -
                `subtracted_points` - `redemption.redeemed_points`.
            next_expiration_date:
              type: string
              format: date
              example: '2023-05-30'
              description: >-
                The next closest date when the next set of points are due to
                expire.
            next_expiration_points:
              type: integer
              description: The amount of points that are set to expire next.
            pending_points:
              type: integer
              description: >-
                Shows the number of pending points that will be added to the
                loyalty card when they are activated automatically or manually.
            expired_points:
              type: integer
              description: >-
                Shows the total number of expired points over the lifetime of
                the loyalty card.
            subtracted_points:
              type: integer
              description: >-
                Shows the total number of subtracted points over the lifetime of
                the loyalty card.
        start_date:
          type: string
          example: '2021-12-01T00:00:00.000Z'
          format: date-time
          description: >-
            Activation timestamp defines when the code starts to be active in
            ISO 8601 format. Voucher is *inactive before* this date. 
        expiration_date:
          type: string
          example: '2021-12-31T00:00:00.000Z'
          format: date-time
          description: >-
            Expiration timestamp defines when the code expires in ISO 8601
            format.  Voucher is *inactive after* this date.
        validity_timeframe:
          $ref: '#/components/schemas/ValidityTimeframe'
        validity_day_of_week:
          $ref: '#/components/schemas/ValidityDayOfWeek'
        validity_hours:
          $ref: '#/components/schemas/ValidityHours'
        active:
          type: boolean
          nullable: true
          description: >-
            A flag to toggle the voucher on or off. You can disable a voucher
            even though it's within the active period defined by the
            `start_date` and `expiration_date`.  


            - `true` indicates an *active* voucher

            - `false` indicates an *inactive* voucher
        additional_info:
          type: string
          description: >-
            An optional field to keep any extra textual information about the
            code such as a code description and details.
        metadata:
          type: object
          description: >-
            The metadata object stores all custom attributes assigned to the
            code. A set of key/value pairs that you can attach to a voucher
            object. It can be useful for storing additional information about
            the voucher in a structured format.
        assets:
          $ref: '#/components/schemas/VoucherAssets'
        is_referral_code:
          type: boolean
          nullable: true
          description: >-
            Flag indicating whether this voucher is a referral code; `true` for
            campaign type `REFERRAL_PROGRAM`.
        created_at:
          type: string
          example: '2021-12-22T10:13:06.487Z'
          description: >-
            Timestamp representing the date and time when the voucher was
            created. The value is shown in the ISO 8601 format.
          format: date-time
        updated_at:
          type: string
          example: '2021-12-22T10:14:45.316Z'
          format: date-time
          description: >-
            Timestamp representing the date and time when the voucher was last
            updated in ISO 8601 format.
        holder_id:
          type: string
          example: cust_eWgXlBBiY6THFRJwX45Iakv4
          description: >-
            Unique customer identifier of the redeemable holder. It equals to
            the customer ID assigned by Voucherify.
        referrer_id:
          type: string
          description: Unique identifier of the referring person.
          example: cust_Vzck5i8U3OhcEUFY6MKhN9Rv
        object:
          type: string
          description: The type of the object represented by JSON. Default is `voucher`.
          default: voucher
        publish:
          type: object
          description: >-
            Stores a summary of publication events: an event counter and
            endpoint to return details of each event. Publication is an
            assignment of a code to a customer, e.g. through a distribution.
          properties:
            object:
              type: string
              default: list
              description: >-
                The type of the object represented is by default `list`. To get
                this list, you need to make a call to the endpoint returned in
                the `url` attribute.
            count:
              type: integer
              example: 0
              description: Publication events counter.
            url:
              type: string
              example: /v1/vouchers/WVPblOYX/publications?page=1&limit=10
              description: >-
                The endpoint where this list of publications can be accessed
                using a **GET** method.
                `/v1/vouchers/{voucher_code}/publications`
        redemption:
          type: object
          description: >-
            Stores a summary of redemptions that have been applied to the
            voucher.
          properties:
            quantity:
              type: integer
              description: >-
                How many times a voucher can be redeemed. A `null` value means
                unlimited.
            redeemed_quantity:
              type: integer
              example: 1
              description: How many times a voucher has already been redeemed.
            redeemed_points:
              type: integer
              example: 100000
              description: Total loyalty points redeemed.
            object:
              type: string
              default: list
              description: >-
                The type of the object represented is by default `list`. To get
                this list, you need to make a call to the endpoint returned in
                the url attribute.
            url:
              type: string
              example: /v1/vouchers/WVPblOYX/redemptions?page=1&limit=10
              description: >-
                The endpoint where this list of redemptions can be accessed
                using a **GET** method.
                `/v1/vouchers/{voucher_code}/redemptions`
    ValidationRulesAssignmentsList:
      title: Validation Rules Assignments List
      description: List of Validation Rules Assignments
      type: object
      properties:
        object:
          type: string
          default: list
          enum:
            - list
          description: >-
            The type of the object represented by JSON. This object stores
            information about validation rules assignments.
        data_ref:
          type: string
          default: data
          enum:
            - data
          description: >-
            Identifies the name of the attribute that contains the array of
            validation rules assignments.
        data:
          type: array
          description: Contains array of validation rules assignments.
          items:
            $ref: '#/components/schemas/BusValRuleAssignment'
        total:
          type: integer
          minimum: 0
          description: Total number of validation rules assignments.
      required:
        - object
        - data_ref
        - data
        - total
    ValidityTimeframe:
      title: Validity Timeframe
      type: object
      description: >-
        Set recurrent time periods when the earning rule is valid. For example,
        valid for 1 hour every other day.`start_date` **required** when
        including the `validity_timeframe`.
      properties:
        duration:
          type: string
          description: >-
            Defines the amount of time an earning rule will be active in ISO
            8601 format. For example, an earning rule with a `duration` of
            `PT1H` will be valid for a duration of one hour.
          example: PT1H
        interval:
          type: string
          description: >-
            Defines the intervening time between two time points in ISO 8601
            format, expressed as a duration. For example, an earning rule with
            an `interval` of `P2D` will be valid every other day.
          example: P2D
    ValidityDayOfWeek:
      title: Validity Day Of Week
      type: array
      description: >-
        Integer array corresponding to the particular days of the week in which
        the voucher is valid.


        - `0` Sunday

        - `1` Monday

        - `2` Tuesday

        - `3` Wednesday

        - `4` Thursday

        - `5` Friday

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


                  - `0` Sunday

                  - `1` Monday

                  - `2` Tuesday

                  - `3`  Wednesday

                  - `4` Thursday

                  - `5` Friday

                  - `6` Saturday
                items:
                  type: integer
                  enum:
                    - 0
                    - 1
                    - 2
                    - 3
                    - 4
                    - 5
                    - 6
              expiration_time:
                type: string
                format: time
                description: >-
                  Defines the ending hour of validity in the HH:mm format. The
                  resource is *inactive after* this time.
                example: '14:00'
    ValidationRuleAssignmentsList:
      type: object
      description: Validation Rule Assignments List
      title: Validation Rule Assignments List
      properties:
        object:
          type: string
          description: >-
            The type of the object represented by JSON. This object stores
            information about validation rule assignments.
          default: list
        data_ref:
          type: string
          description: >-
            Identifies the name of the JSON property that contains the array of
            validation rule assignments.
          default: data
        data:
          type: array
          description: A dictionary that contains an array of validation rule assignments.
          items:
            $ref: '#/components/schemas/ValidationRuleAssignment'
        total:
          type: integer
          description: Total number of validation rule assignments.
      required:
        - object
        - data_ref
        - data
        - total
    RewardTypeCampaign:
      title: Digital
      type: object
      properties:
        campaign:
          type: object
          required:
            - id
            - type
          description: Objects stores information about the campaign related to the reward.
          properties:
            id:
              type: string
              description: Unique campaign ID, assigned by Voucherify.
            balance:
              type: integer
              description: >-
                The number of points to be added to a loyalty card or the amount
                to be added to the current balance on the gift card.


                For gift cards, the value is multiplied by 100 to precisely
                represent 2 decimal places. For example, $100 amount is written
                as 10000.
            type:
              type: string
              enum:
                - DISCOUNT_COUPONS
                - GIFT_VOUCHERS
                - LOYALTY_PROGRAM
              description: Campaign type.
      required:
        - campaign
    RewardTypeCoin:
      title: Pay with Points
      type: object
      properties:
        coin:
          type: object
          required:
            - exchange_ratio
          description: >-
            Defines the ratio by mapping the number of loyalty points in
            points_ratio to a predefined cash amount in exchange_ratio.
          properties:
            exchange_ratio:
              type: number
              description: >-
                The cash equivalent of the points defined in the points_ratio
                property.
            points_ratio:
              type: integer
              description: >-
                The number of loyalty points that will map to the predefined
                cash amount defined by the exchange_ratio property.
      required:
        - coin
    RewardTypeMaterial:
      title: Material
      type: object
      properties:
        product:
          type: object
          required:
            - id
          description: Contains information about the product given as a reward.
          properties:
            id:
              type: string
              example: prod_0b7d7dfb05cbe5c616
              description: Unique product ID, assigned by Voucherify.
            sku_id:
              type: string
              nullable: true
              example: sku_0b7d7dfb090be5c619
              description: >-
                Unique SKU ID, assigned by Voucherify, of the SKU given as a
                reward.
      required:
        - product
    EarningRuleFixed:
      title: Define fixed amount of points
      type: object
      properties:
        type:
          type: string
          default: FIXED
          enum:
            - FIXED
          description: The number of points to be added to the loyalty card.
        points:
          type: integer
          description: >-
            Defines how the points will be added to the loyalty card. FIXED adds
            a fixed number of points.
        points_formula:
          type: string
          description: Formula used to dynamically calculate the rewarded points.
      required:
        - type
        - points
    EarningRuleProportional:
      title: Calculate points proportionally
      oneOf:
        - $ref: '#/components/schemas/EarningRuleProportionalOrder'
        - $ref: '#/components/schemas/EarningRuleProportionalOrderItems'
        - $ref: '#/components/schemas/EarningRuleProportionalCustomerMetadata'
        - $ref: '#/components/schemas/EarningRuleProportionalCustomEvent'
    EarningRuleEvent:
      title: Earning Rule Event
      example: >-
        `order.paid`, `customer.segment.entered`,
        `customer.loyalty.tier.upgraded`, `customer.loyalty.tier.downgraded`,
        `customer.loyalty.tier.prolonged`, `customer.loyalty.tier.joined`,
        `customer.loyalty.tier.left`
      type: string
    EarningRuleExpirationRules:
      title: Earning Rule Expiration Rules
      type: object
      description: >-
        Defines the loyalty point expiration rule. This expiration rule applies
        only to this earning rule and supersedes `expiration_rules` defined in
        the `voucher.loyalty_card` object.
      properties:
        period_type:
          type: string
          description: >-
            Type of period. Can be set for `MONTH` or `FIXED_DAY_OF_YEAR`.
            `MONTH` requires the `period_value` field. `FIXED_DAY_OF_YEAR`
            requires the `fixed_month` and `fixed_day` fields.
          enum:
            - FIXED_DAY_OF_YEAR
            - MONTH
        period_value:
          type: integer
          description: 'Value of the period. Required for the `period_type: MONTH`.'
        rounding_type:
          type: string
          description: >-
            Type of rounding of the expiration period. Optional for the
            `period_type: MONTH`.
          enum:
            - END_OF_MONTH
            - END_OF_QUARTER
            - END_OF_HALF_YEAR
            - END_OF_YEAR
            - PARTICULAR_MONTH
        rounding_value:
          type: integer
          description: >-
            Value of rounding of the expiration period. Required for the
            `rounding_type`.
        fixed_month:
          type: integer
          description: >-
            Determines the month when the points expire; `1` is January, `2` is
            February, and so on. Required for the `period_type:
            FIXED_DAY_OF_YEAR`.
          minimum: 1
          maximum: 12
        fixed_day:
          type: integer
          description: >-
            Determines the day of the month when the points expire. Required for
            the `period_type: FIXED_DAY_OF_YEAR`.
          minimum: 1
          maximum: 31
      required:
        - period_type
    RewardAssignmentBase:
      title: Reward Assignment Base
      type: object
      properties:
        id:
          type: string
          example: rewa_PbIRoMXpwe5QhobW4JKu0VjH
          description: Unique reward assignment ID, assigned by Voucherify.
        reward_id:
          type: string
          description: Associated reward ID.
          example: rew_C7wS9eHFDN4CIbXI5PpLSkGY
        created_at:
          type: string
          description: >-
            Timestamp representing the date and time when the reward assignment
            was created. The value is shown in the ISO 8601 format.
          example: '2022-08-11T14:49:22.586Z'
          format: date-time
        updated_at:
          type: string
          nullable: true
          description: >-
            Timestamp representing the date and time when the reward assignment
            was updated. The value is shown in the ISO 8601 format.
          example: '2022-08-11T16:01:34.885Z'
          format: date-time
        object:
          type: string
          description: >-
            The type of the object represented by the JSON. This object stores
            information about the reward assignment.
          default: reward_assignment
          enum:
            - reward_assignment
        related_object_id:
          type: string
          description: Related object ID to which the reward was assigned.
          example: camp_wciTvaOfYmAa3EmIIW3QpXXZ
        related_object_type:
          type: string
          description: Related object type to which the reward was assigned.
          default: campaign
          enum:
            - campaign
      required:
        - related_object_id
        - related_object_type
        - id
        - reward_id
        - created_at
        - updated_at
        - object
    RewardAssignmentParameters:
      title: Digital or Material Reward - Parameters
      type: object
      properties:
        parameters:
          description: Defines the cost of the reward.
          type: object
          properties:
            loyalty:
              type: object
              description: Defines the equivalent points value of the reward.
              properties:
                points:
                  type: integer
                  description: The number of points required to redeem the reward.
                auto_redeem:
                  type: boolean
                  nullable: true
                  description: >-
                    Determines if the reward is redeemed automatically when the
                    customer reaches the sufficient number of points to redeem
                    it. Value `true` means that the automatic reward redemption
                    is active. Only one reward can be set to be redeemed
                    automatically in a loyalty campaign, i.e. only one can have
                    the value `true`.
          required:
            - loyalty
    MappingMultiply:
      title: MappingMultiply
      type: object
      properties:
        type:
          type: string
          default: MULTIPLY
          enum:
            - MULTIPLY
          description: Type of calculation.
        multiplier:
          type: number
          description: >-
            Multiplication factor used to multiply the points to obtain the
            mapped points.
    MappingFixed:
      title: MappingFixed
      type: object
      properties:
        type:
          type: string
          default: CUSTOM
          enum:
            - CUSTOM
          description: Type of calculation.
        points:
          type: integer
          description: Fixed number of points to be applied.
    CustomerSummary:
      title: Customer Summary
      type: object
      properties:
        redemptions:
          $ref: '#/components/schemas/CustomerSummaryRedemptions'
        orders:
          $ref: '#/components/schemas/CustomerSummaryOrders'
      required:
        - redemptions
        - orders
    CustomerLoyalty:
      title: Customer Loyalty
      type: object
      properties:
        points:
          type: integer
          description: >-
            Customer's loyalty points minus expired for all loyalty cards which
            the customer has.
        referred_customers:
          type: integer
          description: Total number of customers referred by the customer.
        campaigns:
          type: object
          description: >-
            Contains campaigns with details about point balances and how many
            customers were referred by the customer.
          additionalProperties:
            type: object
            description: >-
              Contains details about the point balances left on loyalty cards
              and the number of referred customers in each campaign.
            properties:
              points:
                type: integer
                description: Remaining point balance in campaign.
              loyalty_tier:
                type: string
                example: ltr_UJ5Q54Q0OvEhua87Qfv2Ki5x
                description: Customer's loyalty tier within the campaign.
              referred_customers:
                type: integer
                description: Number of customers referred by the customer in campaign.
      required:
        - points
        - referred_customers
        - campaigns
    CustomerReferrals:
      title: Customer Referrals
      type: object
      description: >-
        Summary of customer's referrals, in this case, the customer being the
        referee, i.e. information about the source of referrals and number of
        times the customer was referred by other customers.
      properties:
        total:
          type: integer
          description: >-
            Total number of times this customer received a referral, i.e. was
            referred by another customer.
        campaigns:
          type: array
          description: >-
            Contains an array of campaigns that served as the source of a
            referral for the customer.
          items:
            title: Customer Referrals Campaigns Item
            type: object
            description: Contains information about the source of the referral.
            properties:
              campaign_id:
                type: string
                description: Unique campaign ID, assigned by Voucherify.
                example: camp_rRsfatlwN7unSeUIJDCYedal
              referrer_id:
                type: string
                example: cust_sehkNIi8Uq2qQuRqSr7xn4Zi
                description: >-
                  Unique referrer ID, assigned by Voucherify. This is the
                  customer ID of a customer that is referring this customer.
              related_object_id:
                type: string
                description: Related object id
                example: r_0b9d4cc4aa164dd073
              related_object_type:
                type: string
                description: Related object type, i.e. `redemption`.
              date:
                type: string
                format: date-time
                example: '2022-08-30T10:19:39.196Z'
                description: >-
                  Timestamp representing the date and time when the customer was
                  referred in ISO 8601 format.
            required:
              - campaign_id
              - referrer_id
              - related_object_id
              - related_object_type
              - date
      required:
        - total
        - campaigns
    CustomerBase:
      title: Customer Base
      type: object
      properties:
        name:
          type: string
          description: Customer's first and last name.
        description:
          type: string
          description: An arbitrary string that you can attach to a customer object.
        email:
          type: string
          description: Customer's email address.
        phone:
          type: string
          description: >-
            Customer's phone number. This parameter is mandatory when you try to
            send out codes to customers via an SMS channel.
        birthday:
          type: string
          description: '`Deprecated`. ~~Customer''s birthdate; format YYYY-MM-DD~~.'
          format: date
        birthdate:
          type: string
          description: Customer's birthdate; format YYYY-MM-DD.
          format: date
        address:
          type: object
          nullable: true
          description: Customer's address.
          properties:
            city:
              type: string
              description: City
            state:
              type: string
              description: State
            line_1:
              type: string
              description: First line of address.
            line_2:
              type: string
              description: Second line of address.
            country:
              type: string
              description: Country.
            postal_code:
              type: string
              description: Postal code.
        metadata:
          type: object
          description: >-
            A set of custom key/value pairs that you can attach to a customer.
            The metadata object stores all custom attributes assigned to the
            customer. It can be useful for storing additional information about
            the customer in a structured format. This metadata can be used for
            validating whether the customer qualifies for a discount or it can
            be used in building customer segments.
    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
    ProductWithoutSkus:
      title: Product without Skus Object
      properties:
        id:
          type: string
          description: Unique product ID assigned by Voucherify.
          example: prod_0b1da8105693710357
        source_id:
          type: string
          nullable: true
          example: productSourceID16
          description: Unique product source ID.
        name:
          type: string
          nullable: true
          description: Unique user-defined product name.
          example: T-shirt
        price:
          type: integer
          nullable: true
          description: >-
            Unit price. It is represented by a value multiplied by 100 to
            accurately reflect 2 decimal places, such as `$100.00` being
            expressed as `10000`.
        attributes:
          type: array
          description: >-
            A list of product attributes whose values you can customize for
            given SKUs: `["color","size","ranking"]`. Each child SKU can have a
            unique value for a given attribute.
          items:
            type: string
        metadata:
          type: object
          description: >-
            The metadata object stores all custom attributes assigned to the
            product. A set of key/value pairs that you can attach to a product
            object. It can be useful for storing additional information about
            the product in a structured format. It can be used to create product
            collections.
        image_url:
          type: string
          nullable: true
          description: >-
            The HTTPS URL pointing to the .png or .jpg file that will be used to
            render the product image.
          example: https://images.com/original.jpg
        created_at:
          type: string
          description: >-
            Timestamp representing the date and time when the product was
            created. The value is shown in the ISO 8601 format.
          example: '2022-05-23T06:52:55.008Z'
          format: date-time
        updated_at:
          type: string
          nullable: true
          description: >-
            Timestamp representing the date and time when the product was
            updated. The value is shown in the ISO 8601 format.
          example: '2022-05-23T09:24:07.405Z'
          format: date-time
        object:
          type: string
          description: >-
            The type of the object represented by JSON. This object stores
            information about the product.
          default: product
          enum:
            - product
      required:
        - id
        - source_id
        - name
        - attributes
        - metadata
        - object
        - price
    SkusListForProduct:
      type: object
      description: Contains information about child SKUs.
      title: Skus List For Product
      properties:
        object:
          type: string
          description: >-
            The type of the object represented by JSON. This object stores
            information about SKUs.
          default: list
        data_ref:
          type: string
          description: >-
            Identifies the name of the JSON property that contains the array of
            SKUs.
          default: data
        data:
          type: array
          description: A dictionary that contains an array of SKUs.
          items:
            $ref: '#/components/schemas/Sku'
        total:
          type: integer
          description: Total number of SKUs in the product.
      required:
        - object
        - data_ref
        - data
        - total
    VoucherAssets:
      title: Voucher Assets
      type: object
      description: >-
        Stores links to images of QR and barcode that correspond to an encrypted
        voucher code.
      properties:
        qr:
          type: object
          description: Stores Quick Response (QR) representation of encrypted code.
          properties:
            id:
              type: string
              example: >-
                U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK+t4pp7U7oFzjGJzj9q/bmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg+BaZk5QwXMf8k/OzSlOEVybpwSq+AiqPoNtjeuqtIgkDyvT6Q==
              description: Encrypted voucher code ID.
            url:
              type: string
              example: >-
                https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK%2Bt4pp7U7oFzjGJzj9q%2FbmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg%2BBaZk5QwXMf8k%2FOzSlOEVybpwSq%2BAiqPoNtjeuqtIgkDyvT6Q%3D%3D
              description: >-
                URL to QR code  


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


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

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


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


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

                - `format`: string, either `png` (default) or `svg`
    BusValRuleAssignment:
      title: Business Validation Rule Assignment
      description: Assignments of business validation rule
      example:
        id: asgm_LnY1g7UNFA9KyDrD
        rule_id: val_3gPNA6SnH4ae
        related_object_id: camp_CZOnEGiZfwIKWmSjhIoIT7Ol
        related_object_type: campaign
        object: validation_rules_assignment
        validation_status: PARTIALLY_VALID
        validation_omitted_rules:
          - '1'
      properties:
        id:
          type: string
          description: The unique identifier for a assignment
        rule_id:
          type: string
          description: The unique identifier for a rule
        related_object_id:
          type: string
          description: The unique identifier for a related object
        related_object_type:
          type: string
          description: The type of related object
        created_at:
          type: string
          description: >-
            Timestamp representing the date and time when the object was
            created. The value is shown in the ISO 8601 format.
          example: '2022-03-09T11:19:04.819Z'
          format: date-time
        updated_at:
          type: string
          description: >-
            Timestamp representing the date and time when the object was last
            updated in ISO 8601 format.
          example: '2022-03-09T11:19:04.819Z'
          format: date-time
        object:
          type: string
          description: The type of the object represented by JSON.
          default: validation_rules_assignment
          enum:
            - validation_rules_assignment
        validation_status:
          type: string
          description: The validation status of the assignment
          enum:
            - VALID
            - PARTIALLY_VALID
            - INVALID
        validation_omitted_rules:
          type: array
          description: The list of omitted rules
          items:
            type: string
      required:
        - id
        - rule_id
        - related_object_id
        - related_object_type
        - object
    ValidationRuleAssignment:
      title: Validation Rule Assignment
      type: object
      description: This is an object representing a validation rule assignment.
      properties:
        id:
          type: string
          example: asgm_74F7QZoYbUoljwQO
          description: Validation rule assignment ID.
        rule_id:
          type: string
          example: val_4j7DCRm2IS59
          description: Validation rule ID.
        related_object_id:
          type: string
          example: v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT
          description: The resource ID to which the validation rule was assigned.
        related_object_type:
          type: string
          description: The type of resource to which the validation rule was assigned.
          enum:
            - voucher
            - campaign
            - earning_rule
            - reward_assignment
            - promotion_tier
            - distribution
        created_at:
          type: string
          example: '2022-02-17T08:18:15.085Z'
          description: >-
            Timestamp representing the date and time when the validation rule
            assignment was created. The value is shown in the ISO 8601 format.
          format: date-time
        object:
          type: string
          default: validation_rules_assignment
          description: The type of the object represented by the ID.
          enum:
            - validation_rules_assignment
      required:
        - id
        - rule_id
        - related_object_id
        - related_object_type
        - created_at
        - object
    EarningRuleProportionalOrder:
      title: Define amount of points proportional to the order
      oneOf:
        - $ref: '#/components/schemas/EarningRuleProportionalOrderAmount'
        - $ref: '#/components/schemas/EarningRuleProportionalOrderTotalAmount'
        - $ref: '#/components/schemas/EarningRuleProportionalOrderMetadata'
    EarningRuleProportionalOrderItems:
      title: Define amount of points proportional to order items
      oneOf:
        - $ref: '#/components/schemas/EarningRuleProportionalOrderItemsQuantity'
        - $ref: '#/components/schemas/EarningRuleProportionalOrderItemsAmount'
        - $ref: '#/components/schemas/EarningRuleProportionalOrderItemsSubtotalAmount'
    EarningRuleProportionalCustomerMetadata:
      title: Define amount of points proportional to customer metadata
      type: object
      properties:
        type:
          type: string
          default: PROPORTIONAL
          enum:
            - PROPORTIONAL
          description: >-
            Defines how the points will be added to the loyalty
            card.PROPORTIONAL adds points based on a pre-defined ratio.
        calculation_type:
          type: string
          default: CUSTOMER_METADATA
          enum:
            - CUSTOMER_METADATA
          description: >-
            CUSTOMER_METADATA: Customer Metadata (X points for every Y in
            metadata attribute, defined in the property key under the
            customer.metadata object)
        customer:
          type: object
          required:
            - metadata
          properties:
            metadata:
              type: object
              required:
                - every
                - points
                - property
              description: >-
                Defines the ratio based on the property defined in the
                calculation_type parameter. For every given increment of value
                (1, 10, etc) defined in the every parameter for the property
                defined in calculation_type, give the customer the number of
                points defined in the points parameter. In other words, for
                every order metadata property value, give points.
              properties:
                every:
                  type: integer
                  description: >-
                    For how many increments of the customer metadata property to
                    grant points for.
                points:
                  type: integer
                  description: >-
                    Number of points to be awarded, i.e. how many points to be
                    added to the loyalty card.
                points_formula:
                  type: string
                  description: Formula used to dynamically calculate the rewarded points.
                property:
                  type: string
                  description: Customer metadata property.
      required:
        - type
        - calculation_type
        - customer
    EarningRuleProportionalCustomEvent:
      title: Earning Rule Proportional Custom Event
      type: object
      properties:
        type:
          type: string
          default: PROPORTIONAL
          enum:
            - PROPORTIONAL
          description: >-
            Defines how the points will be added to the loyalty
            card.PROPORTIONAL adds points based on a pre-defined ratio.
        calculation_type:
          type: string
          default: CUSTOM_EVENT_METADATA
          enum:
            - CUSTOM_EVENT_METADATA
          description: >-
            CUSTOM_EVENT_METADATA: Custom event metadata (X points for every Y
            in metadata attribute).
        custom_event:
          type: object
          required:
            - metadata
          properties:
            metadata:
              type: object
              required:
                - every
                - points
                - property
              description: >-
                Defines the ratio based on the property defined in the
                calculation_type parameter. For every given increment of value
                (1, 10, etc) defined in the every parameter for the property
                defined in calculation_type, give the customer the number of
                points defined in the points parameter. In other words, for
                every order metadata property value, give points.
              properties:
                every:
                  type: integer
                  description: >-
                    For how many increments of the customer metadata property to
                    grant points for.
                points:
                  type: integer
                  description: >-
                    Number of points to be awarded, i.e. how many points to be
                    added to the loyalty card.
                points_formula:
                  type: string
                  description: Formula used to dynamically calculate the rewarded points.
                property:
                  type: string
                  description: |-

                    Custom event metadata property.
      required:
        - type
        - calculation_type
        - custom_event
    CustomerSummaryRedemptions:
      title: Customer Summary Redemptions
      type: object
      properties:
        total_redeemed:
          type: integer
          description: Total number of redemptions made by the customer.
        total_failed:
          type: integer
          description: Total number of redemptions that failed.
        total_succeeded:
          type: integer
          description: Total number of redemptions that succeeded.
        total_rolled_back:
          type: integer
          description: Total number of redemptions that were rolled back for the customer.
        total_rollback_failed:
          type: integer
          description: Total number of redemption rollbacks that failed.
        total_rollback_succeeded:
          type: integer
          description: Total number of redemption rollbacks that succeeded.
        gift:
          type: object
          description: Summary of gift card credits.
          required:
            - redeemed_amount
            - amount_to_go
          properties:
            redeemed_amount:
              type: integer
              description: >-
                Total amount of gift card credits redeemed by customer. The
                value is multiplied by 100 to represent 2 decimal places. For
                example `10000 cents` for `$100.00`.
              default: 0
            amount_to_go:
              type: integer
              description: >-
                Remaining gift card balance across all gift cards. The value is
                multiplied by 100 to represent 2 decimal places. For example
                `10000 cents` for `$100.00`.
              default: 0
        loyalty_card:
          type: object
          description: Summary of loyalty points.
          required:
            - redeemed_points
            - points_to_go
          properties:
            redeemed_points:
              type: integer
              description: Total number of loyalty points redeemed by the customer.
            points_to_go:
              type: integer
              description: >-
                Sum of remaining available point balance across all loyalty
                cards.
      required:
        - total_redeemed
        - total_failed
        - total_succeeded
        - total_rolled_back
        - total_rollback_failed
        - total_rollback_succeeded
        - gift
        - loyalty_card
    CustomerSummaryOrders:
      title: Customer Summary Orders
      description: >-
        Lists details about orders related to the customer. Lists only data for
        orders with the `PAID` or `FULFILLED` status. Data from orders with a
        `CREATED` or `CANCELED` status are not included. The data is updated
        also when an order changes status.
      type: object
      properties:
        total_amount:
          type: integer
          description: >-
            The total amount spent by the customer. The value is multiplied by
            100 to represent 2 decimal places. For example `10000 cents` for
            `$100.00`.
        total_count:
          type: integer
          description: Total number of orders made by the customer.
        average_amount:
          type: integer
          description: >-
            Average amount spent on orders. `total_amount` &divide;
            `total_count`. The value is multiplied by 100 to represent 2 decimal
            places. For example `10000 cents` for `$100.00`.
        last_order_amount:
          type: integer
          description: >-
            Amount spent on last order. The value is multiplied by 100 to
            represent 2 decimal places. For example `10000 cents` for `$100.00`.
        last_order_date:
          type: string
          format: date-time
          example: '2022-08-30T11:51:08.029Z'
          description: >-
            Timestamp representing the date and time of the customer's last
            order in ISO 8601 format.
      required:
        - total_amount
        - total_count
        - average_amount
        - last_order_amount
    EarningRuleProportionalOrderAmount:
      title: Order Amount
      type: object
      properties:
        type:
          type: string
          default: PROPORTIONAL
          enum:
            - PROPORTIONAL
          description: >-
            Defines how the points will be added to the loyalty
            card.PROPORTIONAL adds points based on a pre-defined ratio.
        calculation_type:
          type: string
          default: ORDER_AMOUNT
          enum:
            - ORDER_AMOUNT
          description: >-
            `ORDER_AMOUNT`: Pre-discount order amount (X points for every Y
            spent excluding discounts)
        order:
          type: object
          required:
            - amount
          properties:
            amount:
              type: object
              required:
                - every
                - points
              description: >-
                Defines the ratio based on the property defined in the
                calculation_type parameter. For every set of value (1, 10, etc)
                defined in the every parameter for the property defined in
                calculation_type, give the customer the number of points defined
                in the points parameter. In other words, for every
                calculation_type, give points.
              properties:
                every:
                  type: integer
                  description: >-
                    Value is multiplied by 100 to precisely represent 2 decimal
                    places. For example, a $10 order amount is written as 1000.
                points:
                  type: integer
                  description: >-
                    Number of points to be awarded, i.e. how many points to be
                    added to the loyalty card.
                points_formula:
                  type: string
                  description: Formula used to dynamically calculate the rewarded points.
      required:
        - type
        - calculation_type
        - order
    EarningRuleProportionalOrderTotalAmount:
      title: Order Total Amount
      type: object
      properties:
        type:
          type: string
          default: PROPORTIONAL
          enum:
            - PROPORTIONAL
          description: >-
            Defines how the points will be added to the loyalty
            card.PROPORTIONAL adds points based on a pre-defined ratio.
        calculation_type:
          type: string
          default: ORDER_TOTAL_AMOUNT
          enum:
            - ORDER_TOTAL_AMOUNT
          description: >-
            `ORDER_TOTAL_AMOUNT`: Total order amount (X points for every Y spent
            including discount)
        order:
          type: object
          required:
            - total_amount
          properties:
            total_amount:
              type: object
              required:
                - every
                - points
              description: >-
                Defines the ratio based on the property defined in the
                calculation_type parameter. For every set of value (1, 10, etc)
                defined in the every parameter for the property defined in
                calculation_type, give the customer the number of points defined
                in the points parameter. In other words, for every
                calculation_type, give points.
              properties:
                every:
                  type: integer
                  description: >-
                    Value is multiplied by 100 to precisely represent 2 decimal
                    places. For example, a $10 order amount is written as 1000.
                points:
                  type: integer
                  description: >-
                    Number of points to be awarded, i.e. how many points to be
                    added to the loyalty card.
                points_formula:
                  type: string
                  description: Formula used to dynamically calculate the rewarded points.
      required:
        - type
        - calculation_type
        - order
    EarningRuleProportionalOrderMetadata:
      title: Order Metadata
      type: object
      properties:
        type:
          type: string
          default: PROPORTIONAL
          enum:
            - PROPORTIONAL
          description: >-
            Defines how the points will be added to the loyalty
            card.PROPORTIONAL adds points based on a pre-defined ratio.
        calculation_type:
          type: string
          default: ORDER_METADATA
          enum:
            - ORDER_METADATA
          description: >-
            `ORDER_METADATA`: Order Metadata (X points for every Y in metadata
            attribute, defined in the property key under the order.metadata
            object)
        order:
          type: object
          required:
            - metadata
          description: Defines the formula for calculating points proportionally.
          properties:
            metadata:
              type: object
              required:
                - every
                - points
                - property
              description: >-
                Defines the ratio based on the property defined in the
                calculation_type parameter. For every given increment of value
                (1, 10, etc) defined in the every parameter for the property
                defined in calculation_type, give the customer the number of
                points defined in the points parameter. In other words, for
                every order metadata property value, give points.
              properties:
                every:
                  type: integer
                  description: >-
                    For how many increments of the order metadata property to
                    grant points for.
                points:
                  type: integer
                  description: >-
                    Number of points to be awarded, i.e. how many points to be
                    added to the loyalty card.
                points_formula:
                  type: string
                  description: Formula used to dynamically calculate the rewarded points.
                property:
                  type: string
                  description: Order metadata property.
      required:
        - type
        - calculation_type
        - order
    EarningRuleProportionalOrderItemsQuantity:
      title: Order Items Quantity
      type: object
      properties:
        type:
          type: string
          default: PROPORTIONAL
          enum:
            - PROPORTIONAL
          description: >-
            Defines how the points will be added to the loyalty
            card.PROPORTIONAL adds points based on a pre-defined ratio.
        calculation_type:
          type: string
          default: ORDER_ITEMS_QUANTITY
          enum:
            - ORDER_ITEMS_QUANTITY
          description: >-
            `ORDER_ITEMS_QUANTITY`: Quantity of items defined in the
            `order_items.quantity.applicable_to` array or
            `order_items.quantity.object` & `.id` (X points for every Y items
            excluding free items).
        order_items:
          type: object
          required:
            - quantity
          properties:
            quantity:
              type: object
              required:
                - every
                - points
              description: >-
                Defines the ratio based on the property defined in the
                calculation_type parameter. For every set of value (1, 10, etc)
                defined in the every parameter for the property defined in
                calculation_type, give the customer the number of points defined
                in the points parameter. In other words, for every
                calculation_type, give points.
              properties:
                every:
                  type: integer
                  description: >-
                    Value is multiplied by 100 to precisely represent 2 decimal
                    places. For example, a $10 order amount is written as 1000.
                points:
                  type: integer
                  description: >-
                    Number of points to be awarded, i.e. how many points to be
                    added to the loyalty card.
                points_formula:
                  type: string
                  description: Formula used to dynamically calculate the rewarded points.
                object:
                  type: string
                  description: >-
                    Type of object which will be covered by the earning rule.
                    This is required together with `id`. Can be replaced by the
                    `applicable_to` array. In response, the value of the first
                    object is returned even if `applicable_to` array was used.
                  enum:
                    - products_collection
                    - product
                    - sku
                id:
                  type: string
                  description: >-
                    Unique ID of the resource assigned by Voucherify. This is
                    required together with `object`. Can be replaced by the
                    `applicable_to` array. In response, the value of the first
                    object is returned even if `applicable_to` array was used.
                    Values are, for example, `pc_75U0dHlr7u75BJodrW1AE3t6` for
                    product collection, `prod_0bae32322150fd0546` for a product,
                    or `sku_0b7d7dfb090be5c619` for a SKU.
                applicable_to:
                  type: array
                  description: >-
                    Defines products, SKUs, or product collections covered by
                    the earning rule. Can be replaced by `object` and `id` to
                    define only one object.
                  items:
                    type: object
                    properties:
                      object:
                        type: string
                        description: >-
                          Type of object which will be covered by the earning
                          rule.
                        enum:
                          - products_collection
                          - product
                          - sku
                      id:
                        type: string
                        description: >-
                          Unique ID of the resource assigned by Voucherify.
                          Values are, for example, `pc_75U0dHlr7u75BJodrW1AE3t6`
                          for product collection, `prod_0bae32322150fd0546` for
                          a product, or `sku_0b7d7dfb090be5c619` for a SKU.
      required:
        - type
        - calculation_type
        - order_items
    EarningRuleProportionalOrderItemsAmount:
      title: Order Items Amount
      type: object
      properties:
        type:
          type: string
          default: PROPORTIONAL
          enum:
            - PROPORTIONAL
          description: >-
            Defines how the points will be added to the loyalty
            card.PROPORTIONAL adds points based on a pre-defined ratio.
        calculation_type:
          type: string
          default: ORDER_ITEMS_AMOUNT
          enum:
            - ORDER_ITEMS_AMOUNT
          description: >-
            ORDER_ITEMS_AMOUNT; Pre-discount amount spent on items defined in
            the `order_items.quantity.applicable_to` array or
            `order_items.quantity.object` & `.id` (X points for every Y spent on
            items excluding discounts)
        order_items:
          type: object
          required:
            - amount
          properties:
            amount:
              type: object
              required:
                - every
                - points
              description: >-
                Defines the ratio based on the property defined in the
                calculation_type parameter. For every set of value (1, 10, etc)
                defined in the every parameter for the property defined in
                calculation_type, give the customer the number of points defined
                in the points parameter. In other words, for every
                calculation_type, give points.
              properties:
                every:
                  type: integer
                  description: >-
                    Value is multiplied by 100 to precisely represent 2 decimal
                    places. For example, a $10 order amount is written as 1000.
                points:
                  type: integer
                  description: >-
                    Number of points to be awarded, i.e. how many points to be
                    added to the loyalty card.
                points_formula:
                  type: string
                  description: Formula used to dynamically calculate the rewarded points.
                object:
                  type: string
                  description: >-
                    Type of object which will be covered by the earning rule.
                    This is required together with `id`. Can be replaced by the
                    `applicable_to` array. In response, the value of the first
                    object is returned even if `applicable_to` array was used.
                  enum:
                    - products_collection
                    - product
                    - sku
                id:
                  type: string
                  description: >-
                    Unique ID of the resource assigned by Voucherify. This is
                    required together with `object`. Can be replaced by the
                    `applicable_to` array. In response, the value of the first
                    object is returned even if `applicable_to` array was used.
                    Values are, for example, `pc_75U0dHlr7u75BJodrW1AE3t6` for
                    product collection, `prod_0bae32322150fd0546` for a product,
                    or `sku_0b7d7dfb090be5c619` for a SKU.
                applicable_to:
                  type: array
                  description: >-
                    Defines products, SKUs, or product collections covered by
                    the earning rule. Can be replaced by `object` and `id` to
                    define only one object.
                  items:
                    type: object
                    properties:
                      object:
                        type: string
                        description: >-
                          Type of object which will be covered by the earning
                          rule.
                        enum:
                          - products_collection
                          - product
                          - sku
                      id:
                        type: string
                        description: >-
                          Unique ID of the resource assigned by Voucherify.
                          Values are, for example, `pc_75U0dHlr7u75BJodrW1AE3t6`
                          for product collection, `prod_0bae32322150fd0546` for
                          a product, or `sku_0b7d7dfb090be5c619` for a SKU.
      required:
        - type
        - calculation_type
        - order_items
    EarningRuleProportionalOrderItemsSubtotalAmount:
      title: Order Items Subtotal Amount
      type: object
      properties:
        type:
          type: string
          default: PROPORTIONAL
          enum:
            - PROPORTIONAL
          description: >-
            Defines how the points will be added to the loyalty
            card.PROPORTIONAL adds points based on a pre-defined ratio.
        calculation_type:
          type: string
          default: ORDER_ITEMS_SUBTOTAL_AMOUNT
          enum:
            - ORDER_ITEMS_SUBTOTAL_AMOUNT
          description: >-
            ORDER_ITEMS_SUBTOTAL_AMOUNT; Amount spent on items defined in the
            order_items.subtotal_amount.object & .id (X points for every Y spent
            on items including discounts)
        order_items:
          type: object
          required:
            - subtotal_amount
          properties:
            subtotal_amount:
              type: object
              required:
                - every
                - points
              description: >-
                Defines the ratio based on the property defined in the
                calculation_type parameter. For every set of value (1, 10, etc)
                defined in the every parameter for the property defined in
                calculation_type, give the customer the number of points defined
                in the points parameter. In other words, for every
                calculation_type, give points.
              properties:
                every:
                  type: integer
                  description: >-
                    Value is multiplied by 100 to precisely represent 2 decimal
                    places. For example, a $10 order amount is written as 1000.
                points:
                  type: integer
                  description: >-
                    Number of points to be awarded, i.e. how many points to be
                    added to the loyalty card.
                points_formula:
                  type: string
                  description: Formula used to dynamically calculate the rewarded points.
                object:
                  type: string
                  description: >-
                    Type of object which will be covered by the earning rule.
                    This is required together with `id`. Can be replaced by the
                    `applicable_to` array. In response, the value of the first
                    object is returned even if `applicable_to` array was used.
                  enum:
                    - products_collection
                    - product
                    - sku
                id:
                  type: string
                  description: >-
                    Unique ID of the resource assigned by Voucherify. This is
                    required together with `object`. Can be replaced by the
                    `applicable_to` array. In response, the value of the first
                    object is returned even if `applicable_to` array was used.
                    Values are, for example, `pc_75U0dHlr7u75BJodrW1AE3t6` for
                    product collection, `prod_0bae32322150fd0546` for a product,
                    or `sku_0b7d7dfb090be5c619` for a SKU.
                applicable_to:
                  type: array
                  description: >-
                    Defines products, SKUs, or product collections covered by
                    the earning rule. Can be replaced by `object` and `id` to
                    define only one object.
                  items:
                    type: object
                    properties:
                      object:
                        type: string
                        description: >-
                          Type of object which will be covered by the earning
                          rule.
                        enum:
                          - products_collection
                          - product
                          - sku
                      id:
                        type: string
                        description: >-
                          Unique ID of the resource assigned by Voucherify.
                          Values are, for example, `pc_75U0dHlr7u75BJodrW1AE3t6`
                          for product collection, `prod_0bae32322150fd0546` for
                          a product, or `sku_0b7d7dfb090be5c619` for a SKU.
      required:
        - type
        - calculation_type
        - order_items
  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`.

````