For the complete documentation index, see llms.txt. This page is also available as Markdown.

Trigger renewal before usage upload interval

Trigger the renewal for a pay-per-usage subscription even before the end of the usage upload interval. Once the API call is made, the subscription is marked as ready to renew, and a renewal will be attempted. If the first attempt is not successful, the renewal of the subscription will be attempted again based on the regular renewal schedule.

Request parameters

Parameter
Type / Description

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. 2Checkout charges customers using the payment data attached to subscriptions. In the case of credit/debit cards, if customers update their payment information in MyAccount or if you update these details on behalf of your subscribers, the 2Checkout system uses the latest card info provided to charge subscription renewals.

Request sample

<?php

require ('PATH_TO_AUTH');

$subscriptionReference = 'YOUR_SUBSCRIPTION_REFERENCE';

$jsonRpcRequest = array (
    'method' => 'markUsageSubscriptionToRenewNow',
    'params' => array($sessionID, $subscriptionReference),
    'id' => $i++,
    'jsonrpc' => '2.0'
);

var_dump (callRPC((Object)$jsonRpcRequest, $host, true));

Response parameters

Type
Description

Boolean

true or false depending on whether or not the subscription was marked as ready to be renewed. The response does not reflect the success of the renewal attempt.

Last updated

Was this helpful?