Use or cancel a redemption

Mark a reward code as used when the reward is handed over, or cancel it to give the balance back to the card.

Endpoint

PATCH
/loyalty-redemptions/:id

Request

Response

json

Body parameters

NameTypeRequiredDescription
statusStringYesused or cancelled
order_idNumberNoWith used: ID of the order where the code was applied

Behavior

  • used only works on an issued code that has not expired. Marking an already used code as used again returns it unchanged. The update is atomic, so the same code cannot be used twice.
  • cancelled is meant for issued codes: it gives the cost back to the card balance (a reversal transaction) and returns the reward stock. Cancelling an already cancelled code returns it unchanged.
  • Other fields cannot be changed.

Errors

MessageCause
This code has expiredused on a code past its expires_at
This code is cancelled / This code is expiredused on a code that is not issued
This code was already usedAnother request used it at the same time
A used code cannot be cancelledcancelled on a used code
Only status used or cancelled can be setAny other status
Redemption not found (404)Unknown ID

Report an issue with this documentation

Please log in to report issues with our documentation.