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

# Update reward

> Updates an existing reward. This is a partial update: properties you don't send keep their current values.

The body must include at least one property that the update applies. An empty body fails with `400`. So does a body whose only properties are `null` values for `validity_hours`, `refunds`, `material`, or `digital` that are ignored (see below).

Rules for the properties you send:

- `type`: can only be changed in `DRAFT` status. When `type` is `MATERIAL`, `material` is required and `digital` must be `null`. When `type` is `DIGITAL`, `digital` is required and `material` must be `null`. Send `type` together with `material` or `digital`.
- `material`, `digital`, `validity_hours`, and `purchase_limits` replace the stored object as a whole. They are not merged. In `purchase_limits`, an omitted `cooldown` or `frequency` resets to its default (no cooldown or no limit).
- `costs` replaces the whole array. A cost with the `id` of a stored cost updates that cost. A cost without an `id` is created. A stored cost left out of the array is deleted.
- `metadata` is merged. Keys you send are added or overwritten (a nested object under a key is replaced as a whole), and other keys are kept.

How `null` works:

- `name`, `type`, and `costs` cannot be `null`. The request fails with `400`.
- `start_date` and `end_date`: `null` removes the date.
- `validity_hours` and `refunds`: `null` is treated as not sent and keeps the current value. To set validity back to any time, send `validity_hours` with `type` set to `ANY_TIME`.
- `material` and `digital`: without `type`, `null` is treated as not sent. With `type`, the object for the other type must be `null` and is cleared.
- `purchase_limits`: `null` resets it to no cooldown and no limit.
- `metadata`: `null` removes all metadata. The request fails with `400` if the project's metadata schema for rewards requires properties.

This endpoint cannot change `status`. Use the Activate reward, Deactivate reward, or Move reward back to draft endpoints. Sending `status` fails with `400`.

In `DRAFT` status, all properties can be updated. In `ACTIVE`/`INACTIVE` status only the following properties can be updated: `name`, `metadata`, `refunds`, `validity_hours`, `start_date`, `end_date`, `costs`, `purchase_limits`.

A successful call records [`vl.reward.updated`](/api-reference/loyalty-activity/rewards/updated).



## OpenAPI

````yaml /openapi/loyalties-v2.json put /v2/loyalties/rewards/{rewardId}
openapi: 3.1.0
info:
  title: Voucherify API - Loyalty v2
  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:
  /v2/loyalties/rewards/{rewardId}:
    parameters:
      - name: rewardId
        in: path
        required: true
        description: Identifies the reward. Format `lrew_[a-f0-9]+`.
        schema:
          type: string
          pattern: ^lrew_[a-f0-9]+$
    put:
      tags:
        - Rewards
      summary: Update reward
      description: >-
        Updates an existing reward. This is a partial update: properties you
        don't send keep their current values.


        The body must include at least one property that the update applies. An
        empty body fails with `400`. So does a body whose only properties are
        `null` values for `validity_hours`, `refunds`, `material`, or `digital`
        that are ignored (see below).


        Rules for the properties you send:


        - `type`: can only be changed in `DRAFT` status. When `type` is
        `MATERIAL`, `material` is required and `digital` must be `null`. When
        `type` is `DIGITAL`, `digital` is required and `material` must be
        `null`. Send `type` together with `material` or `digital`.

        - `material`, `digital`, `validity_hours`, and `purchase_limits` replace
        the stored object as a whole. They are not merged. In `purchase_limits`,
        an omitted `cooldown` or `frequency` resets to its default (no cooldown
        or no limit).

        - `costs` replaces the whole array. A cost with the `id` of a stored
        cost updates that cost. A cost without an `id` is created. A stored cost
        left out of the array is deleted.

        - `metadata` is merged. Keys you send are added or overwritten (a nested
        object under a key is replaced as a whole), and other keys are kept.


        How `null` works:


        - `name`, `type`, and `costs` cannot be `null`. The request fails with
        `400`.

        - `start_date` and `end_date`: `null` removes the date.

        - `validity_hours` and `refunds`: `null` is treated as not sent and
        keeps the current value. To set validity back to any time, send
        `validity_hours` with `type` set to `ANY_TIME`.

        - `material` and `digital`: without `type`, `null` is treated as not
        sent. With `type`, the object for the other type must be `null` and is
        cleared.

        - `purchase_limits`: `null` resets it to no cooldown and no limit.

        - `metadata`: `null` removes all metadata. The request fails with `400`
        if the project's metadata schema for rewards requires properties.


        This endpoint cannot change `status`. Use the Activate reward,
        Deactivate reward, or Move reward back to draft endpoints. Sending
        `status` fails with `400`.


        In `DRAFT` status, all properties can be updated. In `ACTIVE`/`INACTIVE`
        status only the following properties can be updated: `name`, `metadata`,
        `refunds`, `validity_hours`, `start_date`, `end_date`, `costs`,
        `purchase_limits`.


        A successful call records
        [`vl.reward.updated`](/api-reference/loyalty-activity/rewards/updated).
      operationId: updateReward
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V2LoyaltiesRewardsUpdateRequestBody'
            examples:
              Update purchase limits:
                value:
                  purchase_limits:
                    cooldown:
                      type: FIXED_COOLDOWN
                      fixed_cooldown:
                        period:
                          value: 1
                          unit: DAY
                    frequency:
                      type: LIMITED
                      limits:
                        - type: TIME_BASED
                          period:
                            type: CURRENT_PERIOD
                            current_period:
                              unit: DAY
                          triggers:
                            max: 1
      responses:
        '200':
          description: The updated reward.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2LoyaltiesRewardsUpdateResponseBody'
              examples:
                Updated reward:
                  value:
                    id: lrew_12cad1abefa2311e10
                    name: Daily coffee voucher
                    type: MATERIAL
                    status: DRAFT
                    start_date: null
                    end_date: null
                    validity_hours:
                      type: ANY_TIME
                    material:
                      type: PRODUCT
                      product:
                        id: prod_0ba649b6893cf33a80
                    refunds:
                      type: NONE
                    costs:
                      - id: lrcst_12cad1abefa2311e11
                        spending:
                          - id: lrspn_12cad1abefa2311e12
                            name: Standard cost
                            points: 100
                            card_definition_id: lcdef_128f495f720c4bec8c
                    purchase_limits:
                      cooldown:
                        type: FIXED_COOLDOWN
                        fixed_cooldown:
                          period:
                            value: 1
                            unit: DAY
                      frequency:
                        type: LIMITED
                        limits:
                          - type: TIME_BASED
                            period:
                              type: CURRENT_PERIOD
                              current_period:
                                unit: DAY
                            triggers:
                              max: 1
                    metadata: {}
                    created_at: '2026-07-27T16:09:59.999Z'
                    updated_at: '2026-07-28T10:00:00.000Z'
                    object: reward
        '400':
          description: >-
            Validation error. The request body failed validation, is empty, or
            the operation is not allowed in the current resource state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Invalid properties for a non-DRAFT reward:
                  value:
                    code: 400
                    key: invalid_payload
                    message: Invalid payload
                    details: >-
                      Only [name, metadata, refunds, validity_hours, start_date,
                      end_date, costs, purchase_limits] properties are allowed
                      to be updated when reward is in ACTIVE status
                    request_id: v-136e11724747891bde
                At least one property is required:
                  value:
                    code: 400
                    key: invalid_payload
                    message: Invalid payload
                    details: At least one property is required
                    request_id: v-131f936f8b62233303
                Campaign type does not match the digital reward:
                  value:
                    code: 400
                    key: invalid_campaign_type
                    message: Invalid payload
                    details: >-
                      Campaign must be of type 'DISCOUNT_COUPONS' for
                      DISCOUNT_COUPONS reward
                    request_id: v-131f936f8b62233304
        '404':
          description: >-
            Resource not found. The reward does not exist or is deleted. Also
            returned when a card definition, tier structure, tier, campaign,
            product, or SKU referenced in the body does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Reward not found:
                  value:
                    code: 404
                    key: not_found
                    message: Resource not found
                    details: Cannot find reward with id lrew_18f58429f4c4bf7b2
                    request_id: v-131f936f8b62233301
                    resource_id: lrew_18f58429f4c4bf7b2
                    resource_type: reward
                Reward ID does not match the pattern:
                  value:
                    code: 404
                    key: not_found
                    message: Resource not found
                    details: Cannot find reward with id non-existent-id
                    request_id: v-131f936f8b62233302
                    resource_id: non-existent-id
                    resource_type: reward
                Card definition not found:
                  value:
                    code: 404
                    key: not_found
                    message: Resource not found
                    details: >-
                      Cannot find card_definitions with ids [
                      lcdef_128f495f720c4bec8c ]
                    request_id: v-131f936f8b62233305
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Internal server error:
                  value:
                    code: 500
                    key: api_error
                    message: >-
                      Something went wrong. Don't worry, your campaigns are
                      still safe and the Voucherify Team has been notified.
                      Check out our Help Center and forums for help, or head
                      back to home.
      security:
        - X-App-Id: []
          X-App-Token: []
        - bearerAuth: []
components:
  schemas:
    V2LoyaltiesRewardsUpdateRequestBody:
      title: V2 Loyalties Rewards Update Request Body
      type: object
      description: Request body schema for **PUT** `/v2/loyalties/rewards/{rewardId}`.
      allOf:
        - $ref: '#/components/schemas/RewardUpdateRequest'
    V2LoyaltiesRewardsUpdateResponseBody:
      title: V2 Loyalties Rewards Update Response Body
      type: object
      description: Response body schema for **PUT** `/v2/loyalties/rewards/{rewardId}`.
      allOf:
        - $ref: '#/components/schemas/RewardResponse'
    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.
    RewardUpdateRequest:
      type: object
      description: >-
        Request body for updating a reward. All properties are optional. When
        `type` is provided as `MATERIAL`, `material` is required and `digital`
        must be `null`. When `type` is provided as `DIGITAL`, `digital` is
        required and `material` must be `null`. In `ACTIVE`/`INACTIVE` status
        only `name`, `metadata`, `refunds`, `validity_hours`, `start_date`,
        `end_date`, `costs`, and `purchase_limits` can be updated.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
          description: Display name of the reward.
        type:
          type: string
          enum:
            - MATERIAL
            - DIGITAL
          description: >-
            Reward type. Can only be changed while the reward is in DRAFT
            status.
        validity_hours:
          oneOf:
            - $ref: '#/components/schemas/RewardValidityHoursRequest'
            - type: 'null'
        start_date:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Date from which the reward is available. Must be an ISO-8601
            compliant date.
        end_date:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Date until which the reward is available. Must be an ISO-8601
            compliant date.
        material:
          description: >-
            Material reward definition. Required when `type` is provided as
            MATERIAL.
          oneOf:
            - $ref: '#/components/schemas/RewardMaterialRequest'
            - type: 'null'
        digital:
          description: >-
            Digital reward definition. Required when `type` is provided as
            DIGITAL.
          oneOf:
            - $ref: '#/components/schemas/RewardDigitalRequest'
            - type: 'null'
        refunds:
          description: Refund policy for the reward.
          oneOf:
            - $ref: '#/components/schemas/LoyaltyV2ActivityRewardRefunds'
            - type: 'null'
        costs:
          type: array
          minItems: 1
          maxItems: 10
          description: >-
            Point costs of the reward. Include the `id` of an existing cost to
            update it; omit `id` to create a new cost.
          items:
            $ref: '#/components/schemas/RewardCostUpdateRequest'
        purchase_limits:
          description: >-
            Purchase limits. Omit to leave unchanged. Send `null` to reset to no
            cooldown and no frequency limit.
          oneOf:
            - $ref: '#/components/schemas/RewardPurchaseLimitsInput'
            - type: 'null'
        metadata:
          type:
            - object
            - 'null'
          description: >-
            Arbitrary key-value metadata attached to the reward, as a free-form
            object.
      additionalProperties: false
      allOf:
        - if:
            properties:
              type:
                const: MATERIAL
            required:
              - type
          then:
            required:
              - material
            properties:
              material:
                $ref: '#/components/schemas/RewardMaterialRequest'
              digital:
                type: 'null'
        - if:
            properties:
              type:
                const: DIGITAL
            required:
              - type
          then:
            required:
              - digital
            properties:
              digital:
                $ref: '#/components/schemas/RewardDigitalRequest'
              material:
                type: 'null'
    RewardResponse:
      type: object
      description: A reward, as returned by the API.
      properties:
        id:
          type: string
          pattern: ^lrew_[a-f0-9]+$
          description: Unique reward identifier, prefixed with `lrew_`.
        name:
          type: string
          description: Display name of the reward.
        type:
          type: string
          enum:
            - MATERIAL
            - DIGITAL
          description: Reward type.
        status:
          type: string
          enum:
            - ACTIVE
            - DRAFT
            - INACTIVE
            - DELETED
          description: Current lifecycle status of the reward.
        start_date:
          type:
            - string
            - 'null'
          format: date-time
          description: Date from which the reward is available, or `null` when not set.
        end_date:
          type:
            - string
            - 'null'
          format: date-time
          description: Date until which the reward is available, or `null` when not set.
        validity_hours:
          $ref: '#/components/schemas/RewardValidityHoursResponse'
          description: >-
            Hours during which the reward can be purchased. Always present.
            Defaults to `{"type": "ANY_TIME"}`.
        material:
          $ref: '#/components/schemas/RewardMaterialResponse'
          description: >-
            Material reward definition. Present only when `type` is `MATERIAL`.
            Omitted otherwise.
        digital:
          $ref: '#/components/schemas/RewardDigitalResponse'
          description: >-
            Digital reward definition. Present only when `type` is `DIGITAL`.
            Omitted otherwise.
        refunds:
          $ref: '#/components/schemas/LoyaltyV2ActivityRewardRefunds'
          description: 'Refund policy. Always present. Defaults to `{ "type": "NONE" }`.'
        costs:
          type: array
          description: Point costs of the reward. Empty array when no costs are defined.
          items:
            $ref: '#/components/schemas/RewardCostResponse'
        purchase_limits:
          $ref: '#/components/schemas/RewardPurchaseLimits'
          description: >-
            Purchase limits. Always present. Defaults to `{"cooldown": { "type":
            "NO_COOLDOWN"}, "frequency": {"type": "NO_LIMIT", "limits": []}}`.
        metadata:
          type: object
          description: >-
            Arbitrary key-value metadata attached to the reward. Empty object
            when not set.
        created_at:
          type: string
          format: date-time
          description: Timestamp when the reward was created (ISO-8601).
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Timestamp when the reward was last updated (ISO-8601), or `null`
            when never updated.
        object:
          type: string
          const: reward
          description: Object type marker; always `reward`.
      required:
        - id
        - name
        - type
        - status
        - start_date
        - end_date
        - validity_hours
        - refunds
        - costs
        - purchase_limits
        - metadata
        - created_at
        - updated_at
        - object
    RewardValidityHoursRequest:
      type: object
      description: >-
        Validity hours definition that specifies when the reward can be
        purchased. `type` is required. When `type` is `ANY_TIME`, `daily` must
        be `null`. When `type` is `DAILY`, `daily` is required and must contain
        at least one entry.
      properties:
        type:
          type: string
          enum:
            - DAILY
            - ANY_TIME
          description: >-
            Whether the reward is purchasable at any time or only during
            specific daily windows.
        daily:
          description: >-
            Daily time windows. Required when `type` is `DAILY`. Must be `null`
            when `type` is `ANY_TIME`.
          oneOf:
            - type: array
              minItems: 1
              items:
                $ref: '#/components/schemas/RewardValidityDailyHoursRequest'
            - type: 'null'
      required:
        - type
      additionalProperties: false
      allOf:
        - if:
            properties:
              type:
                const: ANY_TIME
          then:
            properties:
              daily:
                type: 'null'
        - if:
            properties:
              type:
                const: DAILY
          then:
            required:
              - daily
            properties:
              daily:
                type: array
                minItems: 1
                items:
                  $ref: '#/components/schemas/RewardValidityDailyHoursRequest'
    RewardMaterialRequest:
      type: object
      description: >-
        Material reward definition. `type` is required. When `type` is
        `PRODUCT`, `product` is required and `sku` must be `null`. When `type`
        is `SKU`, `sku` is required and `product` must be `null`.
      properties:
        type:
          type: string
          enum:
            - PRODUCT
            - SKU
          description: Kind of material reward.
        product:
          description: >-
            Product delivered by the reward. Required when `type` is `PRODUCT`.
            Must be `null` when `type` is SKU.
          oneOf:
            - $ref: '#/components/schemas/LoyaltyV2ActivityRewardMaterialProduct'
            - type: 'null'
        sku:
          description: >-
            SKU delivered by the reward. Required when `type` is SKU. Must be
            `null` when `type` is PRODUCT.
          oneOf:
            - $ref: '#/components/schemas/LoyaltyV2ActivityRewardMaterialSKU'
            - type: 'null'
      required:
        - type
      additionalProperties: false
      allOf:
        - if:
            properties:
              type:
                const: PRODUCT
          then:
            required:
              - product
            properties:
              product:
                $ref: '#/components/schemas/LoyaltyV2ActivityRewardMaterialProduct'
              sku:
                type: 'null'
        - if:
            properties:
              type:
                const: SKU
          then:
            required:
              - sku
            properties:
              sku:
                $ref: '#/components/schemas/LoyaltyV2ActivityRewardMaterialSKU'
              product:
                type: 'null'
    RewardDigitalRequest:
      type: object
      description: >-
        Digital reward definition. `type` is required. Exactly the object
        matching `type` is required and the other two must be `null`:
        `DISCOUNT_COUPONS` requires `discount_coupons`, `GIFT_VOUCHERS` requires
        `gift_vouchers`, `LOYALTY_CARD_POINTS` requires `loyalty_card_points`.
      properties:
        type:
          type: string
          enum:
            - DISCOUNT_COUPONS
            - GIFT_VOUCHERS
            - LOYALTY_CARD_POINTS
          description: Kind of the digital reward.
        discount_coupons:
          description: >-
            Discount coupons configuration. Required when `type` is
            `DISCOUNT_COUPONS`. Must be `null` otherwise.
          oneOf:
            - $ref: >-
                #/components/schemas/LoyaltyV2ActivityRewardDigitalDiscountCoupons
            - type: 'null'
        gift_vouchers:
          description: >-
            Gift vouchers configuration. Required when `type` is
            `GIFT_VOUCHERS`. Must be `null` otherwise.
          oneOf:
            - $ref: '#/components/schemas/RewardDigitalGiftVouchersRequest'
            - type: 'null'
        loyalty_card_points:
          description: >-
            Loyalty card points configuration. Required when `type` is
            LOYALTY_CARD_POINTS. Must be `null` otherwise.
          oneOf:
            - $ref: '#/components/schemas/RewardDigitalLoyaltyCardPointsRequest'
            - type: 'null'
      required:
        - type
      additionalProperties: false
      allOf:
        - if:
            properties:
              type:
                const: DISCOUNT_COUPONS
          then:
            required:
              - discount_coupons
            properties:
              discount_coupons:
                $ref: >-
                  #/components/schemas/LoyaltyV2ActivityRewardDigitalDiscountCoupons
              gift_vouchers:
                type: 'null'
              loyalty_card_points:
                type: 'null'
        - if:
            properties:
              type:
                const: GIFT_VOUCHERS
          then:
            required:
              - gift_vouchers
            properties:
              gift_vouchers:
                $ref: '#/components/schemas/RewardDigitalGiftVouchersRequest'
              discount_coupons:
                type: 'null'
              loyalty_card_points:
                type: 'null'
        - if:
            properties:
              type:
                const: LOYALTY_CARD_POINTS
          then:
            required:
              - loyalty_card_points
            properties:
              loyalty_card_points:
                $ref: '#/components/schemas/RewardDigitalLoyaltyCardPointsRequest'
              discount_coupons:
                type: 'null'
              gift_vouchers:
                type: 'null'
    LoyaltyV2ActivityRewardRefunds:
      type: object
      description: Refund policy for the reward.
      properties:
        type:
          type: string
          enum:
            - NONE
            - REFUNDABLE
          description: Whether reward purchases can be refunded.
      required:
        - type
      additionalProperties: false
    RewardCostUpdateRequest:
      type: object
      description: |-
        A reward cost for update. Same as the
        create variant plus an optional `id` referencing an existing cost.
      properties:
        id:
          type: string
          pattern: ^lrcst_[a-f0-9]+$
          description: >-
            Unique identifier of an existing cost to update, prefixed with
            `lrcst_`. Omit to create a new cost.
        rules:
          $ref: '#/components/schemas/RewardCostRulesRequest'
          description: Rules guarding this cost. Must have between 1 and 10 properties.
        spending:
          type: array
          minItems: 1
          maxItems: 1
          description: >-
            Points to spend on a specific card definition. Exactly one entry is
            allowed.
          items:
            $ref: '#/components/schemas/RewardCostSpendingRequest'
      required:
        - spending
      additionalProperties: false
    RewardPurchaseLimitsInput:
      type: object
      description: >-
        Limits on how often a member can purchase the reward. On create, omitted
        values default to no cooldown and no frequency limit. On update, omit to
        leave unchanged; send `null` to reset to defaults.
      properties:
        cooldown:
          description: Cooldown after a purchase.
          oneOf:
            - $ref: '#/components/schemas/RewardPurchaseLimitsCooldownInput'
            - type: 'null'
        frequency:
          description: How many times the reward can be purchased in a period.
          oneOf:
            - $ref: '#/components/schemas/RewardPurchaseLimitsFrequencyInput'
            - type: 'null'
      additionalProperties: false
    RewardValidityHoursResponse:
      type: object
      description: >-
        Validity hours. `daily` is present only when `type` is DAILY. Omitted
        otherwise.
      properties:
        type:
          type: string
          enum:
            - DAILY
            - ANY_TIME
          description: >-
            Whether the reward is purchasable at any time or only during
            specific daily windows.
        daily:
          type: array
          description: Daily time windows. Present only when `type` is DAILY.
          items:
            $ref: >-
              #/components/schemas/LoyaltyV2ActivityRewardValidityDailyHoursResponse
      required:
        - type
    RewardMaterialResponse:
      type: object
      description: Material reward definition.
      properties:
        type:
          type: string
          enum:
            - PRODUCT
            - SKU
          description: Kind of material reward.
        product:
          $ref: '#/components/schemas/LoyaltyV2ActivityRewardMaterialProduct'
          description: >-
            Product delivered by the reward. Present only when `type` is
            `PRODUCT`. Omitted otherwise.
        sku:
          $ref: '#/components/schemas/LoyaltyV2ActivityRewardMaterialSKU'
          description: >-
            SKU delivered by the reward. Present only when `type` is `SKU`.
            Omitted otherwise.
      required:
        - type
    RewardDigitalResponse:
      type: object
      description: >-
        Digital reward definition. Only the object matching `type` is present;
        the others are omitted.
      properties:
        type:
          type: string
          enum:
            - DISCOUNT_COUPONS
            - GIFT_VOUCHERS
            - LOYALTY_CARD_POINTS
          description: Kind of digital reward.
        discount_coupons:
          $ref: '#/components/schemas/LoyaltyV2ActivityRewardDigitalDiscountCoupons'
          description: >-
            Discount coupons configuration. Present only when `type` is
            `DISCOUNT_COUPONS`.
        gift_vouchers:
          $ref: >-
            #/components/schemas/LoyaltyV2ActivityRewardDigitalGiftVouchersResponse
          description: >-
            Gift vouchers configuration. Present only when `type` is
            `GIFT_VOUCHERS`.
        loyalty_card_points:
          $ref: >-
            #/components/schemas/LoyaltyV2ActivityRewardDigitalLoyaltyCardPointsResponse
          description: >-
            Loyalty card points configuration. Present only when `type` is
            `LOYALTY_CARD_POINTS`.
      required:
        - type
    RewardCostResponse:
      type: object
      description: >-
        A reward cost. `rules` is omitted when the cost has no rule definitions;
        `spending` is `null` when no spending is defined. `tier_rules` is always
        present and defaults to `NO_REQUIREMENTS`.
      properties:
        id:
          type: string
          pattern: ^lrcst_[a-f0-9]+$
          description: Unique cost identifier, prefixed with `lrcst_`.
        name:
          type:
            - string
            - 'null'
          maxLength: 200
          description: Display name of the cost. Omitted when not set. `null` when cleared.
        rules:
          $ref: '#/components/schemas/RewardCostRuleGroupResponse'
          description: >-
            Rules guarding this cost. Omitted when the cost has no rule
            definitions.
        spending:
          type:
            - array
            - 'null'
          description: Points spending definitions, or `null` when none are defined.
          items:
            $ref: '#/components/schemas/LoyaltyV2ActivityRewardCostSpendingResponse'
        tier_rules:
          $ref: '#/components/schemas/RewardCostTierRulesResponse'
          description: >-
            Defines which tiers can use this cost. Always present. Defaults to
            `NO_REQUIREMENTS`.
      required:
        - id
        - tier_rules
    RewardPurchaseLimits:
      type: object
      description: >-
        Limits on how often a member can purchase the reward. Always present on
        reward responses. Defaults to no cooldown and no frequency limit.
      properties:
        cooldown:
          $ref: '#/components/schemas/RewardPurchaseLimitsCooldown'
          description: Cooldown after a purchase.
        frequency:
          $ref: '#/components/schemas/RewardPurchaseLimitsFrequency'
          description: How many times the reward can be purchased in a period.
      required:
        - cooldown
        - frequency
    RewardValidityDailyHoursRequest:
      type: object
      description: A single daily validity window.
      properties:
        days_of_week:
          type: array
          minItems: 1
          maxItems: 7
          description: >-
            Days of the week the window applies to, as integers 0-6 (0 =
            Sunday). Values must be unique.
          items:
            type: integer
            minimum: 0
            maximum: 6
        start_time:
          type: string
          description: Window start time in `HH:mm` format.
          example: '09:00'
        end_time:
          type: string
          description: >-
            Optional. Window end time in `HH:mm` format. Omit when the window
            has no end.
          example: '17:00'
      required:
        - days_of_week
        - start_time
      additionalProperties: false
    LoyaltyV2ActivityRewardMaterialProduct:
      type: object
      description: Product reference for a material reward.
      properties:
        id:
          type: string
          pattern: ^prod_[a-f0-9]+
          description: Product identifier, prefixed with `prod_`.
      required:
        - id
      additionalProperties: false
    LoyaltyV2ActivityRewardMaterialSKU:
      type: object
      description: SKU reference for a material reward.
      properties:
        product_id:
          type: string
          pattern: ^prod_[a-f0-9]+
          description: >-
            Unique identifier of the product the SKU belongs to, prefixed with
            `prod_`.
        id:
          type: string
          pattern: ^sku_[a-f0-9]+
          description: SKU identifier, prefixed with `sku_`.
      required:
        - product_id
        - id
      additionalProperties: false
    LoyaltyV2ActivityRewardDigitalDiscountCoupons:
      type: object
      description: Discount coupons digital reward configuration.
      properties:
        campaign_id:
          type: string
          pattern: ^camp_[a-zA-Z0-9]+
          description: >-
            Unique identifier of the discount coupons campaign to publish a
            coupon from, prefixed with `camp_`.
      required:
        - campaign_id
      additionalProperties: false
    RewardDigitalGiftVouchersRequest:
      type: object
      description: Gift vouchers digital reward configuration.
      properties:
        campaign_id:
          type: string
          pattern: ^camp_[a-zA-Z0-9]+
          description: >-
            Unique identifier of the gift vouchers campaign to publish a voucher
            from, prefixed with `camp_`.
        balance:
          type: number
          minimum: 0
          description: >-
            Gift card balance credited when the reward is delivered. Value
            present as a positive integer in the smallest currency unit (e.g.
            100 cents for $1.00). Added to the initial gift card balance when
            the gift card is first published.
      required:
        - campaign_id
        - balance
      additionalProperties: false
    RewardDigitalLoyaltyCardPointsRequest:
      type: object
      description: >-
        Loyalty card points digital reward configuration. The
        `card_definition_id` must differ from every `card_definition_id` in
        `costs[].spending` (source and target card definitions must be
        different).
      properties:
        points:
          type: integer
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Number of points credited to the member's card when the reward is
            delivered.
        card_definition_id:
          type: string
          pattern: ^lcdef_[a-f0-9]+$
          description: >-
            Unique identifier of the card definition to credit points to,
            prefixed with `lcdef_`. Must differ from every spending
            `card_definition_id` in `costs`.
      required:
        - points
        - card_definition_id
      additionalProperties: false
    RewardCostRulesRequest:
      type: object
      description: >-
        Rules group for a reward cost. Contains a required `logic` property plus
        numbered rule definitions. Every property other than `logic` must be a
        positive-integer key (`^[1-9]\d*$`) mapping to a rule definition. At
        least one rule definition is required. No other properties are allowed.
      properties:
        logic:
          type: string
          description: >-
            A logical formula referencing the numbered rule definitions, e.g.
            `"1 AND 2"`.
      required:
        - logic
      minProperties: 2
      additionalProperties:
        $ref: '#/components/schemas/RewardCostRuleDefinitionRequest'
        description: >-
          A numbered rule definition. Property names must be positive integers
          matching `^[1-9]\d*$` (for example `1`, `2`).
    RewardCostSpendingRequest:
      type: object
      description: Points spending definition for a cost.
      properties:
        id:
          type: string
          pattern: ^lrspn_[a-f0-9]+$
          description: >-
            Optional spending identifier, prefixed with `lrspn_`. Provide on
            update to keep the same spending entry. Omit on create to
            auto-assign.
        name:
          type:
            - string
            - 'null'
          maxLength: 200
          description: >-
            Optional display name of the spending definition (max 200
            characters), or `null`.
        points:
          type: integer
          minimum: 1
          maximum: 9007199254740991
          description: Number of points the member must spend.
        card_definition_id:
          type: string
          pattern: ^lcdef_[a-f0-9]+$
          description: >-
            Unique identifier of the card definition the points are spent from,
            prefixed with `lcdef_`.
      required:
        - points
        - card_definition_id
      additionalProperties: false
    RewardPurchaseLimitsCooldownInput:
      type: object
      description: Purchase cooldown limits for a reward.
      properties:
        type:
          type: string
          enum:
            - NO_COOLDOWN
            - FIXED_COOLDOWN
          description: >-
            Cooldown type. `NO_COOLDOWN` requires `fixed_cooldown` to be
            `null`/omitted. `FIXED_COOLDOWN` requires `fixed_cooldown`.
        fixed_cooldown:
          description: >-
            Fixed cooldown details. Required when `type` is `FIXED_COOLDOWN`.
            Must be `null` when `type` is `NO_COOLDOWN`.
          oneOf:
            - $ref: >-
                #/components/schemas/RewardPurchaseLimitsCooldownFixedCooldownInput
            - type: 'null'
      required:
        - type
      additionalProperties: false
      allOf:
        - if:
            properties:
              type:
                const: NO_COOLDOWN
          then:
            properties:
              fixed_cooldown:
                type: 'null'
        - if:
            properties:
              type:
                const: FIXED_COOLDOWN
          then:
            required:
              - fixed_cooldown
            properties:
              fixed_cooldown:
                $ref: >-
                  #/components/schemas/RewardPurchaseLimitsCooldownFixedCooldownInput
    RewardPurchaseLimitsFrequencyInput:
      type: object
      description: Purchase frequency limits for a reward.
      properties:
        type:
          type: string
          enum:
            - NO_LIMIT
            - LIMITED
          description: >-
            Frequency limit type. `NO_LIMIT` allows empty/`null` `limits`.
            `LIMITED` requires exactly one limit.
        limits:
          description: >-
            Frequency limit definitions. Empty or null when `type` is
            `NO_LIMIT`. Exactly one entry when `type` is `LIMITED`.
          oneOf:
            - type: array
              items:
                $ref: '#/components/schemas/RewardPurchaseLimitsFrequencyLimitInput'
              minItems: 0
              maxItems: 1
            - type: 'null'
      required:
        - type
      additionalProperties: false
      allOf:
        - if:
            properties:
              type:
                const: NO_LIMIT
          then:
            properties:
              limits:
                oneOf:
                  - type: array
                    minItems: 0
                    maxItems: 0
                    items:
                      $ref: >-
                        #/components/schemas/RewardPurchaseLimitsFrequencyLimitInput
                  - type: 'null'
        - if:
            properties:
              type:
                const: LIMITED
          then:
            required:
              - limits
            properties:
              limits:
                type: array
                minItems: 1
                maxItems: 1
                items:
                  $ref: '#/components/schemas/RewardPurchaseLimitsFrequencyLimitInput'
    LoyaltyV2ActivityRewardValidityDailyHoursResponse:
      type: object
      description: A single daily validity window.
      properties:
        days_of_week:
          type: array
          description: >-
            Days of the week the window applies to, as integers 0-6 (0 =
            Sunday).
          items:
            type: integer
            minimum: 0
            maximum: 6
        start_time:
          type: string
          description: Window start time in `HH:mm` format.
          example: '09:00'
        end_time:
          type: string
          description: Window end time in `HH:mm` format. Omitted when unset.
          example: '17:00'
      required:
        - days_of_week
        - start_time
    LoyaltyV2ActivityRewardDigitalGiftVouchersResponse:
      type: object
      description: Gift vouchers configuration.
      properties:
        campaign_id:
          type: string
          pattern: ^camp_[a-zA-Z0-9]+
          description: >-
            Unique identifier of the gift vouchers campaign, prefixed with
            `camp_`.
        balance:
          type: number
          description: >-
            Gift card balance credited when the reward is delivered. Value
            present as a positive integer in the smallest currency unit (e.g.
            100 cents for $1.00). Added to the initial gift card balance when
            the gift card is first published.
      required:
        - campaign_id
        - balance
    LoyaltyV2ActivityRewardDigitalLoyaltyCardPointsResponse:
      type: object
      description: Loyalty card points configuration.
      properties:
        points:
          type: integer
          description: Number of points credited when the reward is delivered.
        card_definition_id:
          type: string
          pattern: ^lcdef_[a-f0-9]+$
          description: >-
            Unique identifier of the card definition points are credited to,
            prefixed with `lcdef_`.
      required:
        - points
        - card_definition_id
    RewardCostRuleGroupResponse:
      type: object
      description: >-
        Rules group. Contains a `logic` formula string plus numbered rule
        definition properties (positive-integer keys).
      properties:
        logic:
          type: string
          description: >-
            Logical formula combining the numbered rule definitions, e.g. `"1
            AND 2"`.
      additionalProperties:
        $ref: '#/components/schemas/RewardCostRuleDefinitionResponse'
        description: >-
          A numbered rule definition. Property names must be positive integers
          matching `^[1-9]\d*$` (for example `1`, `2`).
    LoyaltyV2ActivityRewardCostSpendingResponse:
      type: object
      description: Points spending definition.
      properties:
        id:
          type: string
          pattern: ^lrspn_[a-f0-9]+$
          description: >-
            Unique spending identifier, prefixed with `lrspn_`. Assigned by the
            API when omitted on create/update.
        name:
          type:
            - string
            - 'null'
          maxLength: 200
          description: Optional display name of the spending definition, or `null`.
        points:
          type: integer
          description: Number of points the member must spend.
        card_definition_id:
          type: string
          pattern: ^lcdef_[a-f0-9]+$
          description: >-
            Unique identifier of the card definition the points are spent from,
            prefixed with `lcdef_`.
      required:
        - id
        - points
        - card_definition_id
    RewardCostTierRulesResponse:
      type: object
      description: >-
        Tier requirements for a reward cost. `any_of` is omitted when `type` is
        `NO_REQUIREMENTS`.
      properties:
        type:
          type: string
          enum:
            - NO_REQUIREMENTS
            - ANY_OF
          description: Tier requirement type.
        any_of:
          type: array
          minItems: 1
          description: >-
            Lists tier combinations that qualify. Present when `type` is
            `ANY_OF`.
          items:
            $ref: '#/components/schemas/RewardCostTierRulesAnyOfEntryResponse'
      required:
        - type
      additionalProperties: false
      allOf:
        - if:
            properties:
              type:
                const: ANY_OF
          then:
            required:
              - any_of
    RewardPurchaseLimitsCooldown:
      type: object
      description: Purchase cooldown limits for a reward.
      properties:
        type:
          type: string
          enum:
            - NO_COOLDOWN
            - FIXED_COOLDOWN
          description: >-
            Cooldown type. `NO_COOLDOWN` - no cooldown. `FIXED_COOLDOWN` - wait
            a fixed period after each purchase.
        fixed_cooldown:
          $ref: '#/components/schemas/RewardPurchaseLimitsCooldownFixedCooldown'
          description: >-
            Fixed cooldown details. Present when `type` is `FIXED_COOLDOWN`.
            Omitted when `type` is `NO_COOLDOWN`.
      required:
        - type
    RewardPurchaseLimitsFrequency:
      type: object
      description: Purchase frequency limits for a reward.
      properties:
        type:
          type: string
          enum:
            - NO_LIMIT
            - LIMITED
          description: >-
            Frequency limit type. `NO_LIMIT` - unlimited purchases. `LIMITED` -
            limited by the `limits` array.
        limits:
          type: array
          description: >-
            Frequency limit definitions. Empty array when `type` is `NO_LIMIT`;
            one entry when `type` is `LIMITED`.
          items:
            $ref: '#/components/schemas/RewardPurchaseLimitsFrequencyLimit'
      required:
        - type
        - limits
    RewardCostRuleDefinitionRequest:
      type: object
      description: >-
        A single rule definition inside a cost rules group. `conditions`, when
        provided, must have between 1 and 10 properties (one per operator).
        `rules` allows nesting of rule groups.
      properties:
        name:
          type: string
          enum:
            - customer.segment
            - customer.metadata
            - member.metadata
          description: >-
            Rule kind. `customer.segment` checks segment membership,
            `customer.metadata` checks a customer metadata property,
            `member.metadata` checks a member metadata property.
        property:
          type:
            - string
            - 'null'
          description: Metadata property name the rule applies to (for metadata rules).
        error:
          description: Custom error returned when the rule is not satisfied.
          oneOf:
            - $ref: '#/components/schemas/RewardCostRuleErrorRequest'
            - type: 'null'
        rules:
          description: Nested rules group.
          oneOf:
            - $ref: '#/components/schemas/RewardCostRulesRequest'
            - type: 'null'
        conditions:
          $ref: '#/components/schemas/RewardCostRuleConditionsRequest'
          description: >-
            Operator conditions for the rule. Must have between 1 and 10
            properties (one per operator).
      additionalProperties: false
    RewardPurchaseLimitsCooldownFixedCooldownInput:
      type: object
      description: Fixed cooldown configuration.
      properties:
        period:
          $ref: >-
            #/components/schemas/RewardPurchaseLimitsCooldownFixedCooldownPeriodInput
          description: Cooldown period.
      required:
        - period
      additionalProperties: false
    RewardPurchaseLimitsFrequencyLimitInput:
      type: object
      description: A frequency limit. Currently only `TIME_BASED` is supported.
      properties:
        type:
          type: string
          const: TIME_BASED
          description: Limit type. Always `TIME_BASED`.
        period:
          $ref: >-
            #/components/schemas/CardDefinitionSpendingLimitsGlobalTimeBasedPeriodInput
          description: Time period that resets the purchase counter.
        triggers:
          $ref: >-
            #/components/schemas/LoyaltyV2ActivityRewardPurchaseLimitsFrequencyLimitTriggers
          description: Purchase count limit within the period.
      required:
        - type
        - period
        - triggers
      additionalProperties: false
    RewardCostRuleDefinitionResponse:
      type: object
      description: >-
        A single rule definition. `conditions`, `rules` and `error` are omitted
        when not set.
      properties:
        name:
          type: string
          enum:
            - customer.segment
            - customer.metadata
            - member.metadata
          description: Rule kind.
        property:
          type:
            - string
            - 'null'
          description: Metadata property name the rule applies to (for metadata rules).
        conditions:
          type: object
          description: >-
            Operator conditions for the rule (keys are operators such as `$is`,
            `$in`; values are arrays of condition values). Omitted when not set.
        rules:
          $ref: '#/components/schemas/RewardCostRuleGroupResponse'
          description: Nested rules group. Omitted when not set.
        error:
          type: object
          description: >-
            Custom rule error definition with a `message` property. Omitted when
            not set.
          properties:
            message:
              type: string
              description: Error message returned when the rule is not satisfied.
    RewardCostTierRulesAnyOfEntryResponse:
      type: object
      description: Tier structure with the tiers that qualify for this cost.
      properties:
        tier_structure_id:
          type: string
          pattern: ^lts_[a-f0-9]+$
          description: Identifies the tier structure.
        tier_ids:
          type: array
          minItems: 1
          description: Lists the qualifying tier IDs.
          items:
            type: string
            pattern: ^lt_[a-f0-9]+$
      required:
        - tier_structure_id
        - tier_ids
      additionalProperties: false
    RewardPurchaseLimitsCooldownFixedCooldown:
      type: object
      description: Fixed cooldown configuration.
      properties:
        period:
          $ref: >-
            #/components/schemas/LoyaltyV2ActivityRewardPurchaseLimitsCooldownFixedCooldownPeriod
          description: Cooldown period.
      required:
        - period
    RewardPurchaseLimitsFrequencyLimit:
      type: object
      description: A frequency limit. Currently only `TIME_BASED` is supported.
      properties:
        type:
          type: string
          const: TIME_BASED
          description: Limit type. Always `TIME_BASED`.
        period:
          $ref: >-
            #/components/schemas/LoyaltyV2ActivityCardDefinitionLimitTimeBasedPeriod
          description: >-
            Time period that resets the purchase counter. Reuses the
            card-definition time-based period shape.
        triggers:
          $ref: >-
            #/components/schemas/LoyaltyV2ActivityRewardPurchaseLimitsFrequencyLimitTriggers
          description: Purchase count limit within the period.
      required:
        - type
        - period
        - triggers
    RewardCostRuleErrorRequest:
      type: object
      description: Custom rule error definition.
      properties:
        message:
          type: string
          minLength: 1
          maxLength: 200
          description: Error message returned when the rule is not satisfied.
      required:
        - message
      additionalProperties: false
    RewardCostRuleConditionsRequest:
      type: object
      description: >-
        Operator conditions for a rule. Keys must be one of the supported
        operators; each value is a non-empty array of condition values. Equality
        operators (`$is`, `$is_not`, `$in`, `$not_in`, `$from`) accept object
        references, strings, integers, or booleans. Comparison operators
        (`$less_than`, `$less_than_or_equal`, `$more_than`,
        `$more_than_or_equal`) accept strings or integers only. `$dow` accepts
        day-of-week integers 0-6. Between 1 and 10 operator properties are
        allowed.
      minProperties: 1
      maxProperties: 10
      additionalProperties: false
      properties:
        $is:
          type: array
          minItems: 1
          description: >-
            Values the property must equal. Supports object references, strings,
            integers, or booleans.
          items:
            oneOf:
              - $ref: '#/components/schemas/RewardCostRuleConditionObjectRequest'
              - type: string
              - type: integer
              - type: boolean
        $is_not:
          type: array
          minItems: 1
          description: >-
            Values the property must not equal. Supports object references,
            strings, integers, or booleans.
          items:
            oneOf:
              - $ref: '#/components/schemas/RewardCostRuleConditionObjectRequest'
              - type: string
              - type: integer
              - type: boolean
        $in:
          type: array
          minItems: 1
          description: >-
            Values the property must be one of. Supports object references,
            strings, integers, or booleans.
          items:
            oneOf:
              - $ref: '#/components/schemas/RewardCostRuleConditionObjectRequest'
              - type: string
              - type: integer
              - type: boolean
        $not_in:
          type: array
          minItems: 1
          description: >-
            Values the property must not be one of. Supports object references,
            strings, integers, or booleans.
          items:
            oneOf:
              - $ref: '#/components/schemas/RewardCostRuleConditionObjectRequest'
              - type: string
              - type: integer
              - type: boolean
        $from:
          type: array
          minItems: 1
          description: >-
            Values the property must match. Supports object references, strings,
            integers, or booleans.
          items:
            oneOf:
              - $ref: '#/components/schemas/RewardCostRuleConditionObjectRequest'
              - type: string
              - type: integer
              - type: boolean
        $less_than:
          type: array
          minItems: 1
          description: >-
            Values the property must be less than. Strings or integers only;
            booleans are not supported.
          items:
            oneOf:
              - type: string
              - type: integer
        $less_than_or_equal:
          type: array
          minItems: 1
          description: >-
            Values the property must be less than or equal to. Strings or
            integers only; booleans are not supported.
          items:
            oneOf:
              - type: string
              - type: integer
        $more_than:
          type: array
          minItems: 1
          description: >-
            Values the property must be greater than. Strings or integers only;
            booleans are not supported.
          items:
            oneOf:
              - type: string
              - type: integer
        $more_than_or_equal:
          type: array
          minItems: 1
          description: >-
            Values the property must be greater than or equal to. Strings or
            integers only; booleans are not supported.
          items:
            oneOf:
              - type: string
              - type: integer
        $dow:
          type: array
          minItems: 1
          maxItems: 7
          description: Day-of-week condition values as integers 0-6 (0 = Sunday).
          items:
            type: integer
            minimum: 0
            maximum: 6
    RewardPurchaseLimitsCooldownFixedCooldownPeriodInput:
      type: object
      description: Fixed cooldown period after a reward purchase.
      properties:
        value:
          type: integer
          minimum: 1
          description: >-
            Length of the cooldown period. Max depends on `unit`: `HOUR` 24,
            `DAY` 90, `WEEK` 52, `MONTH` 12, `YEAR` 1.
        unit:
          type: string
          enum:
            - HOUR
            - DAY
            - WEEK
            - MONTH
            - YEAR
          description: Unit of the cooldown period.
      required:
        - value
        - unit
      additionalProperties: false
      allOf:
        - if:
            properties:
              unit:
                const: HOUR
          then:
            properties:
              value:
                type: integer
                minimum: 1
                maximum: 24
        - if:
            properties:
              unit:
                const: DAY
          then:
            properties:
              value:
                type: integer
                minimum: 1
                maximum: 90
        - if:
            properties:
              unit:
                const: WEEK
          then:
            properties:
              value:
                type: integer
                minimum: 1
                maximum: 52
        - if:
            properties:
              unit:
                const: MONTH
          then:
            properties:
              value:
                type: integer
                minimum: 1
                maximum: 12
        - if:
            properties:
              unit:
                const: YEAR
          then:
            properties:
              value:
                type: integer
                minimum: 1
                maximum: 1
    CardDefinitionSpendingLimitsGlobalTimeBasedPeriodInput:
      type: object
      description: >-
        Time-based spending limit period. When `type` is `CURRENT_PERIOD` (the
        only allowed value), `current_period` is required.
      properties:
        type:
          type: string
          enum:
            - CURRENT_PERIOD
          description: >-
            Period type. Currently only `CURRENT_PERIOD` (current calendar
            period) is supported.
        current_period:
          oneOf:
            - $ref: >-
                #/components/schemas/CardDefinitionSpendingLimitsGlobalTimeBasedCurrentPeriodInput
            - type: 'null'
          description: >-
            Current-period configuration. Required when `type` is
            `CURRENT_PERIOD`.
      required:
        - type
      additionalProperties: false
      allOf:
        - if:
            properties:
              type:
                const: CURRENT_PERIOD
          then:
            required:
              - current_period
            properties:
              current_period:
                $ref: >-
                  #/components/schemas/CardDefinitionSpendingLimitsGlobalTimeBasedCurrentPeriodInput
    LoyaltyV2ActivityRewardPurchaseLimitsFrequencyLimitTriggers:
      type: object
      description: Maximum number of purchases allowed in the period.
      properties:
        max:
          type: integer
          minimum: 1
          description: Maximum number of purchases in the configured period.
      required:
        - max
    LoyaltyV2ActivityRewardPurchaseLimitsCooldownFixedCooldownPeriod:
      type: object
      description: Fixed cooldown period after a reward purchase.
      properties:
        value:
          type: integer
          description: Length of the cooldown period.
          minimum: 1
        unit:
          type: string
          enum:
            - HOUR
            - DAY
            - WEEK
            - MONTH
            - YEAR
          description: Unit of the cooldown period.
      required:
        - value
        - unit
    LoyaltyV2ActivityCardDefinitionLimitTimeBasedPeriod:
      type: object
      description: Time-based limit period.
      properties:
        type:
          type: string
          enum:
            - CURRENT_PERIOD
          description: Period type.
        current_period:
          type: object
          description: >-
            Current-period configuration. Present when `type` is
            `CURRENT_PERIOD`.
          properties:
            unit:
              type: string
              enum:
                - DAY
                - WEEK
                - MONTH
                - QUARTER
                - YEAR
              description: Calendar period unit.
          required:
            - unit
      required:
        - type
    RewardCostRuleConditionObjectRequest:
      type: object
      description: Condition value referencing another resource, e.g. a customer segment.
      properties:
        id:
          type: string
          description: Unique identifier of the referenced resource.
        object:
          type: string
          description: Type of the referenced resource, e.g. `segment`.
        source_id:
          type:
            - string
            - 'null'
          description: Source identifier of the referenced resource.
        type:
          type:
            - string
            - 'null'
          description: Subtype of the referenced resource.
      additionalProperties: false
    CardDefinitionSpendingLimitsGlobalTimeBasedCurrentPeriodInput:
      description: Calendar period unit used to reset the time-based spending limit.
      allOf:
        - $ref: '#/components/schemas/CardDefinitionTimeBasedCurrentPeriodInput'
      unevaluatedProperties: false
    CardDefinitionTimeBasedCurrentPeriodInput:
      type: object
      properties:
        unit:
          type: string
          enum:
            - DAY
            - WEEK
            - MONTH
            - QUARTER
            - YEAR
          description: Calendar period unit.
      required:
        - unit
  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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.