Update and assign a subscription

Requirements
Request parameters
Parameter
Type / Description
Request sample
Response parameters
Type
Description
Last updated
Was this helpful?
Was this helpful?
<?php
require ('PATH_TO_AUTH');
$SubscriptionReference = 'YOUR_SUBSCRIPTION_REFERENCE';
$jsonRpcRequest = array (
'method' => 'getSubscription',
'params' => array($sessionID, $SubscriptionReference),
'id' => $i++,
'jsonrpc' => '2.0'
);
$updatedSubscription = callRPC((Object)$jsonRpcRequest, $host, true);
var_dump ($updatedSubscription);
$updatedSubscription->AvangateCustomerReference = 'YOUR_SUBSCRIPTION_REFERENCE'; // AvangateCustomerReference is displayed as 2CheckoutCustomerReference in your Control Panel
$jsonRpcRequest = array (
'method' => 'updateSubscription',
'params' => array($sessionID, $updatedSubscription),
'id' => $i++,
'jsonrpc' => '2.0'
);
var_dump (callRPC((Object)$jsonRpcRequest, $host, true));