unPLUGDevelopers

Checkouts and redemptions API

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.

Request headers#

  • Idempotency-Keystring
    Any 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 with Idempotent-Replayed: true.
    Max Length 255

Path parameters#

  • idstring (uuid)Required

Response fields#

Returns 200 with Redemption

  • idstring (uuid)
    Send it in redemption_ids on the order.
  • statusstring
    One of reserved, captured, canceled, expired, reversed
  • member_idstring (uuid)Nullable
    null for a guest code.
  • reward_idstring (uuid)Nullable
    What was redeemed. One is set.
  • wallet_item_idstring (uuid)Nullable
    What was redeemed. One is set.
  • codestringNullable
    What was redeemed. One is set.
  • discount_centsinteger
    The discount on the cart it was created for.
    Min 0
  • points_costinteger
    Points held, then spent on capture. 0 for wallet items and codes.
  • affected_line_idsarray of string
    Cart lines the discount applies to.
  • order_idstring (uuid)Nullable
    The order that captured it.
  • expires_atstring (date-time)
    End of the hold, 15 minutes after creation.
  • created_atstring (date-time)

Error descriptions#

404Not found
not_found

No redemption with this id in your brand.

409Conflict
redemption_not_reserved

The redemption is already captured, canceled or expired. To undo a captured one, refund the order.

Any endpoint can also return the common errors.