Refund reward purchase
Changed onRefunds an APPROVED reward purchase made by a program member. The purchase transaction is marked REFUNDED, a new REFUND reward transaction is created with status APPROVED, and the points spent on the purchase are returned to the member's card.
The request body is optional and an empty payload is allowed. Policies default to refund: DEFAULT and stock: DEFAULT.
The endpoint responds with 202 before the card balance changes. A POINTS_RETURNED card transaction is created for the member's card and processed shortly after the response. When the member's tier or the card definition expires points, returned points receive a new expiration date from that setting. They don't inherit the expiration of the originally spent points. A NO_EXPIRATION setting leaves the returned points without an expiration date. Card earning limits don't block the refund.
For a LOYALTY_CARD_POINTS reward, the points credited to the target card are also reversed, with a POINTS_PURCHASE_REVERSED card transaction on that card. That transaction is processed shortly after the response. Its expiration is copied from the original points-purchased transaction.
A DISCOUNT_COUPONS refund deletes the issued vouchers. details.result.digital.discount_coupons[].result is DELETED, or SKIPPED when the voucher isn't deleted. A GIFT_VOUCHERS refund subtracts the credited amount. details.result.digital.gift_vouchers[].result is CREDITS_SUBTRACTED, or SKIPPED when the balance update is rejected.
The refund reverses that purchase in the reward's purchase limits for the project-local day of the original purchase. A day whose purchases are all refunded no longer counts as the member's last purchase.
Only rewards whose refunds.type is REFUNDABLE can be refunded. Any other reward is rejected with 423 and key reward_refund_policy_does_not_allow_refunds. policies.refund set to ALLOW refunds it anyway.
The program must exist, and the reward transaction must belong to that program. Otherwise the request fails with 404. The program is checked first. The request is rejected with 423 when:
- The program isn't ACTIVE (non_active_program) or is outside its validity window (program_outside_validity_window),
- The transaction isn't a purchase (non_purchase_reward_transaction) or isn't APPROVED (non_approved_reward_transaction); refunding the same purchase twice fails here,
- The reward no longer exists (reward_not_found), isn't assigned to the program (refund_reward_not_assigned_to_program), the member's card is gone (refund_card_not_found), or the card definition is gone (refund_card_definition_not_found),
- The reward type isn't supported (reward_type_not_supported_for_refunds),
- For a LOYALTY_CARD_POINTS reward, the purchase result is missing (loyalty_card_points_purchase_result_not_found), the target card is gone (loyalty_card_points_target_card_not_found), the points-purchased card transaction is missing (loyalty_card_points_purchase_not_found), the target card's available balance is lower than the purchased points (loyalty_card_points_insufficient_balance), or the target card definition is gone (loyalty_card_points_target_card_definition_not_found).
Request
- Base URLhttps://api.voucherify.io
- URLhttps://api.voucherify.io/v2/loyalties/programs/{programId}/rewards/purchases/{rewardTransactionId}/refund
- Auth
- API key in header X-App-Id and API key in header X-App-Token
- or HTTP bearer
Request body
Response
Refund accepted. The refund reward transaction has been created with status APPROVED and points will be returned to the member's card asynchronously.
Changes
- breaking
the
////response's property type changed fromobjectto no type for status - warning
removed the optional property
/////from the response with the status - warning
removed the optional property
/////from the response with the status - warning
removed the optional property
/////from the response with the status - warning
removed the optional property
/////from the response with the status - warning
removed the optional property
/////from the response with the status - warning
removed the optional property
/////from the response with the status - warning
removed the optional property
/////from the response with the status - warning
removed the optional property
/////from the response with the status - warning
removed the optional property
/////from the response with the status - warning
removed the optional property
/////from the response with the status - warning
removed the optional property
/////from the response with the status - warning
removed the optional property
/////from the response with the status - warning
removed the optional property
/////from the response with the status - info
added
subschema #2to the////response propertyallOflist for the response status
- breaking
- breaking
the
////response's property type changed from no type toobjectfor status - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status - info
removed
subschema #2from the////response propertyallOflist for the response status
- breaking