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

# fetchChargebacks

Returns a list of `Chargeback` objects that have changed status since the input *timestamps*. Paging is supported using *page* and *pageSize*. Continue calling the function until the length of the resulting array is 0.

**Note:** Vindicia Retain requires that input parameters be entered in the order shown, and place-marked with null if not specified.

## Input

*timestamp*: the starting timestamp (lower limit) for the range of `Chargebacks` you want to retrieve.

*endTimestamp*: the ending timestamp (upper limit) for the range of `Chargebacks` you want to retrieve. A null end time stamp defaults to *now* (the current time).

*page*: the page number, starting at 0, for which to return results. For example, if the total number of results is 85 and *pageSize* is 10:

* Specifying 0 for *page* returns results from page 1 through 10.
* Specifying 2 for *page* returns results from page 21 through 30.

*pageSize*: the number of records to display per page per call. This value must be greater than 0.

## Output

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

*chargebacks*: an array of `Chargeback` objects that were updated during the time period specified in *timestamp* and *endTimestamp*.

## Returns

This method returns the codes listed in [Retain Return Codes](retain.return_codes).

## Example

```

$select = new select();
$page = 0;
$pageSize = 50;
// Assume we have a function available to us that gives us
// the timestamp for the last time we ran this call:
$since = getLastCallTime();
do {
    $ret = $select->fetchChargebacks($since, null, $page, $pageSize);
    $count = 0;
    if($ret['returnCode'] == 200)
    {
        $fetchedChargebacks = $ret['chargebacks'];
        if($fetchedChargebacks != null)
        {
            $count = sizeof($fetchedChargebacks)
            foreach ($fetchedChargebacks as $chargeback)
            {
                //Process a fetched chargeback here...
            }
            $page++;
        }
    }
    else
    {
        //Handle error condition.
    }
} while ($count == $pageSize);
```

**Parent topic:**[Vindicia Retain Methods](../topics/vindicia_retain_methods)


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