# Reverse Redemption source: https://developer.mastercard.com/digital-redemptions/documentation/use-cases/redemptions/reverse-redemption/index.md ## Overview {#overview} Use this endpoint to refund reward points when a customer cancels or returns an order that was paid with points. It reverses a previous redemption and replaces the points in their original aging status. It provides the ability to reverse ALL the points on the original redemption at a time OR partially. Partial credits will reverse points till all the points on the original redemption are returned. ### Why this endpoint {#why-this-endpoint} Use `POST /redemptions/{id}/credits` when a cardholder cancels or returns an order that was paid with points and you need to give the points back. It is a POST because each credit is a new, auditable transaction against the original redemption; it does not delete or edit the original record. Send a full credit for a cancellation and a partial credit (with `partialCreditPoints`) for a partial return. Use [Update Redemption Status](https://developer.mastercard.com/digital-redemptions/documentation/use-cases/redemptions/update-redemption-status/index.md) instead when the order is still being fulfilled and only its status has changed. Preconditions: * You hold the `redemptionId` returned by [Create Redemptions](https://developer.mastercard.com/digital-redemptions/documentation/use-cases/redemptions/post-redemptions/index.md) or found through [Get Redemptions](https://developer.mastercard.com/digital-redemptions/documentation/use-cases/redemptions/get-redemptions/index.md). * The points still to be credited do not exceed the points on the original redemption. ## Sequence diagram {#sequence-diagram} Diagram reverse-redemption ##### Following are the execution steps: {#following-are-the-execution-steps} 1. The consumer signs into the customer application. 2. The customer authenticates the consumer. 3. The customer sends a signed request to the Digital Redemptions for performing reverse a previous redemption. 4. Mastercard Network API Gateway authenticates/authorizes the customer and routes the request to the Digital Redemptions in the case of a valid customer. 5. The Digital Redemptions Service validates the request parameters received via the `POST /redemptions/{id}/credits` endpoint. 6. The Digital Redemptions Service credits the redeemed points back to a Redeemer's rewards account. 7. The Digital Redemptions Service performs reverse a previous redemption. 8. The Digital Redemptions Service sends a response with remaining point balance for the redemptionId (200). 9. The Digital Redemptions Service sends a response with a status code of 4xx/5xx in case of an invalid request. You will receive an error response for an invalid request or any missing request parameter. In that case, you need to update the input and perform step 3 again. ## Endpoint {#endpoint} API Reference: `POST /redemptions/{id}/credits` ## Scenario #1: Full credit redemption. {#scenario-1-full-credit-redemption} * The request for full credit redemption have the following mandatory request parameters. Refer to the field description on the [API reference page](https://developer.mastercard.com/digital-redemptions/documentation/api-reference/index.md) for more information. * **id** : RedemptionId value from redemption response * **user_id** : The identifier used to uniquely identify an user. * **user_id_type** : Type of the user or account identification. Supported identifier is RANAC. * **processedBy** : Mastercard Rewards System User ID created for client while onboarding. This is an ID assigned to each Merchant when onboarding to the Digital Redemptions program. * **redemptionType** : Supported redemptionType is MERCHANDISE, TRAVEL. ##### Sample request {#sample-request} ```json { "processedBy":"E078562", "redemptionType":"MERCHANDISE", "userId":"220094110178641288073796026652", "userIdType":"RANAC" } ``` ##### Sample response {#sample-response} ```json { "pointBalance": 96173827.88, "programName": "Pay With Points API", "id": "5134720" } ``` ## Scenario #2: Partial credit redemption. {#scenario-2-partial-credit-redemption} * The request for partial credit redemption have the following mandatory request parameters. Refer to the field description on the [API reference page](https://developer.mastercard.com/digital-redemptions/documentation/api-reference/index.md) for more information. * **id** : RedemptionId value from redemption response * **user_id** : The identifier used to uniquely identify an user. * **user_id_type** : Type of the user or account identification. Supported identifier is RANAC. * **processedBy** : Mastercard Rewards System User ID created for client while onboarding. This is an ID assigned to each Merchant when onboarding to the Digital Redemptions program. * **redemptionType** : Supported redemptionType is MERCHANDISE, TRAVEL. * **partialCreditPoints** : Points to be credited in case of partial reversal redemption. * Partial credits will reverse points till all the points on the original redemption are returned. * PartialCreditPoints sent in the request cannot be greater than the number of points redeemed in the original redemption. ```json { "processedBy":"E078562", "redemptionType":"MERCHANDISE", "userId":"220094110178641288073796026652", "userIdType":"RANAC", "partialCreditPoints":3 } ``` ##### Sample response {#sample-response-1} ```json { "pointBalance": 96383544.64, "partialCreditPointBalRemain": 0, "programName": "Pay With Points API", "id": "4979670" } ```