> ## 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.

# Reversing a Gift Card Redemption

A gift card must be `Active` before a successful `redeemGiftCard()` call can be made. It is possible that during your redemption attempt, due to a technical problem such as a connection drop out, the operation does not complete and the underlying `Account` or `AutoBill` does not receive any credit. If this happens, make the `redeemGiftCard()` call again.

To reverse a gift card redemption, first ensure that the status of the gift card is `Active`, in case a previous operation has (erroneously) changed the status. If the gift card is no longer `Active`, you may reverse the last operation upon it using the `GiftCard.reverse()` method.

**Note:** The purpose of this call is to correct an unwanted situation, as described above. Do not use this call to reverse a successful redemption call. It does not automatically revoke credits granted in the previous redemption call.

Reverse a Gift Card redemption:

```

// set the VID of the gift card. We obtained this when we
// inquired status of the gift card 
 
$gc->setVID($gcVID); 
 
// Now make the SOAP API call to reverse the redemption
 
$response = $gc->reverse();
 
if ($response[’returnCode’] == 200) {
 
// Reversal successful. 
// fetch the autobill against which we originally
// redeemed the gift card here.
 
// Also make sure status of the gift card is ‘Active’
 
$updatedGc = $response['data']->giftcard;
 
if($updatedGc->getStatus()->getStatus() == ‘Active’) {
 
// try redemption again here
}
}
else {
// Error while reversing the card
}
```

**Parent topic:**[Working with Gift Cards](../topics/Working_with_Gift_Cards)


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