Set next renewal price
Use the setCustomRenewalPrice method to set custom renewal prices for subscriptions and control the number of recurring billing cycles the price impact subscribers. Charge customers custom prices for the renewal of subscriptions, moving away from the recurring pricing configuration at product level.
Request 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) Unique, system-generated subscription identifier.
Price
Required (double) The custom renewal price you want to charge.
Currency
Required (string) Currency in which prices are expressed. The currency ISO code used for the payment is ISO 4217. The default currency is the same as in the previous payment made by the customer.
Cycles
Required (int) Number of recurring billing cycles for which 2Checkout charges customers the custom price rather, ignoring product–level recurring pricing configurations. (The renewal cycles number must be a positive integer. Default value 1).
ReasonText
Optional (string) Save details at the subscription-level about the custom costs.
Request sample
<?php
require ('PATH_TO_AUTH');
$subscriptionReference = 'YOUR_REFERENCE';
$Price = 25;
$Currency = 'gbp';
$Cycles = 7;
$ReasonText = null;
$jsonRpcRequest = array (
'method' => 'setCustomRenewalPrice',
'params' => array($sessionID, $subscriptionReference, $Price, $Currency, $Cycles, $ReasonText),
'id' => $i++,
'jsonrpc' => '2.0');
var_dump (callRPC((Object)$jsonRpcRequest, $host, true));Response parameters
Boolean
true or false depending on whether or not the operation succeeded.
Last updated
Was this helpful?