A valid request URL is required to generate request examples{
"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."
}Pay for 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:
ACTIVEprogram;ACTIVEmember;- Card definition with pay-with-points enabled and a configured exchange ratio formula;
- Existing order in Voucherify with order
idor ordersource_id.
Modes:
TRANSACTION(default): Creates aPENDINGorder transaction (and an underlying card transaction) processed asynchronously. Returns HTTP202. Sending a request for the same orderidorsource_idcreates a new transaction each time.DRY_RUN: Simulates the payment without creating any transaction. Returns HTTP200with aSIMULATEDtransaction payload.
curl --request POST \
--url {protocol}://{host}/v2/loyalties/programs/{programId}/members/{memberId}/orders/payments \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"payment_limit": {
"type": "CARD_BALANCE"
},
"mode": "TRANSACTION",
"card_id": "lcrd_128f962dbd8c4ba5e1",
"order": {
"id": "ord_12b4cdf5f30c158825"
}
}
'{
"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."
}Authorizations
Path Parameters
Identifies the loyalty program (lprg_ followed by hexadecimal characters).
^lprg_[a-f0-9]+$Identifies the program member (lmbr_[a-f0-9]+).
^lmbr_[a-f0-9]+$Body
Request body for paying for an order with points.
Unique identifier of the member's loyalty card to spend points from (format lcrd_...).
Reference to the order being paid. The order must already exist in the Voucherify system. At least one of id or source_id must be provided.
Show child attributes
Show child attributes
Optional payment limit. When omitted, the default CARD_BALANCE limit is applied (spend up to the card balance).
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
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.
TRANSACTION, DRY_RUN Response
Dry run result (mode DRY_RUN). No transaction was created; the returned transaction has status SIMULATED and no id.
Result of a pay-with-points request.
An order transaction representing a pay-with-points SIMULATED payment.
Show child attributes
Show child attributes
Result status. DRY_RUN for dry-run mode.
DRY_RUN Human-readable result message. DRY_RUN mode: "Dry run mode. No transaction was created. This is only a simulation.".
Was this page helpful?

