Schedule subscription changes
Schedule specific changes for a subscription to be applied at the end of the billing cycle. Use the scheduledProductUpdate method to change specific details about a subscription.
Parameters
sessionID
Required (String) Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect. The sessionID expires in 10 minutes.
SubscriptionReference
Required (String) The system-generated reference code of the subscription.
ProductCode
Required (String) Unique product identifier that you control to which the subscription should be updated.
PricingOptions
Array The product options codes selected for the subscription update. Pricing options codes are case sensitive.
Quantity
Int Number of product units
Response
Boolean
True or False depending on whether the changes were successful or not.
Request
<?php
require('PATH_TO_AUTH');
$subscriptionReference = 'YOUR_SUBSCRIPTION_REFERENCE';
$newProductCode = 'PRODUCT_V2';
$newPricingOptions = 'OPTION_CODE1;OPTION_CODE2';
$newQuantity = 2;
$jsonRpcRequest = [
'method' => 'scheduleProductUpdate',
'params' => [$sessionID, $subscriptionReference, $newProductCode, $newPricingOptions, $newQuantity],
'id' => $i++,
'jsonrpc' => '2.0'
];
var_dump(callRPC((object)$jsonRpcRequest, $host, true));FAQ:
Last updated
Was this helpful?