> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slm.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GiftCard.reverse

The `reverse` method reverses a previous operation on a `GiftCard` (if the gift card processor allows it). Use `reverse` to reset the status of a gift card back to `Active` if a technical glitch occurred when you tried to redeem a gift card. `reverse` lets you retry the redemption. Do not use this method to undo the successful redemption of a gift card. This method does not automatically revoke credit from an `AutoBill` or `Account`, granted when the gift card was successfully redeemed.

## Input

*srd*: sparse response description, a SOAP string (which must be a JSON object), in which you specify the elements you want returned.This parameter enables the calling system to constrain a `method` call to return only components you specify. This gives you greater control over returned content, and improves response time within the Vindicia platform by reducing the processing needed for the call.

Some fields are required, either practically or in the WSDL, and will be returned regardless of the *srd*. A null *srd* returns the complete response.

*giftCard*: the `GiftCard` object whose status you wish to reverse. Use the `VID` attribute to specify the `GiftCard` object.

## Output

*return*: an object of type `Return` that indicates the success or failure of the call.

*giftcard*: the reversed `GiftCard` object, with updated status.

## Returns

In addition to those listed in [The Return Object](The_Return_Object), this call returns:

| Return Code | Return String |
| - | - |
| `400` | One of the following: - `Failed to retrieve gift card *error-description*.` - `Reversal attempt failed *error-description*.` - `Reversal attempt rejected by GiftCard Processor.` |

## Example

```

$gc = new GiftCard();

// set the gift card VID. obtained when checking the gift card status

$gc->setVID($gcVID); 

// Now make the SOAP API call to reverse the redemption

$response = $gc->reverse();

if ($response->['returnCode'] == 200) {

   // Also make sure the status of the gift card is 'Active'
   $updatedGc = $response['data']->giftcard;
   if ($updatedGc->getStatus()->getStatus() == 'Active') {
      print “Gift card is now redeemable \n”;
   }
}
else {
   // Error while reversing the card
   print "Return code: " . $response['returnCode'];
   print " Return string: ";
   print $response['returnString'] . "\n";
}
```

**Parent topic:**[GiftCard Methods](../topics/GiftCard_Methods)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.