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

# Transaction.fetchDeltaSince

The `fetchDeltaSince` method returns one or more `Transaction` objects whose status has changed since the specified time stamp. Call this method to programmatically and periodically download Transactions from Vindicia for reconciliation with the payments deposited into your bank account by your payment processor, especially if you use Subscribe for recurring billing only. In that case, because Subscribe generates and processes all your transactions with your payment processor, you (may) have no records of them. For record-keeping, reporting, or any other purpose, periodically synchronize your database with the Transactions in the Vindicia database by calling this method.

Vindicia recommends that you call this method at regular intervals, and make note of the date and time, so that you can specify that as the time stamp for your next call. The appropriate interval for the calls depends on your transaction volume. If your volume is large, call this method more often to limit the amount of data you receive. You may also further filter and limit the number of transactions returned by specifying a payment method as another search criterion.

The `fetchDeltaSince` method supports paging to limit the number of records returned per call. Returning a large number of records in one call may swamp 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 a number of records that is less than the given page size.

You may also download transaction-related reports from the Subscribe Portal. See the Subscribe User’s Guide for details.

## 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*: a time stamp that specifies the date and time on or after which the `Transaction` objects have changed status.

*endTimestamp*: a time stamp that specifies the upper limit of the date and time before which the `Transaction` objects have changed status.

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

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

*paymentMethod*: a `PaymentMethod` object, an optional constraint that, if specified, restricts retrieval to only those `Transaction` objects whose source payment method matches the input. Identify the `PaymentMethod` with its VID or your payment method ID (`merchantPaymentMethodId`).

## Output

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

*transactions*: an array of one or more `Transaction` objects whose status has changed since the specified time stamp but before *endTimestamp*, if specified, and that use *paymentMethod*, if specified.

## 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: - `Invalid Arguments - Must specify a valid payment method type, if using that option.` - `Must specify a time stamp to find transactions newer than …` |
| `404` | `Not Found - No match found for the Payment Method.` |

## Example

```

$soap_tx = new Transaction();
$page = 0;
$pageSize = 50;
 
// Fetch transactions that have changed in status since the last time 
// this call was run. Assume we have a function available to us that 
// gives us the time stamp when the last time we ran this call.
 
$since = getLastCallTime(); 
do {
   // we will not filter returned transactions by end time stamp 
   // and payment method
   $ret = $soap_tx->fetchDeltaSince($since, null, $page, 
      $pageSize, null);
   $count = 0;
   if ($ret['returnCode'] == 200) {
      $fetchedTxns = $ret['transactions'];
      if ($fetchedTxns != null) {
         $count = sizeof($fetchedTxns);
         foreach ($fetchedTxns as $fetchedTx) {
 
         // process a fetched transaction here …
         $status = $fetchedTx->statusLog[0]->status;
         $transactionId = 
         $fetchedTx->getMerchantTransactionId();
         $amount = $fetchedTx->getAmount();
         }
         $page++;
      }
   }
} while ($count > 0);
```

**Parent topic:**[Transaction Methods](../topics/Transaction_Methods)


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