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

# AutoBill.fetchDeltaSince

The `fetchDeltaSince` method returns one or more `AutoBill` objects whose Status has changed since a time stamp you specify. Call this method to find out which `AutoBill` objects are still active and which are not. AutoBills can become inactive for several reasons, including a `Hard Error` received by Subscribe while processing a payment with a payment processor, a `cancel()` call that explicitly stopped an `AutoBill` object, or a chargeback against a billing transaction generated by `AutoBill`.

This method supports paging to limit the number of records returned per call. Returning a large number of records in one call can overflow buffers and might cause a failure. Vindicia recommends that you call this method in a loop, incrementing the page for each loop iteration with an optimal page size (number of records returned in one call) until the page contains no additional records.

**Note:** Do not rely on the data returned by this method to determine a customer’s entitlements. Even if an `AutoBill` object is in `Stopped` or`Hard Error` status, the entitlements might still be valid. The entitlements are determined by the current end-date of the `AutoBill` object, which in turn is determined by the success of the last billing (transaction). Thus, the end-date indicates the period for which the customer has already paid. The customer’s subscription (`AutoBill`) may stop before the end-date, but the entitlements might remain valid until that date. The correct way to determine customer entitlements is by making calls on the `Entitlement` object.

By default, this method returns all AutoBills that have had a Status change within the timestamp parameters you specify. The `AutoBillEventType` parameter gives you the ability to selectively return AutoBills that have had changes to an array of events you specify. By tailoring returns to your needs you can greatly reduce both the volume of the return and the response time. As with the default return of Status, the Subscribe deduping functionality ensures that AutoBills with multiple events are returned only once per query.

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

*timestamp*: the date and time after which to return the `AutoBill` objects whose status has changed.

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

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

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

*endTimestamp*: the upper threshold of the time window by which to limit the search. If unspecified, this value defaults to the current time.

**Note:** To reduce high loads on the system, the maximum span for a `fetchDeltaSince()` call is 61 days. If you want to fetch an extended amount of data, best practice suggests that you do so via a loop that pulls a day’s worth of data at a time, with another loop internally that handles fetching each resultant page for that day.

*AutoBillEventType*: an array of event types you want to be notified of. Event types include the values listed in the following Enumerated Values table. If unspecified, defaults to `status_change` and `transaction`.

|   | Description |
| - | - |
| account\_updater | Autobills that have had an Account Updater event. |
| cancellation | AutoBills that have been canceled. |
| catchup\_billing | AutoBills that have experienced a Catch-up Billing. |
| chargeback | Autobills that have chargebacks received against them. |
| credit\_operation | AutoBills that have had a credit action (grant/consumption). |
| delay\_bill | AutoBills whose Billing has been delayed. |
| end | AutoBills that have ended. |
| end\_date\_change | AutoBills whose end date has been changed (high volume event). |
| expiration | AutoBills that have expired. |
| migration | AutoBills that have been migrated. |
| modification | AutoBills that have been modified. |
| non\_recurring\_transaction | AutoBills that have had a successful, associated one time Transaction executed. |
| notification | AutoBills that have generated an email Notification (high volume event). |
| payment\_method\_removed | AutoBills that have had a payment method removed. |
| payment\_method\_update | AutoBills that have had a payment method updated. |
| refund | AutoBills that have had a refund. |
| start\_date\_change | AutoBills whose start date has been changed. |
| status\_change | AutoBills that have had a Status change event.This is the default—calling `fetchDeltaSince` without the `AutoBillEventType`. |
| transaction | AutoBills that have had a successful recurring Transaction. |

## Output

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

*autobills*: an array of one or more `AutoBill` objects.

## Returns

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

| Return Code | Return String |
| - | - |
| `400` | `Invalid value or values of the time stamp, and/or page, and/or page size.` |

## Example

```

$ab = new AutoBill();
$page = 0;
$pageSize = 100;
$startTime = '2016-01-01T22:34:32.265Z';
$endTime = '2016-01-02T22:34:32.265Z';
$AutoBillEventTypes = ["status_change","chargeback"];
$srd = '{"autobills": ["VID",""]}';
do {
   $ret = $ab->fetchDeltaSince($srd, $startTime, $page, $pageSize, $endTime, 
$AutoBillEventTypes);
   $count = 0;
   if ($ret['returnCode'] == 200) {
      $fetchedAutoBills = $ret['autobills'];
      $count = sizeof($fetchedAutoBills);
      foreach ($fetchedAutoBills as $autobill) {
         // process a fetched autobill here …
      }
      $page++;
   }
} while ($count > 0); 
```

**Parent topic:**[AutoBill Methods](../topics/AutoBill_Methods)


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