Skip to main content
Vindicia Knowledge Center

AutoBill.fetchDeltaSince

AutoBill.fetchDeltaSince

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 CashBox 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 inStopped 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 theEntitlement 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 CashBox 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.

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

Value

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 Standard Return Codes, 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","merchantAutoBillId"]}';
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);

For Users

Learn More
For Users

Cashbox Features

Learn More
Cashbox Features
Back to Top