Skip to main content
Vindicia Knowledge Center

AutoBill.cancel

AutoBill.cancel

AutoBill.cancel

The cancel method cancels a subscription (AutoBill).

A cancelled AutoBill object no longer generates periodic billing transactions. However, if CashBox has already picked up a current billing transaction to send to your payment processor, this call does not cancel the transaction, and you might choose to refund it later.

With this method, you may cancel an AutoBill object within the minimum commitment period by enabling the force option.

Cancelling an AutoBill does not automatically disentitle the customer immediately. Calling cancel on an AutoBill allows entitlement to continue, as determined by the last successful billing. If you wish to disentitle immediately upon cancellation of the AutoBill, set the disentitle flag to true.

Cancelling an AutoBill before the minimum commitment period is over will stop the AutoBill but allow the customer to continue to access the service. To immediately disentitle the customer, set the disentitle flag to true when making this call.

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.

autobill: the AutoBill object to cancel. You can identify this object with either its VID or your AutoBill ID (merchantAutoBillId).

disentitle: a Boolean flag that, if set to true, cancels the related entitlements immediately. Otherwise, the entitlements will last till the end-date, as determined by the last successful billing for this AutoBill object.

force: a Boolean flag that, if set to true, cancels the subscription even if the minimum commitment period for this AutoBill object is not over yet.

settle: a Boolean flag that specifies whether to settle the AutoBill when it is canceled. If true, an attempt will be made to settle the AutoBill by either refunding the customer for a portion of the pre-paid use that will not be available, or by charging the customer for non-recurring-charges that the customer has not yet paid. If false or not specified, the charges or credits remaining on the AutoBill will not be changed, and will be carried forward in the balance for the AutoBill. How the AutoBill is settled will be reflected by the transactions/refunds included in the output.

sendCancellationNotice: A Boolean flag that, if set to true, sends a cancellation email. If it is set to false, no cancellation email is sent. If this flag is not specified, the default value is true.

cancelReason: (Optional) reason for canceling the AutoBill. You can use predefined CashBox cancel reason codes, or define additional codes using the CashBox Portal or the API. (See "Canceling AutoBills with Reason Codes" in the CashBox Programmer’s Guide.) Supplying an undefined cancel reason code may result in an error.

Output

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

autobill: the AutoBill object that was cancelled.

transactions: an array of Transaction objects that may be refunded if the settle input field is set to true.

refunds: an array of Refund objects that may be refunded if the settle input field is set to true.

Returns

In addition to those listed in Standard Return Codes, this call returns:

Return Code

Return String

400

One of the following:

  • Unable to load AutoBill: No match.
  • Unable to load AutoBill: error-description.
  • Error saving AutoBill: error-description.

403

Minimum commitment not fulfilled for this AutoBill.

405

Unable to cancel upgraded AutoBill.

Example

$autobillVid = '14e1dce6f48e901464fce22145982a59642aa9f4';

// Create an autobill object

$autobill = new AutoBill();
$autobill->setVID($autobillVid);
$immediateDisentitlement = false;
$force = true; // allowing to cancel even if min commitment

// is not fulfilled

$response = $autobill->cancel($immediateDisentitlement, $force)
if($response['returnCode'] == 200) {

$cancelledAutoBill = $response['data']->autobill;

print "AutoBill has been successfully cancelled\n";

// If you are using CashBox API version 3.3 or greater you can
// also use the following construct

print "You are entitled to use current services till "

. $cancelledAutoBill->getEndTimestamp() . "\n";

}

For Users

Learn More
For Users

Cashbox Features

Learn More
Cashbox Features
Back to Top