> ## Documentation Index
> Fetch the complete documentation index at: https://voucherify-rc-lv2-guides.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List benefit activities

> 
<Warning>

<Badge color="yellow">BETA endpoint</Badge>

This is a work-in-progress documentation of a BETA endpoint. The parameters, fields, request and response bodies, and other data may be subject to change. If you want to share feedback or improvements, contact [Voucherify support](https://www.voucherify.io/contact-support) or your Technical Account Manager.

</Warning>

Returns a cursor-paginated list of activities recorded for the benefit (created, updated,
deleted, activated, drafted). Returns 404 when the benefit does not exist. Supports
filtering by activity `id`, `type`, and `created_at`, ordering by `created_at`
(default `-created_at`), and cursor-based pagination.



## OpenAPI

````yaml /openapi/loyalties-v2.json get /v2/loyalties/benefits/{benefitId}/activities
openapi: 3.1.0
info:
  title: Voucherify Loyalty v2 API
  version: 2.0.0
  description: >-
    Complete OpenAPI specification for the Voucherify Loyalty v2 API.

    All endpoints require the LOYALTY_V2 feature flag.


    Combined from per-domain specs: programs.yaml, members.yaml,
    program-operations.yaml, card-definitions.yaml, earning-rules.yaml,
    tier-structures.yaml, benefits.yaml, rewards.yaml, examine.yaml
servers:
  - url: '{protocol}://{host}'
    variables:
      protocol:
        default: https
        enum:
          - https
          - http
      host:
        default: api.voucherify.io
security:
  - X-App-Id: []
    X-App-Token: []
  - bearerAuth: []
tags:
  - name: Programs
    description: >-
      Loyalty program CRUD, lifecycle management, program-scoped resource
      assignments (card definitions, earning rules, rewards, tier structures),
      member management (create, list, get, activate, deactivate, delete),
      membership retrieval (member + program + cards with tier progress, by
      customer ID, customer source ID, or member ID), card operations (points
      adjustment, pending points, expiring points, transactions), reward
      purchases, and activity history.
  - name: Card Definitions
    description: >-
      CRUD operations, lifecycle management, and activity history for card
      definitions. Card definitions describe the configuration for loyalty
      cards, including code generation, points expiration, earning/spending
      limits, pending points, refunds, and balance settings.
  - name: Earning Rules
    description: >-
      Manage earning rules that define how customers earn points or receive
      incentives based on triggers (events, segments, custom events). Includes
      CRUD, lifecycle, and activity history.
  - name: Tier Structures
    description: >-
      CRUD operations, lifecycle management, and activity history for tier
      structures. Includes nested tier definitions (create, list, update,
      delete) within tier structures. Tier structures define the tiering model
      for loyalty programs — how members qualify for and move between tiers.
  - name: Benefits
    description: >-
      Manage benefit definitions (fixed points, proportional points, material,
      digital). Includes CRUD, lifecycle transitions, and activity history.
  - name: Rewards
    description: >-
      CRUD, lifecycle operations, and activity history for reward definitions.
      Rewards can be material (product/SKU) or digital (discount coupons, gift
      vouchers).
  - name: Examine
    description: >-
      Evaluation endpoints that estimate earning opportunities and reward
      availability for a customer across their loyalty program memberships,
      without side effects.
paths:
  /v2/loyalties/benefits/{benefitId}/activities:
    get:
      tags:
        - Benefits
      summary: List benefit activities
      description: >-

        <Warning>


        <Badge color="yellow">BETA endpoint</Badge>


        This is a work-in-progress documentation of a BETA endpoint. The
        parameters, fields, request and response bodies, and other data may be
        subject to change. If you want to share feedback or improvements,
        contact [Voucherify support](https://www.voucherify.io/contact-support)
        or your Technical Account Manager.


        </Warning>


        Returns a cursor-paginated list of activities recorded for the benefit
        (created, updated,

        deleted, activated, drafted). Returns 404 when the benefit does not
        exist. Supports

        filtering by activity `id`, `type`, and `created_at`, ordering by
        `created_at`

        (default `-created_at`), and cursor-based pagination.
      operationId: listBenefitActivities
      parameters:
        - name: id
          in: path
          required: true
          description: Unique benefit ID, prefixed with `lben_`.
          schema:
            type: string
            pattern: ^lben_[a-f0-9]+$
        - name: limit
          in: query
          required: false
          description: >-
            Maximum number of activities to return. An integer between 1 and
            100.

            Defaults to 10 when omitted.
          schema:
            type:
              - integer
              - 'null'
            minimum: 1
            maximum: 100
            default: 10
        - name: order
          in: query
          required: false
          description: >-
            Ordering of the results. Defaults to `-created_at`. The same field
            cannot be used in

            both ascending and descending order at once.
          schema:
            oneOf:
              - type: array
                items:
                  type: string
                  enum:
                    - created_at
                    - '-created_at'
              - type: string
                enum:
                  - created_at
                  - '-created_at'
              - type: 'null'
        - name: cursor
          in: query
          required: false
          description: >-
            Pagination cursor returned in the `cursor.next` field of a previous
            response.
          schema:
            type:
              - string
              - 'null'
            pattern: ^lcrsaben_[a-f0-9]+$
        - name: filters
          in: query
          required: false
          style: deepObject
          explode: true
          description: >-
            Field-specific filter conditions, e.g.
            `filters[type][conditions][$is]=vl.benefit.created`.

            Conditions of multiple fields are combined with the `junction`.
          schema:
            $ref: '#/components/schemas/BenefitActivityListFilters'
      responses:
        '200':
          description: Cursor-paginated list of benefit activities
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BenefitActivityListResponse'
        '400':
          description: >-
            Validation error - request body or query parameters failed
            validation, or the operation is not allowed in the current resource
            state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict - e.g. duplicate resource or invalid state transition.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    BenefitActivityListFilters:
      type: object
      description: >-
        Filters for the benefit activities list. Each field accepts a
        `conditions` object with

        at least one condition. Conditions of multiple fields are combined with
        the `junction`.
      properties:
        junction:
          description: How conditions of multiple fields are combined. Defaults to `AND`.
          oneOf:
            - type: string
              enum:
                - AND
                - OR
            - type: 'null'
        id:
          description: >-
            Filter by activity ID.

            Allowed conditions: `$is`, `$is_not`, `$in`, `$not_in`. Values must
            match `^laben_[a-f0-9]+$`.

            `$is`/`$is_not` accept a single value (string or 1-element array);
            `$in`/`$not_in`

            accept up to 100 values.
          oneOf:
            - $ref: '#/components/schemas/BenefitActivityIdFilterConditions'
            - type: 'null'
        type:
          description: >-
            Filter by activity type.

            Allowed conditions: `$is`, `$is_not`, `$in`, `$not_in`. Allowed
            values:

            `vl.benefit.created`, `vl.benefit.updated`, `vl.benefit.deleted`,

            `vl.benefit.activated`, `vl.benefit.drafted`.
          oneOf:
            - $ref: '#/components/schemas/BenefitActivityTypeFilterConditions'
            - type: 'null'
        created_at:
          description: >-
            Filter by activity creation date.

            Allowed conditions: `$before`, `$after` (ISO 8601 date-time
            strings), `$is`,

            `$more_than`, `$less_than` (non-negative integers, number of days),
            `$has_value`,

            `$is_unknown` (presence checks).
          oneOf:
            - $ref: '#/components/schemas/BenefitDateFilterConditions'
            - type: 'null'
      additionalProperties: false
    BenefitActivityListResponse:
      type: object
      description: Cursor-paginated list of benefit activities.
      properties:
        data:
          type: array
          description: Activities matching the query, in the requested order.
          items:
            $ref: '#/components/schemas/BenefitActivity'
        cursor:
          description: Pagination cursor. Null when there are no more results.
          oneOf:
            - $ref: '#/components/schemas/BenefitListCursor'
            - type: 'null'
        object:
          type: string
          const: list
          description: Type of the object. Always `list`.
      required:
        - data
        - cursor
        - object
    ErrorResponse:
      type: object
      description: Standard error response returned by all Loyalty v2 endpoints.
      properties:
        code:
          type: integer
          description: HTTP status code of the error.
        key:
          type: string
          description: Machine-readable error key.
        message:
          type: string
          description: Human-readable error message.
        details:
          type: string
          description: Additional details about the error.
        request_id:
          type: string
          description: Unique identifier of the request that produced the error.
        resource_id:
          type: string
          description: Unique identifier of the resource that produced the error.
        resource_type:
          type: string
          description: Type of the resource that produced the error.
    BenefitActivityIdFilterConditions:
      type: object
      description: >-
        ID filter conditions for benefit activity IDs. At least one condition is
        required.
      properties:
        conditions:
          type: object
          minProperties: 1
          additionalProperties: false
          properties:
            $is:
              description: Matches the exact activity ID. Single value.
              oneOf:
                - type: string
                  pattern: ^laben_[a-f0-9]+$
                - type: array
                  minItems: 1
                  maxItems: 1
                  items:
                    type: string
                    pattern: ^laben_[a-f0-9]+$
                - type: 'null'
            $is_not:
              description: Excludes the exact activity ID. Single value.
              oneOf:
                - type: string
                  pattern: ^laben_[a-f0-9]+$
                - type: array
                  minItems: 1
                  maxItems: 1
                  items:
                    type: string
                    pattern: ^laben_[a-f0-9]+$
                - type: 'null'
            $in:
              description: Matches any of the given activity IDs. Up to 100 values.
              oneOf:
                - type: string
                  pattern: ^laben_[a-f0-9]+$
                - type: array
                  minItems: 1
                  maxItems: 100
                  items:
                    type: string
                    pattern: ^laben_[a-f0-9]+$
                - type: 'null'
            $not_in:
              description: Excludes all of the given activity IDs. Up to 100 values.
              oneOf:
                - type: string
                  pattern: ^laben_[a-f0-9]+$
                - type: array
                  minItems: 1
                  maxItems: 100
                  items:
                    type: string
                    pattern: ^laben_[a-f0-9]+$
                - type: 'null'
      required:
        - conditions
      additionalProperties: false
    BenefitActivityTypeFilterConditions:
      type: object
      description: >-
        Enum filter conditions for benefit activity type. At least one condition
        is required.
      properties:
        conditions:
          type: object
          minProperties: 1
          additionalProperties: false
          properties:
            $is:
              description: Matches the exact activity type. Single value.
              oneOf:
                - type: string
                  enum:
                    - vl.benefit.created
                    - vl.benefit.updated
                    - vl.benefit.deleted
                    - vl.benefit.activated
                    - vl.benefit.drafted
                - type: array
                  minItems: 1
                  maxItems: 1
                  items:
                    type: string
                    enum:
                      - vl.benefit.created
                      - vl.benefit.updated
                      - vl.benefit.deleted
                      - vl.benefit.activated
                      - vl.benefit.drafted
                - type: 'null'
            $is_not:
              description: Excludes the exact activity type. Single value.
              oneOf:
                - type: string
                  enum:
                    - vl.benefit.created
                    - vl.benefit.updated
                    - vl.benefit.deleted
                    - vl.benefit.activated
                    - vl.benefit.drafted
                - type: array
                  minItems: 1
                  maxItems: 1
                  items:
                    type: string
                    enum:
                      - vl.benefit.created
                      - vl.benefit.updated
                      - vl.benefit.deleted
                      - vl.benefit.activated
                      - vl.benefit.drafted
                - type: 'null'
            $in:
              description: Matches any of the given activity types. Up to 10 values.
              oneOf:
                - type: string
                  enum:
                    - vl.benefit.created
                    - vl.benefit.updated
                    - vl.benefit.deleted
                    - vl.benefit.activated
                    - vl.benefit.drafted
                - type: array
                  minItems: 1
                  maxItems: 10
                  items:
                    type: string
                    enum:
                      - vl.benefit.created
                      - vl.benefit.updated
                      - vl.benefit.deleted
                      - vl.benefit.activated
                      - vl.benefit.drafted
                - type: 'null'
            $not_in:
              description: Excludes all of the given activity types. Up to 10 values.
              oneOf:
                - type: string
                  enum:
                    - vl.benefit.created
                    - vl.benefit.updated
                    - vl.benefit.deleted
                    - vl.benefit.activated
                    - vl.benefit.drafted
                - type: array
                  minItems: 1
                  maxItems: 10
                  items:
                    type: string
                    enum:
                      - vl.benefit.created
                      - vl.benefit.updated
                      - vl.benefit.deleted
                      - vl.benefit.activated
                      - vl.benefit.drafted
                - type: 'null'
      required:
        - conditions
      additionalProperties: false
    BenefitDateFilterConditions:
      type: object
      description: Date filter conditions. At least one condition is required.
      properties:
        conditions:
          type: object
          minProperties: 1
          additionalProperties: false
          properties:
            $before:
              description: >-
                Matches records created before the given date. ISO 8601
                date-time string, single value.
              oneOf:
                - type: string
                  format: date-time
                - type: array
                  items:
                    type: string
                    format: date-time
                  minItems: 1
                  maxItems: 1
                - type: 'null'
            $after:
              description: >-
                Matches records created after the given date. ISO 8601 date-time
                string, single value.
              oneOf:
                - type: string
                  format: date-time
                - type: array
                  items:
                    type: string
                    format: date-time
                  minItems: 1
                  maxItems: 1
                - type: 'null'
            $is:
              description: >-
                Matches records created exactly the given number of days ago.
                Non-negative integer, single value.
              oneOf:
                - type: string
                - type: array
                  items:
                    type: string
                  minItems: 1
                  maxItems: 1
                - type: 'null'
            $more_than:
              description: >-
                Matches records created more than the given number of days ago.
                Non-negative integer, single value.
              oneOf:
                - type: string
                - type: array
                  items:
                    type: string
                  minItems: 1
                  maxItems: 1
                - type: 'null'
            $less_than:
              description: >-
                Matches records created less than the given number of days ago.
                Non-negative integer, single value.
              oneOf:
                - type: string
                - type: array
                  items:
                    type: string
                  minItems: 1
                  maxItems: 1
                - type: 'null'
            $has_value:
              description: >-
                Matches records where the field has a value. The condition value
                itself is ignored.
              oneOf:
                - type: string
                - type: array
                  maxItems: 1
                - type: 'null'
            $is_unknown:
              description: >-
                Matches records where the field has no value. The condition
                value itself is ignored.
              oneOf:
                - type: string
                - type: array
                  maxItems: 1
                - type: 'null'
      required:
        - conditions
      additionalProperties: false
    BenefitActivity:
      type: object
      description: A single benefit activity.
      properties:
        id:
          type: string
          pattern: ^laben_[a-f0-9]+$
          description: Unique activity ID, prefixed with `laben_`.
        type:
          type: string
          enum:
            - vl.benefit.created
            - vl.benefit.updated
            - vl.benefit.deleted
            - vl.benefit.activated
            - vl.benefit.drafted
          description: Type of the recorded activity.
        data:
          $ref: '#/components/schemas/BenefitActivityData'
        created_at:
          type: string
          format: date-time
          description: Timestamp of when the activity was recorded, in ISO 8601 format.
        group_id:
          type: string
          description: ID grouping activities recorded within the same operation.
        source:
          description: Origin of the activity. Omitted when unknown.
          oneOf:
            - $ref: '#/components/schemas/BenefitActivitySource'
        benefit_id:
          type: string
          pattern: ^lben_[a-f0-9]+$
          description: ID of the benefit the activity relates to.
      required:
        - id
        - type
        - data
        - created_at
        - benefit_id
    BenefitListCursor:
      type: object
      description: Pagination cursor pointing to the next page of results.
      properties:
        next:
          type: string
          description: >-
            Cursor ID to pass as the `cursor` query parameter to fetch the next
            page.
        expires_at:
          type: string
          format: date-time
          description: Timestamp after which the cursor expires.
      required:
        - next
    BenefitActivityData:
      type: object
      description: >-
        Activity payload containing a snapshot of the benefit at the time of the
        activity.
      properties:
        benefit:
          $ref: '#/components/schemas/Benefit'
      required:
        - benefit
    BenefitActivitySource:
      type: object
      description: Origin of the activity.
      properties:
        channel:
          type: string
          description: Channel the activity originated from.
          enum:
            - USER_PORTAL
            - API
            - CLIENT_API
            - INTERNAL
        user:
          description: >-
            User who triggered the activity. Present for user-originated
            activities.
          oneOf:
            - $ref: '#/components/schemas/BenefitActivitySourceUser'
        api_key:
          description: >-
            API key used to trigger the activity. Present for API-originated
            activities.
          oneOf:
            - $ref: '#/components/schemas/BenefitActivitySourceApiKey'
    Benefit:
      type: object
      description: >-
        A benefit object. Exactly one type-specific configuration object

        (`points`, `points_proportional`, `material`, or `digital`) is present,
        matching the `type`;

        the others are omitted.
      properties:
        id:
          type: string
          pattern: ^lben_[a-f0-9]+$
          description: Unique benefit ID, prefixed with `lben_`.
        name:
          type: string
          description: Benefit name, unique within the project.
        type:
          type: string
          enum:
            - POINTS
            - POINTS_PROPORTIONAL
            - MATERIAL
            - DIGITAL
          description: Benefit type.
        status:
          type: string
          enum:
            - DRAFT
            - ACTIVE
            - DELETED
          description: >-
            Current benefit status. `DELETED` appears only in the response of
            the delete endpoint and in activity snapshots.
        stock:
          description: Stock configuration. Omitted when not set.
          oneOf:
            - $ref: '#/components/schemas/BenefitStock'
        points:
          description: Fixed points configuration. Present only when `type` is `POINTS`.
          oneOf:
            - $ref: '#/components/schemas/BenefitPoints'
        points_proportional:
          description: >-
            Proportional points configuration. Present only when `type` is
            `POINTS_PROPORTIONAL`.
          oneOf:
            - $ref: '#/components/schemas/BenefitPointsProportional'
        material:
          description: Material configuration. Present only when `type` is `MATERIAL`.
          oneOf:
            - $ref: '#/components/schemas/BenefitMaterial'
        digital:
          description: Digital configuration. Present only when `type` is `DIGITAL`.
          oneOf:
            - $ref: '#/components/schemas/BenefitDigital'
        created_at:
          type: string
          format: date-time
          description: Timestamp of when the benefit was created, in ISO 8601 format.
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Timestamp of the last update, in ISO 8601 format. Null when the
            benefit was never updated.
        object:
          type: string
          const: benefit
          description: Type of the object. Always `benefit`.
      required:
        - id
        - name
        - type
        - status
        - created_at
        - object
    BenefitActivitySourceUser:
      type: object
      description: User who triggered the activity.
      properties:
        id:
          type: string
          description: User ID.
    BenefitActivitySourceApiKey:
      type: object
      description: API key used to trigger the activity.
      properties:
        name:
          type: string
          description: Name of the API key.
        app_id:
          type: string
          description: Application ID of the API key.
        client_app_id:
          type: string
          description: Client application ID (for client-side API keys).
    BenefitStock:
      type: object
      description: >-
        Stock configuration of the benefit. When `type` is `LIMITED` the
        `limited` object is

        required; when `type` is `UNLIMITED` the `limited` object must be
        omitted or `null`.
      properties:
        type:
          type: string
          enum:
            - UNLIMITED
            - LIMITED
          description: Whether the benefit has unlimited or limited stock.
        limited:
          description: >-
            Limited stock configuration. Required when `type` is `LIMITED`, must
            be null otherwise.
          oneOf:
            - $ref: '#/components/schemas/BenefitStockLimited'
            - type: 'null'
      required:
        - type
      additionalProperties: false
      allOf:
        - if:
            properties:
              type:
                const: UNLIMITED
          then:
            properties:
              limited:
                type: 'null'
        - if:
            properties:
              type:
                const: LIMITED
          then:
            required:
              - limited
            properties:
              limited:
                $ref: '#/components/schemas/BenefitStockLimited'
    BenefitPoints:
      type: object
      description: >-
        Fixed points effect - adds a fixed amount of points to a card of the
        given card definition.
      properties:
        value:
          type: integer
          minimum: 0
          maximum: 9007199254740991
          description: Number of points to add.
        card_definition_id:
          type: string
          pattern: ^lcdef_[a-f0-9]+$
          description: >-
            ID of the card definition whose cards receive the points. The card
            definition must exist and be ACTIVE.
      required:
        - value
        - card_definition_id
      additionalProperties: false
    BenefitPointsProportional:
      type: object
      description: >-
        Proportional points effect - points are calculated from an order amount,
        order items,

        or a metadata property. Exactly one calculation source object (`order`,
        `customer`,

        `custom_event`, or `order_items`) is required, determined by
        `calculation_type`;

        the remaining source properties must be omitted or `null`.
      properties:
        calculation_type:
          type: string
          enum:
            - PRE_DISCOUNT_ORDER_AMOUNT
            - POST_DISCOUNT_ORDER_AMOUNT
            - PRE_DISCOUNT_ORDER_ITEMS_AMOUNT
            - POST_DISCOUNT_ORDER_ITEMS_AMOUNT
            - ORDER_ITEMS_QUANTITY
            - ORDER_METADATA_VALUE
            - CUSTOMER_METADATA_VALUE
            - CUSTOM_EVENT_METADATA_VALUE
          description: >-
            How the points are calculated:

            - `PRE_DISCOUNT_ORDER_AMOUNT` - points per every specified order
            amount before discounts (requires `order.amount`)

            - `POST_DISCOUNT_ORDER_AMOUNT` - points per every specified order
            amount after discounts (requires `order.total_amount`)

            - `PRE_DISCOUNT_ORDER_ITEMS_AMOUNT` - points per every specified
            amount spent on selected products before discounts (requires
            `order_items.amount`)

            - `POST_DISCOUNT_ORDER_ITEMS_AMOUNT` - points per every specified
            amount spent on selected products after discounts (requires
            `order_items.subtotal_amount`)

            - `ORDER_ITEMS_QUANTITY` - points per every specified quantity of
            selected products, excluding free items (requires
            `order_items.quantity`)

            - `ORDER_METADATA_VALUE` - points per every specified value in the
            order metadata (requires `order.metadata`)

            - `CUSTOMER_METADATA_VALUE` - points per every specified value in
            the customer metadata (requires `customer.metadata`)

            - `CUSTOM_EVENT_METADATA_VALUE` - points per every specified value
            in the custom event metadata (requires `custom_event.metadata`)
        card_definition_id:
          type: string
          pattern: ^lcdef_[a-f0-9]+$
          description: >-
            ID of the card definition whose cards receive the points. The card
            definition must exist and be ACTIVE.
        order:
          description: >-
            Order-based calculation configuration (for
            `PRE_DISCOUNT_ORDER_AMOUNT`, `POST_DISCOUNT_ORDER_AMOUNT`,
            `ORDER_METADATA_VALUE`).
          oneOf:
            - $ref: '#/components/schemas/BenefitPointsProportionalOrder'
            - type: 'null'
        customer:
          description: >-
            Customer-metadata-based calculation configuration (for
            `CUSTOMER_METADATA_VALUE`).
          oneOf:
            - $ref: '#/components/schemas/BenefitPointsProportionalCustomer'
            - type: 'null'
        custom_event:
          description: >-
            Custom-event-metadata-based calculation configuration (for
            `CUSTOM_EVENT_METADATA_VALUE`).
          oneOf:
            - $ref: '#/components/schemas/BenefitPointsProportionalCustomEvent'
            - type: 'null'
        order_items:
          description: >-
            Order-items-based calculation configuration (for
            `PRE_DISCOUNT_ORDER_ITEMS_AMOUNT`,
            `POST_DISCOUNT_ORDER_ITEMS_AMOUNT`, `ORDER_ITEMS_QUANTITY`).
          oneOf:
            - $ref: '#/components/schemas/BenefitPointsProportionalOrderItems'
            - type: 'null'
      required:
        - calculation_type
        - card_definition_id
      additionalProperties: false
      allOf:
        - if:
            properties:
              calculation_type:
                const: PRE_DISCOUNT_ORDER_AMOUNT
          then:
            required:
              - order
            properties:
              order:
                type: object
                required:
                  - amount
              customer:
                type: 'null'
              custom_event:
                type: 'null'
              order_items:
                type: 'null'
        - if:
            properties:
              calculation_type:
                const: POST_DISCOUNT_ORDER_AMOUNT
          then:
            required:
              - order
            properties:
              order:
                type: object
                required:
                  - total_amount
              customer:
                type: 'null'
              custom_event:
                type: 'null'
              order_items:
                type: 'null'
        - if:
            properties:
              calculation_type:
                const: ORDER_METADATA_VALUE
          then:
            required:
              - order
            properties:
              order:
                type: object
                required:
                  - metadata
              customer:
                type: 'null'
              custom_event:
                type: 'null'
              order_items:
                type: 'null'
        - if:
            properties:
              calculation_type:
                const: CUSTOMER_METADATA_VALUE
          then:
            required:
              - customer
            properties:
              customer:
                $ref: '#/components/schemas/BenefitPointsProportionalCustomer'
              order:
                type: 'null'
              custom_event:
                type: 'null'
              order_items:
                type: 'null'
        - if:
            properties:
              calculation_type:
                const: CUSTOM_EVENT_METADATA_VALUE
          then:
            required:
              - custom_event
            properties:
              custom_event:
                $ref: '#/components/schemas/BenefitPointsProportionalCustomEvent'
              order:
                type: 'null'
              customer:
                type: 'null'
              order_items:
                type: 'null'
        - if:
            properties:
              calculation_type:
                const: PRE_DISCOUNT_ORDER_ITEMS_AMOUNT
          then:
            required:
              - order_items
            properties:
              order_items:
                type: object
                required:
                  - amount
              order:
                type: 'null'
              customer:
                type: 'null'
              custom_event:
                type: 'null'
        - if:
            properties:
              calculation_type:
                const: POST_DISCOUNT_ORDER_ITEMS_AMOUNT
          then:
            required:
              - order_items
            properties:
              order_items:
                type: object
                required:
                  - subtotal_amount
              order:
                type: 'null'
              customer:
                type: 'null'
              custom_event:
                type: 'null'
        - if:
            properties:
              calculation_type:
                const: ORDER_ITEMS_QUANTITY
          then:
            required:
              - order_items
            properties:
              order_items:
                type: object
                required:
                  - quantity
              order:
                type: 'null'
              customer:
                type: 'null'
              custom_event:
                type: 'null'
    BenefitMaterial:
      type: object
      description: >-
        Material benefit - a physical product or SKU. Exactly one of `product`
        or `sku` is

        required, matching the `type`; the other must be omitted or `null`.
      properties:
        type:
          type: string
          enum:
            - PRODUCT
            - SKU
          description: Whether the benefit is a whole product or a specific SKU.
        product:
          description: >-
            Product reference. Required when `type` is `PRODUCT`, must be null
            otherwise. The product must exist.
          oneOf:
            - $ref: '#/components/schemas/BenefitMaterialProduct'
            - type: 'null'
        sku:
          description: >-
            SKU reference. Required when `type` is `SKU`, must be null
            otherwise. The SKU must exist under the given product.
          oneOf:
            - $ref: '#/components/schemas/BenefitMaterialSKU'
            - type: 'null'
      additionalProperties: false
      allOf:
        - required:
            - type
        - if:
            properties:
              type:
                const: PRODUCT
          then:
            required:
              - product
            properties:
              product:
                $ref: '#/components/schemas/BenefitMaterialProduct'
              sku:
                type: 'null'
        - if:
            properties:
              type:
                const: SKU
          then:
            required:
              - sku
            properties:
              sku:
                $ref: '#/components/schemas/BenefitMaterialSKU'
              product:
                type: 'null'
    BenefitDigital:
      type: object
      description: >-
        Digital benefit - a reward sourced from a Voucherify campaign. Exactly
        one of

        `gift_vouchers` or `discount_coupons` is required, matching the `type`;
        the other must

        be omitted or `null`. The referenced campaign must exist and its
        campaign type must match

        the benefit's digital type.
      properties:
        type:
          type: string
          enum:
            - GIFT_VOUCHERS
            - DISCOUNT_COUPONS
          description: Type of the digital reward.
        gift_vouchers:
          description: >-
            Gift vouchers configuration. Required when `type` is
            `GIFT_VOUCHERS`, must be null otherwise.
          oneOf:
            - $ref: '#/components/schemas/BenefitDigitalGiftVouchers'
            - type: 'null'
        discount_coupons:
          description: >-
            Discount coupons configuration. Required when `type` is
            `DISCOUNT_COUPONS`, must be null otherwise.
          oneOf:
            - $ref: '#/components/schemas/BenefitDigitalDiscountCoupons'
            - type: 'null'
      additionalProperties: false
      allOf:
        - required:
            - type
        - if:
            properties:
              type:
                const: DISCOUNT_COUPONS
          then:
            required:
              - discount_coupons
            properties:
              discount_coupons:
                $ref: '#/components/schemas/BenefitDigitalDiscountCoupons'
              gift_vouchers:
                type: 'null'
        - if:
            properties:
              type:
                const: GIFT_VOUCHERS
          then:
            required:
              - gift_vouchers
            properties:
              gift_vouchers:
                $ref: '#/components/schemas/BenefitDigitalGiftVouchers'
              discount_coupons:
                type: 'null'
    BenefitStockLimited:
      type: object
      description: Limited stock configuration.
      properties:
        quantity:
          type: integer
          minimum: 0
          maximum: 9007199254740991
          description: Remaining stock quantity.
      required:
        - quantity
      additionalProperties: false
    BenefitPointsProportionalOrder:
      type: object
      description: >-
        Order-based proportional calculation. Provide the property matching the
        `calculation_type`.
      properties:
        amount:
          description: >-
            Points per every specified pre-discount order amount (for
            `PRE_DISCOUNT_ORDER_AMOUNT`).
          oneOf:
            - $ref: '#/components/schemas/BenefitPointsProportionalEvery'
        total_amount:
          description: >-
            Points per every specified post-discount order amount (for
            `POST_DISCOUNT_ORDER_AMOUNT`).
          oneOf:
            - $ref: '#/components/schemas/BenefitPointsProportionalEvery'
        metadata:
          description: >-
            Points per every specified value of an order metadata property (for
            `ORDER_METADATA_VALUE`).
          oneOf:
            - $ref: '#/components/schemas/BenefitPointsProportionalMetadata'
      additionalProperties: false
    BenefitPointsProportionalCustomer:
      type: object
      description: Customer-metadata-based proportional calculation.
      properties:
        metadata:
          description: Points per every specified value of a customer metadata property.
          oneOf:
            - $ref: '#/components/schemas/BenefitPointsProportionalMetadata'
      required:
        - metadata
      additionalProperties: false
    BenefitPointsProportionalCustomEvent:
      type: object
      description: Custom-event-metadata-based proportional calculation.
      properties:
        metadata:
          description: >-
            Points per every specified value of a custom event metadata
            property.
          oneOf:
            - $ref: '#/components/schemas/BenefitPointsProportionalMetadata'
      required:
        - metadata
      additionalProperties: false
    BenefitPointsProportionalOrderItems:
      type: object
      description: >-
        Order-items-based proportional calculation. Provide the property
        matching the `calculation_type`.
      properties:
        amount:
          description: >-
            Points per every specified pre-discount amount spent on the selected
            items (for `PRE_DISCOUNT_ORDER_ITEMS_AMOUNT`).
          oneOf:
            - $ref: >-
                #/components/schemas/BenefitPointsProportionalOrderItemsCalculation
        subtotal_amount:
          description: >-
            Points per every specified post-discount amount spent on the
            selected items (for `POST_DISCOUNT_ORDER_ITEMS_AMOUNT`).
          oneOf:
            - $ref: >-
                #/components/schemas/BenefitPointsProportionalOrderItemsCalculation
        quantity:
          description: >-
            Points per every specified quantity of the selected items, excluding
            free items (for `ORDER_ITEMS_QUANTITY`).
          oneOf:
            - $ref: >-
                #/components/schemas/BenefitPointsProportionalOrderItemsCalculation
      additionalProperties: false
    BenefitMaterialProduct:
      type: object
      description: Product reference for a material benefit.
      properties:
        id:
          type: string
          pattern: ^prod_[a-f0-9]+
          description: Product ID, prefixed with `prod_`.
      required:
        - id
      additionalProperties: false
    BenefitMaterialSKU:
      type: object
      description: SKU reference for a material benefit.
      properties:
        product_id:
          type: string
          pattern: ^prod_[a-f0-9]+
          description: ID of the product the SKU belongs to, prefixed with `prod_`.
        id:
          type: string
          pattern: ^sku_[a-f0-9]+
          description: SKU ID, prefixed with `sku_`.
      required:
        - product_id
        - id
      additionalProperties: false
    BenefitDigitalGiftVouchers:
      type: object
      description: Gift vouchers digital benefit configuration.
      properties:
        campaign_id:
          type: string
          pattern: ^camp_[a-zA-Z0-9]+
          description: >-
            ID of the GIFT_VOUCHERS campaign the vouchers are sourced from,
            prefixed with `camp_`.
        balance:
          type: number
          minimum: 0
          maximum: 9007199254740991
          description: Balance loaded onto the gift voucher.
      required:
        - campaign_id
        - balance
      additionalProperties: false
    BenefitDigitalDiscountCoupons:
      type: object
      description: Discount coupons digital benefit configuration.
      properties:
        campaign_id:
          type: string
          pattern: ^camp_[a-zA-Z0-9]+
          description: >-
            ID of the DISCOUNT_COUPONS campaign the coupons are sourced from,
            prefixed with `camp_`.
      required:
        - campaign_id
      additionalProperties: false
    BenefitPointsProportionalEvery:
      type: object
      description: Ratio definition - `value` points for every `every` units.
      properties:
        every:
          type: integer
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Unit step (e.g. order amount in cents) for which `value` points are
            granted.
        value:
          type: number
          minimum: 0
          maximum: 9007199254740991
          description: Number of points granted per `every` units.
      required:
        - every
        - value
      additionalProperties: false
    BenefitPointsProportionalMetadata:
      type: object
      description: >-
        Metadata-based ratio definition - `value` points for every `every` units
        of the metadata property.
      properties:
        every:
          type: integer
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Unit step of the metadata property value for which `value` points
            are granted.
        value:
          type: number
          minimum: 0
          maximum: 9007199254740991
          description: Number of points granted per `every` units.
        property:
          type: string
          minLength: 1
          description: Name of the metadata property used for the calculation.
      required:
        - every
        - value
        - property
      additionalProperties: false
    BenefitPointsProportionalOrderItemsCalculation:
      type: object
      description: >-
        Order-items ratio definition with the list of applicable
        products/SKUs/collections.
      properties:
        every:
          type: integer
          minimum: 1
          maximum: 9007199254740991
          description: Unit step (amount or quantity) for which `value` points are granted.
        value:
          type: number
          minimum: 0
          maximum: 9007199254740991
          description: Number of points granted per `every` units.
        applicable_to:
          type: array
          minItems: 1
          description: Products, SKUs, or product collections the calculation applies to.
          items:
            $ref: '#/components/schemas/BenefitPointsProportionalApplicableTo'
      required:
        - every
        - value
        - applicable_to
      additionalProperties: false
    BenefitPointsProportionalApplicableTo:
      type: object
      description: >-
        A single applicability rule. Exactly one of `product`, `sku`, or
        `products_collection`

        is required, matching the `type`; the other two must be omitted or
        `null`.
      properties:
        type:
          type: string
          enum:
            - product
            - sku
            - products_collection
          description: Type of the referenced object.
        product:
          description: >-
            Product reference. Required when `type` is `product`, must be null
            otherwise.
          oneOf:
            - $ref: >-
                #/components/schemas/BenefitPointsProportionalApplicableToProduct
            - type: 'null'
        sku:
          description: >-
            SKU reference. Required when `type` is `sku`, must be null
            otherwise.
          oneOf:
            - $ref: '#/components/schemas/BenefitPointsProportionalApplicableToSku'
            - type: 'null'
        products_collection:
          description: >-
            Products collection reference. Required when `type` is
            `products_collection`, must be null otherwise.
          oneOf:
            - $ref: >-
                #/components/schemas/BenefitPointsProportionalApplicableToProductsCollection
            - type: 'null'
      required:
        - type
      additionalProperties: false
      allOf:
        - if:
            properties:
              type:
                const: product
          then:
            required:
              - product
            properties:
              product:
                $ref: >-
                  #/components/schemas/BenefitPointsProportionalApplicableToProduct
              sku:
                type: 'null'
              products_collection:
                type: 'null'
        - if:
            properties:
              type:
                const: sku
          then:
            required:
              - sku
            properties:
              sku:
                $ref: '#/components/schemas/BenefitPointsProportionalApplicableToSku'
              product:
                type: 'null'
              products_collection:
                type: 'null'
        - if:
            properties:
              type:
                const: products_collection
          then:
            required:
              - products_collection
            properties:
              products_collection:
                $ref: >-
                  #/components/schemas/BenefitPointsProportionalApplicableToProductsCollection
              product:
                type: 'null'
              sku:
                type: 'null'
    BenefitPointsProportionalApplicableToProduct:
      type: object
      description: Product reference.
      properties:
        id:
          type: string
          pattern: ^prod_[a-f0-9]+
          description: Product ID, prefixed with `prod_`.
      required:
        - id
      additionalProperties: false
    BenefitPointsProportionalApplicableToSku:
      type: object
      description: SKU reference.
      properties:
        id:
          type: string
          pattern: ^sku_[a-f0-9]+
          description: SKU ID, prefixed with `sku_`.
      required:
        - id
      additionalProperties: false
    BenefitPointsProportionalApplicableToProductsCollection:
      type: object
      description: Products collection reference.
      properties:
        id:
          type: string
          pattern: ^pc_[a-zA-Z0-9]+
          description: Products collection ID, prefixed with `pc_`.
      required:
        - id
      additionalProperties: false
  securitySchemes:
    X-App-Id:
      type: apiKey
      name: X-App-Id
      in: header
    X-App-Token:
      type: apiKey
      name: X-App-Token
      in: header
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````