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

# Refund.fetchByVid

The `fetchByVid` method returns a `Refund` object whose VID matches the input.

The VID is assigned by Subscribe when creating a new `Refund` object, in response to a refund issued with a `report()` or `perform()` call, or through the Subscribe Portal. When constructing a `Refund` object to pass into a `report()` or `perform()call`, leave the `VID` field blank so that Subscribe can assign the object a VID when it adds the object to the database. The VID is available in the `Refund` object returned to you.

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

*vid*: the `Refund` object’s Vindicia unique identifier, which serves as the search criterion.

## Output

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

*refund*: the `Refund` object whose VID matches the input.

## Returns

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

| Return Code | Return String |
| - | - |
| `400` | `No VID specified to load refund by.` |
| `404` | One of the following: - `Unable to load refund: No match for VID` *input-vid*. - `Unable to load refund by VID` *input-vid: error-description*. |

## Example

```

$vid='cdbdab93f509e2bf8c6d0e7918b0cee2e03cc175'

$refund = new Refund();

$response = $refund->fetchByVid($vid);

if($response['returnCode'] == 200) {
   $fetchedRef = $response['data']->refund;

   // process fetched refunds here
   if ($fetchedRef != null) {
      print "Refund VID " . $fetchedRef->getVID();
      print "Refund amount ". $fetchedRef->getAmount();
      print "Refund timestamp ". $fetchedRef->getTimestamp();
   }
}
```

**Parent topic:**[Refund Methods](../topics/Refund_Methods)


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