Set grace period
Last updated: 07-Jan-2026
Rate this article:
Overview
Use the setSubscriptionGracePeriod method to set a custom grace period for an Active or Past Due subscription. This method changes per-subscription end user data and not customer details.
Parameters
| Parameters | 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. Needs to belong to an Active or Past Due subscription. | |
| subscriptionGracePeriod | Required (int) |
|
The number of days for the grace period, during which time, customers can still renew/upgrade expired subscriptions. During the grace period, subscriptions feature the Past Due status.
Can be NULL. When NULL, the grace period for a subscription is the same as that you defined in the per-product or per-account grace period settings. You can use this to set a custom grace period for a subscription. |
Response
| Parameters | Type/Description |
|---|---|
| Boolean | true or false depending on whether the changes were successful or not. |
Request
<?php
require ('PATH_TO_AUTH');
$subscriptionReference = 'YOUR_SUBSCRIPTION_REFERENCE';
$gracePeriod = YOUR_GRACE_PERIOD;
try {
$customGracePeriod = $client->setSubscriptionGracePeriod($sessionID, $subscriptionReference, $gracePeriod);
}
catch (SoapFault $e) {
echo "customGracePeriod: " . $e->getMessage();
exit;
}
var_dump("customGracePeriod", $customGracePeriod);
Rate this article: