Programs

Purchase reward with points

Changed on

Purchases a reward for the program member by spending points from the member's card. The card comes from the matching reward cost's card definition.

The program, reward, and member must be ACTIVE. The program and reward must be inside their validity windows. The reward must be assigned to the program with stock available, a cost must match the customer, and the purchase must stay inside frequency, cooldown, balance, and spending limits.

Modes:

  • TRANSACTION (default): creates a PENDING reward transaction and a PENDING card transaction. Returns 202.
  • DRY_RUN: simulates the purchase and doesn't create a transaction. Returns 200 with status SIMULATED.
post/v2/loyalties/programs/{programId}/members/{memberId}/rewards/purchases

Request

  • Base URL
    https://api.voucherify.io
  • URL
    https://api.voucherify.io/v2/loyalties/programs/{programId}/members/{memberId}/rewards/purchases
  • Auth
    • API key in header X-App-Id and API key in header X-App-Token
    • or HTTP bearer

Request body

reward_idstring required

Unique identifier of the reward to purchase (format lrew_...).

mode'TRANSACTION' | 'DRY_RUN'

Purchase mode. TRANSACTION creates a PENDING reward transaction processed asynchronously (HTTP 202). DRY_RUN only simulates the purchase and returns the calculation result (HTTP 200); no transaction is created. Defaults to TRANSACTION when omitted.

Response

Dry run result (mode DRY_RUN). No transaction was created; the returned transaction has status SIMULATED and no id.

status'DRY_RUN' required

Result status. Always DRY_RUN for the dry-run mode.

messagestring required

Human-readable result message. DRY_RUN mode: "Dry run mode. No transaction was created. This is only a simulation.".

Changes

    • breaking

      added to the request body allOf list

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • warning

      removed the request property

    • warning

      removed the request property

    • info

      added to the response body allOf list for the response status

    • info

      added to the response body allOf list for the response status

    • breaking

      added the new required request property

    • warning

      removed from the request body allOf list

    • info

      added the new optional request property

    • info

      removed from the response body allOf list for the response status

    • info

      removed from the response body allOf list for the response status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status