Cancel a redemption
POST/v1/redemptions/{id}/cancel
Releases the hold: held points go back, and a wallet item or unique code is available again. Call it when payment fails, the guest leaves checkout or switches rewards. The app can call it with its member token, so a hold is released even when the guest closes the payment screen before your server hears about it. If you don't cancel, the hold expires by itself after 15 minutes, and until then the guest can't use that reward anywhere else. Below, Maya first chose WELCOME10, then switched to the pastry, so your server cancels the code's hold before creating the new one.
Permissions: Secret key with checkout:write, or a member token for its own member's redemptions.
Guide
Checkout and ordersRequest headers#
Idempotency-KeystringAny string up to 255 characters; use a UUID v4. Kept 24 hours per key (or member) and endpoint. Same key and body replays the first response withIdempotent-Replayed: true.Max Length 255
Path parameters#
idstring (uuid)Required
Response fields#
Returns 200 with Redemption
idstring (uuid)Send it inredemption_idson the order.statusstringSee Redemption statuses.One ofreserved,captured,canceled,expired,reversedmember_idstring (uuid)Nullablenullfor a guest code.reward_idstring (uuid)NullableWhat was redeemed. One is set.wallet_item_idstring (uuid)NullableWhat was redeemed. One is set.codestringNullableWhat was redeemed. One is set.discount_centsintegerThe discount on the cart it was created for.Min 0points_costintegerPoints held, then spent on capture.0for wallet items and codes.affected_line_idsarray of stringCart lines the discount applies to.order_idstring (uuid)NullableThe order that captured it.expires_atstring (date-time)End of the hold, 15 minutes after creation.created_atstring (date-time)
Error descriptions#
No redemption with this id in your brand.
The redemption is already captured, canceled or expired. To undo a captured one, refund the order.
Any endpoint can also return the common errors.