Revert a subscription
Request parameters
Parameter
Type / Description
Request sample
<?php
$vendorCode = 'YOUR_VENDOR_CODE';
$apiKey = 'YOUR_API_KEY';
$date = gmdate('Y-m-d H:i:s');
$hash = hash_hmac('md5', strlen($vendorCode) . $vendorCode . strlen($date) . $date, $apiKey);
try {
$client = new SoapClient(
'https://secure.2checkout.com/soap/6.0/?wsdl',
['cache_wsdl' => WSDL_CACHE_NONE]
);
$sessionId = $client->login($vendorCode, $date, $hash);
$result = $client->revertSubscription(
$sessionId,
'YOUR_LICENCE_CODE', // LicenceCode — subscription reference
'YOUR_ORDER_REFNO', // OrderReference — public RefNo of the last order
'Customer requested revert after accidental renewal' // Reason — mandatory free text
);
echo 'Revert successful: ' . var_export($result, true) . PHP_EOL;
} catch (SoapFault $e) {
echo 'SoapFault: ' . $e->getMessage() . PHP_EOL;
}
Response parameters
Type
Description
Error codes
Error code
Description
Last updated
Was this helpful?