# Reverse Redemption
source: https://developer.mastercard.com/digital-redemptions/documentation/use-cases/redemptions/reverse-redemption/index.md

## Overview {#overview}

This use case allows a previous redemption to be reversed and replace points back to 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.

## 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"
}
```

