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
| Name | Type | Required | Description |
|---|---|---|---|
status | String | Yes | used or cancelled |
order_id | Number | No | With used: ID of the order where the code was applied |
Behavior
usedonly works on anissuedcode 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.cancelledis meant forissuedcodes: it gives thecostback to the card balance (areversaltransaction) and returns the reward stock. Cancelling an already cancelled code returns it unchanged.- Other fields cannot be changed.
Errors
| Message | Cause |
|---|---|
This code has expired | used on a code past its expires_at |
This code is cancelled / This code is expired | used on a code that is not issued |
This code was already used | Another request used it at the same time |
A used code cannot be cancelled | cancelled on a used code |
Only status used or cancelled can be set | Any other status |
Redemption not found (404) | Unknown ID |
Report an issue with this documentation
Please log in to report issues with our documentation.