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

# Pay for an order with points

> Pays for an order using points from the specified member loyalty card. The payment amount and points to spend are calculated from the card definition's pay-with-points exchange ratio formula, capped by the card balance and the optional `payment_limit`.

Requires an `ACTIVE` program, an `ACTIVE` member, and a card definition with pay-with-points enabled, and a configured exchange ratio formula. Also, it requires an existing order in Voucherify with order `id` or order `source_id`.

Modes:
- `TRANSACTION` (default) — creates a `PENDING` order transaction (and an underlying card transaction) processed asynchronously. Returns HTTP `202`.
- `DRY_RUN` — simulates the payment without creating any transaction. Returns HTTP `200` with a `SIMULATED` transaction payload.



## OpenAPI

````yaml /openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/members/{memberId}/orders/payments
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/programs/{programId}/members/{memberId}/orders/payments:
    parameters:
      - name: programId
        in: path
        required: true
        description: >-
          Identifies the loyalty program (`lprg_` followed by hexadecimal
          characters).
        schema:
          type: string
          pattern: ^lprg_[a-f0-9]+$
      - name: memberId
        in: path
        required: true
        description: Identifies the program member (`lmbr_[a-f0-9]+`).
        schema:
          type: string
          pattern: ^lmbr_[a-f0-9]+$
    post:
      tags:
        - Programs
      summary: Pay for an order with points
      description: >-
        Pays for an order using points from the specified member loyalty card.
        The payment amount and points to spend are calculated from the card
        definition's pay-with-points exchange ratio formula, capped by the card
        balance and the optional `payment_limit`.


        Requires an `ACTIVE` program, an `ACTIVE` member, and a card definition
        with pay-with-points enabled, and a configured exchange ratio formula.
        Also, it requires an existing order in Voucherify with order `id` or
        order `source_id`.


        Modes:

        - `TRANSACTION` (default) — creates a `PENDING` order transaction (and
        an underlying card transaction) processed asynchronously. Returns HTTP
        `202`.

        - `DRY_RUN` — simulates the payment without creating any transaction.
        Returns HTTP `200` with a `SIMULATED` transaction payload.
      operationId: createMemberOrderPayment
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderPaymentCreateRequest'
            examples:
              Card balance type:
                value:
                  payment_limit:
                    type: CARD_BALANCE
                  mode: TRANSACTION
                  card_id: lcrd_128f962dbd8c4ba5e1
                  order:
                    id: ord_12b4cdf5f30c158825
              Point limit type:
                value:
                  payment_limit:
                    type: POINTS_LIMIT
                    points_limit:
                      max: 150
                  mode: TRANSACTION
                  card_id: lcrd_128f962dbd8c4ba5e1
                  order:
                    id: ord_12b4cdf5f30c158825
              Amount limit type:
                value:
                  payment_limit:
                    type: AMOUNT_LIMIT
                    amount_limit:
                      max: 2000
                  mode: TRANSACTION
                  card_id: lcrd_128f962dbd8c4ba5e1
                  order:
                    id: ord_12b4cdf5f30c158825
      responses:
        '200':
          description: >-
            Dry run result (mode `DRY_RUN`). No transaction was created; the
            returned transaction has status `SIMULATED` and no `id`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderPaymentCreateResponse'
              examples:
                'Dry run: Point limit':
                  value:
                    transaction:
                      program_id: lprg_128f58429f4c4bf7b2
                      member_id: lmbr_128f962dbc8c4ba5dc
                      card_id: lcrd_128f962dbd8c4ba5e1
                      card_definition_id: lcdef_128f4a88414c4bed69
                      card_transaction_id: null
                      order_id: ord_12b4cdf5f30c158825
                      status: SIMULATED
                      type: PAY_WITH_POINTS
                      details:
                        reason: Points spent on order payment
                        rejection: null
                        metadata:
                          points_limit: 150
                        payment:
                          amount: 150
                          points_spent: 150
                          exchange_ratio: 1
                      updated_at: null
                      object: order_transaction
                    status: DRY_RUN
                    message: >-
                      Dry run mode. No transaction was created. This is only a
                      simulation.
                'Dry run: Amount limit':
                  value:
                    transaction:
                      program_id: lprg_128f58429f4c4bf7b2
                      member_id: lmbr_128f962dbc8c4ba5dc
                      card_id: lcrd_128f962dbd8c4ba5e1
                      card_definition_id: lcdef_128f4a88414c4bed69
                      card_transaction_id: null
                      order_id: ord_12b4cdf5f30c158825
                      status: SIMULATED
                      type: PAY_WITH_POINTS
                      details:
                        reason: Points spent on order payment
                        rejection: null
                        metadata:
                          amount_limit: 2000
                        payment:
                          amount: 650
                          points_spent: 650
                          exchange_ratio: 1
                      updated_at: null
                      object: order_transaction
                    status: DRY_RUN
                    message: >-
                      Dry run mode. No transaction was created. This is only a
                      simulation.
                'Dry run: Card balance':
                  value:
                    transaction:
                      program_id: lprg_128f58429f4c4bf7b2
                      member_id: lmbr_128f962dbc8c4ba5dc
                      card_id: lcrd_128f962dbd8c4ba5e1
                      card_definition_id: lcdef_128f4a88414c4bed69
                      card_transaction_id: null
                      order_id: ord_12b4cdf5f30c158825
                      status: SIMULATED
                      type: PAY_WITH_POINTS
                      details:
                        reason: Points spent on order payment
                        rejection: null
                        metadata: {}
                        payment:
                          amount: 650
                          points_spent: 650
                          exchange_ratio: 1
                      updated_at: null
                      object: order_transaction
                    status: DRY_RUN
                    message: >-
                      Dry run mode. No transaction was created. This is only a
                      simulation.
        '202':
          description: >-
            Payment accepted (mode `TRANSACTION`). A `PENDING` order transaction
            was created and will be processed asynchronously.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderPaymentCreateResponse'
              examples:
                'Transaction created: Point limit':
                  value:
                    transaction:
                      id: lotx_12b884c72b0dd352b9
                      program_id: lprg_128f58429f4c4bf7b2
                      member_id: lmbr_128f962dbc8c4ba5dc
                      card_id: lcrd_128f962dbd8c4ba5e1
                      card_definition_id: lcdef_128f4a88414c4bed69
                      card_transaction_id: lctx_12b884c72b0dd352b8
                      order_id: ord_12b4cdf5f30c158825
                      status: PENDING
                      type: PAY_WITH_POINTS
                      details:
                        reason: Points spent on order payment
                        rejection: null
                        metadata:
                          points_limit: 12
                        payment:
                          amount: 12
                          points_spent: 12
                          exchange_ratio: 1
                      created_at: '2026-07-13T11:01:23.245Z'
                      updated_at: null
                      object: order_transaction
                    status: TRANSACTION_CREATED
                    message: Pay with points transaction created
                'Transaction created: Amount limit':
                  value:
                    transaction:
                      id: lotx_12b8939fd78dd3657f
                      program_id: lprg_128f58429f4c4bf7b2
                      member_id: lmbr_128f962dbc8c4ba5dc
                      card_id: lcrd_128f962dbd8c4ba5e1
                      card_definition_id: lcdef_128f4a88414c4bed69
                      card_transaction_id: lctx_12b8939fd78dd3657e
                      order_id: ord_12b4cdf5f30c158825
                      status: PENDING
                      type: PAY_WITH_POINTS
                      details:
                        reason: Points spent on order payment
                        rejection: null
                        metadata:
                          amount_limit: 2000
                        payment:
                          amount: 2000
                          points_spent: 2000
                          exchange_ratio: 1
                      created_at: '2026-07-13T12:06:15.135Z'
                      updated_at: null
                      object: order_transaction
                    status: TRANSACTION_CREATED
                    message: Pay with points transaction created
                'Transaction created: Card balance':
                  value:
                    transaction:
                      id: lotx_12b8861fdd0dd35462
                      program_id: lprg_128f58429f4c4bf7b2
                      member_id: lmbr_128f962dbc8c4ba5dc
                      card_id: lcrd_128f962dbd8c4ba5e1
                      card_definition_id: lcdef_128f4a88414c4bed69
                      card_transaction_id: lctx_12b8861fdd0dd35461
                      order_id: ord_12b4cdf5f30c158825
                      status: PENDING
                      type: PAY_WITH_POINTS
                      details:
                        reason: Points spent on order payment
                        rejection: null
                        metadata: {}
                        payment:
                          amount: 200
                          points_spent: 200
                          exchange_ratio: 1
                      created_at: '2026-07-13T11:07:16.212Z'
                      updated_at: null
                      object: order_transaction
                    status: TRANSACTION_CREATED
                    message: Pay with points transaction created
        '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'
              examples:
                Card not found:
                  value:
                    code: 404
                    key: not_found
                    message: Resource not found
                    details: Cannot find card with id lcrd_128f962bd8c4ba5e1
                    request_id: v-12cc33659a5a39c1f1
                    resource_id: lcrd_128f962bd8c4ba5e1
                    resource_type: card
                Member not found:
                  value:
                    code: 404
                    key: not_found
                    message: Resource not found
                    details: Cannot find member with id lmbr_128f962db8c4ba5dc
                    request_id: v-12cc3350135a39c1c3
                    resource_id: lmbr_128f962db8c4ba5dc
                    resource_type: member
                Order not found:
                  value:
                    code: 404
                    key: not_found
                    message: Resource not found
                    details: Cannot find order with id ord_12b4cdf5f30c58825
                    request_id: v-12cc3377e7da39c211
                    resource_id: ord_12b4cdf5f30c58825
                    resource_type: order
                Program not found:
                  value:
                    code: 404
                    key: not_found
                    message: Resource not found
                    details: Cannot find program with id lprg_128f5849f4c4bf7b2
                    request_id: v-12cc332f6fda39c18b
                    resource_id: lprg_128f5849f4c4bf7b2
                    resource_type: program
        '423':
          description: Card balance is zero or the resource state blocks the payment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Zero card balance:
                  value:
                    code: 423
                    key: zero_card_balance
                    message: Card balance is zero
                    details: Operation requires a positive card balance
                    request_id: v-12b8894b3ec1a59873
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    OrderPaymentCreateRequest:
      type: object
      description: Request body for paying for an order with points.
      properties:
        card_id:
          type: string
          description: >-
            Unique identifier of the member's loyalty card to spend points from
            (format `lcrd_...`).
        order:
          $ref: '#/components/schemas/OrderPaymentOrder'
        payment_limit:
          description: >-
            Optional payment limit. When omitted, the default `CARD_BALANCE`
            limit is applied (spend up to the card balance).
          oneOf:
            - $ref: '#/components/schemas/OrderPaymentLimit'
            - type: 'null'
        mode:
          description: >-
            Payment mode. `TRANSACTION` creates a PENDING order transaction
            processed asynchronously (HTTP 202). `DRY_RUN` only simulates the
            payment and returns the calculation result (HTTP 200); no
            transaction is created. Defaults to `TRANSACTION` when omitted or
            `null`.
          oneOf:
            - type: string
              enum:
                - TRANSACTION
                - DRY_RUN
            - type: 'null'
      required:
        - card_id
        - order
      additionalProperties: false
    OrderPaymentCreateResponse:
      type: object
      description: Result of a pay-with-points request.
      properties:
        transaction:
          description: The created (or simulated) order transaction.
          oneOf:
            - $ref: '#/components/schemas/OrderPaymentTransaction'
            - type: 'null'
        status:
          type: string
          enum:
            - TRANSACTION_CREATED
            - DRY_RUN
          description: >-
            Result status. `TRANSACTION_CREATED` for `TRANSACTION` mode,
            `DRY_RUN` for dry-run mode.
        message:
          type: string
          description: >-
            Human-readable result message. `TRANSACTION` mode: "Pay with points
            transaction created". `DRY_RUN` mode: "Dry run mode. No transaction
            was created. This is only a simulation.".
    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.
    OrderPaymentOrder:
      type: object
      description: >-
        Reference to the order being paid. At least one of `id` or `source_id`
        must be provided.
      properties:
        id:
          description: Voucherify order identifier.
          oneOf:
            - type: string
              pattern: ^ord_[a-f0-9]+$
            - type: 'null'
        source_id:
          description: External (source) order identifier.
          oneOf:
            - type: string
              minLength: 1
            - type: 'null'
      additionalProperties: false
    OrderPaymentLimit:
      type: object
      description: >-
        Payment limit. Discriminated by `type`: `CARD_BALANCE` — spend up to the
        card balance (no additional properties required); `POINTS_LIMIT` — cap
        the number of points spent (requires `points_limit`); `AMOUNT_LIMIT` —
        cap the paid amount (requires `amount_limit`).
      properties:
        type:
          type: string
          enum:
            - CARD_BALANCE
            - POINTS_LIMIT
            - AMOUNT_LIMIT
          description: Payment limit type.
        points_limit:
          description: >-
            Maximum number of points to spend. Required when `type` is
            `POINTS_LIMIT`.
          oneOf:
            - $ref: '#/components/schemas/OrderPaymentLimitDefinition'
            - type: 'null'
        amount_limit:
          description: Maximum amount to pay. Required when `type` is `AMOUNT_LIMIT`.
          oneOf:
            - $ref: '#/components/schemas/OrderPaymentLimitDefinition'
            - type: 'null'
      required:
        - type
      additionalProperties: false
      oneOf:
        - properties:
            type:
              const: CARD_BALANCE
        - required:
            - points_limit
          properties:
            type:
              const: POINTS_LIMIT
            points_limit:
              $ref: '#/components/schemas/OrderPaymentLimitDefinition'
        - required:
            - amount_limit
          properties:
            type:
              const: AMOUNT_LIMIT
            amount_limit:
              $ref: '#/components/schemas/OrderPaymentLimitDefinition'
    OrderPaymentTransaction:
      type: object
      description: >-
        An order transaction representing a pay-with-points payment. List
        endpoints return only persisted transactions; `SIMULATED` appears only
        on dry-run create responses.
      properties:
        id:
          type: string
          description: >-
            Identifies the order transaction (`lotx_...`). Absent on dry-run
            (`SIMULATED`) create responses, which are never persisted. Always
            present in list responses.
        program_id:
          type: string
          description: Unique identifier of the loyalty program (format `lprg_...`).
        member_id:
          type: string
          description: Unique identifier of the program member (format `lmbr_...`).
        card_id:
          type: string
          description: >-
            Unique identifier of the loyalty card the points were spent from
            (format `lcrd_...`).
        card_definition_id:
          type: string
          description: Unique identifier of the card definition (format `lcdef_...`).
        card_transaction_id:
          type:
            - string
            - 'null'
          description: >-
            Unique identifier of the underlying card transaction (format
            `lctx_...`). `null` for DRY_RUN (SIMULATED) transactions.
        order_id:
          type: string
          description: Unique identifier of the paid order (format `ord_...`).
        status:
          type: string
          enum:
            - PENDING
            - PROCESSING
            - APPROVED
            - REJECTED
            - SIMULATED
          description: >-
            Transaction status. `PENDING` — created, awaiting processing;
            `PROCESSING` — being processed; `APPROVED` — completed successfully;
            `REJECTED` — rejected (see `details.rejection`); `SIMULATED` —
            dry-run create result, not persisted (not returned by list).
        type:
          type: string
          enum:
            - PAY_WITH_POINTS
          description: Defines the transaction type. Always `PAY_WITH_POINTS`.
        details:
          description: Transaction details for the `PAY_WITH_POINTS` type.
          oneOf:
            - $ref: '#/components/schemas/OrderPaymentTransactionDetails'
            - type: 'null'
        created_at:
          type: string
          format: date-time
          description: Timestamp when the transaction was created (ISO 8601).
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Timestamp when the transaction was last updated (ISO 8601), or
            `null`.
        object:
          type: string
          const: order_transaction
          description: Object type marker. Always `order_transaction`.
    OrderPaymentLimitDefinition:
      type: object
      description: Definition of a payment limit value.
      properties:
        max:
          type: integer
          minimum: 1
          description: Maximum value of the limit.
      required:
        - max
      additionalProperties: false
    OrderPaymentTransactionDetails:
      type: object
      description: Details of a `PAY_WITH_POINTS` order transaction.
      properties:
        reason:
          type: string
          description: 'Human-readable reason: "Points spent on order payment".'
        rejection:
          description: Rejection details, present when the transaction was rejected.
          oneOf:
            - $ref: '#/components/schemas/OrderPaymentRejection'
            - type: 'null'
        metadata:
          type: object
          description: >-
            Transaction metadata. For pay-with-points transactions this contains
            the flattened payment limits used for the calculation:
            `amount_limit` and/or `points_limit` (omitted when the default
            `CARD_BALANCE` limit was used). Empty object when not set.
          properties:
            amount_limit:
              type: integer
              description: Maximum amount limit applied to the payment (if any).
            points_limit:
              type: integer
              description: Maximum points limit applied to the payment (if any).
          additionalProperties: true
        payment:
          $ref: '#/components/schemas/OrderPaymentPaymentDetails'
    OrderPaymentRejection:
      type: object
      description: Rejection details for a rejected order payment transaction.
      properties:
        reason:
          type: string
          description: >-
            Machine-readable rejection reason. Order-side: `ORDER_NOT_FOUND`,
            `PAYMENT_EXCEEDS_ORDER_TOTAL_AMOUNT`. Card-side (when the linked
            card transaction fails first): `NOT_ENOUGH_BALANCE`,
            `GLOBAL_SPENDING_LIMIT_EXCEEDED`,
            `TRANSACTION_SPENDING_LIMIT_EXCEEDED`.
        details:
          description: >-
            Structured rejection context. Omitted when the reason carries no
            extra data (`ORDER_NOT_FOUND`, `PAYMENT_EXCEEDS_ORDER_TOTAL_AMOUNT`,
            `NOT_ENOUGH_BALANCE`). For `GLOBAL_SPENDING_LIMIT_EXCEEDED`: `type`,
            `limit`, `spendings`. For `TRANSACTION_SPENDING_LIMIT_EXCEEDED`:
            `type`, `limit`.
          oneOf:
            - type: object
              additionalProperties: true
              properties:
                type:
                  type: string
                  description: Spending cap type that was exceeded.
                limit:
                  type: number
                  description: Configured spending limit.
                spendings:
                  type: number
                  description: >-
                    Projected total spendings that exceeded the limit. Present
                    for `GLOBAL_SPENDING_LIMIT_EXCEEDED`.
            - type: 'null'
    OrderPaymentPaymentDetails:
      type: object
      description: Payment calculation details.
      properties:
        id:
          type: string
          description: Payment identifier. Omitted when not set.
        amount:
          type: number
          description: Amount of the order paid with points.
        points_spent:
          type: number
          description: Number of points spent on the payment.
        exchange_ratio:
          type: number
          description: >-
            Points-to-amount exchange ratio evaluated from the card definition's
            pay-with-points formula.
  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

````