Reactivate Subscription

Overview

This guide shows you how to reactivate a canceled subscription and process its renewal using the Reinstate Subscription Items and Update Next Billing Date endpoints.

Use Case

Cloudify emails customers who deactivated their Cloudify Silver subscription and invites them to reactivate it. A customer clicks the reactivation link in the email and lands on a page in Cloudify's account portal.

  1. Cloudify's backend calls Reinstate Subscription Items to reactivate the customer's deactivated subscription items.
  2. Cloudify's backend calls Update Next Billing Date to trigger an immediate renewal charge.
  3. Cleverbridge processes the payment and sends Cloudify a PaidOrderNotification.
  4. Cloudify's backend marks the subscription as active and restores the customer's access to Cloudify Silver.

Diagram

Result

The customer's subscription is active again. Cloudify has an immediate paid renewal on record instead of waiting for the next scheduled billing cycle.

Implement Reactivate Subscription

Call Reinstate Subscription Items to restore the canceled subscription item. Then call Update Next Billing Date to charge the customer immediately.

Before you start

Make sure that:

  • The subscription has the status Deactivated.
  • Each subscription item you want to reactivate belongs to a product that's still available for purchase.
  • You have the subscription's SubscriptionId and the running number of each subscription item to reactivate.
  • The customer has explicitly agreed to the reactivation and immediate renewal charge, and has a valid payment method on file.
  • The NextBillingDate value you send is in the future. If you want the renewal to happen today, set the time at least one minute ahead of the current time.

Step 1: Call the Reinstate Subscription Items endpoint

Send this request to change the subscription item's status from Deactivated to Active.

Parameters

ParameterTypeRequiredExampleNotes
SubscriptionIdstringRequired"S23179293"Unique ID of the subscription. Include or omit the leading S.
Itemsarray of integersRequired[
1, 2
]
Running numbers of the deactivated subscription items to reactivate.
GenerateMailbooleanOptionaltrueDefaults to true. Set to false to suppress the confirmation email. If you set it to false, send the email yourself.

Request

curl --request POST \
  --url https://rest.cleverbridge.com/subscription/reinstatesubscriptionitems \
  --header 'accept: application/json' \
  --header 'authorization: Basic YOUR_BASE64_ENCODED_CREDENTIALS' \
  --header 'content-type: application/json' \
  --data '{
  "Items": [
    1,
    2
  ],
  "SubscriptionId": "S23179293",
  "GenerateMail": true
}'
import http.client
import json

conn = http.client.HTTPSConnection("rest.cleverbridge.com")
payload = json.dumps({
  "Items": [
    1,
    2
  ],
  "SubscriptionId": "S23179293",
  "GenerateMail": True
})
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Basic YOUR_BASE64_ENCODED_CREDENTIALS'
}
conn.request("POST", "/subscription/reinstatesubscriptionitems", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
async function main() {
  const response = await fetch('https://rest.cleverbridge.com/subscription/reinstatesubscriptionitems', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'Authorization': 'Basic YOUR_BASE64_ENCODED_CREDENTIALS'
    },
    body: JSON.stringify({
      Items: [1, 2],
      SubscriptionId: 'S23179293',
      GenerateMail: true
    })
  });

  if (!response.ok) {
    throw new Error(`Request failed with status ${response.status}`);
  }

  console.log(await response.text());
}

main().catch(console.error);
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
  public static void main(String[] args) throws Exception {
    String requestBody = "{"
        + "\"Items\":[1,2],"
        + "\"SubscriptionId\":\"S23179293\","
        + "\"GenerateMail\":true"
        + "}";

    HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://rest.cleverbridge.com/subscription/reinstatesubscriptionitems"))
        .header("Content-Type", "application/json")
        .header("Accept", "application/json")
        .header("Authorization", "Basic YOUR_BASE64_ENCODED_CREDENTIALS")
        .POST(HttpRequest.BodyPublishers.ofString(requestBody))
        .build();

    HttpResponse<String> response = HttpClient.newHttpClient().send(
        request,
        HttpResponse.BodyHandlers.ofString()
    );

    System.out.println(response.body());
  }
}

Response

{
  "ResultMessage": "OK"
}

Step 2: Call the Update Next Billing Date endpoint

Send this request with a future next billing date. To trigger the renewal today, set the time at least one minute ahead of the current time. Cleverbridge then charges the customer's stored payment method.

Parameters

ParameterTypeRequiredExampleNotes
SubscriptionIdstringRequired"S23179293"Unique ID of the subscription. Include or omit the leading S.
NextBillingDatestring (date-time)Required"2030-09-18T08:00:00.00Z"RFC 3339 date-time in UTC. Must be in the future. Set it at least one minute ahead of the current time if you want the renewal to happen today.

Request

curl --location 'https://rest.cleverbridge.com/subscription/updatenextbillingdate' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic YOUR_BASE64_ENCODED_CREDENTIALS' \
--data '{
  "NextBillingDate": "2030-09-18T08:00:00.00Z",
  "SubscriptionId": "S23179293"
}'
import http.client
import json

conn = http.client.HTTPSConnection("rest.cleverbridge.com")
payload = json.dumps({
  "NextBillingDate": "2030-09-18T08:00:00.00Z",
  "SubscriptionId": "S23179293"
})
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Basic YOUR_BASE64_ENCODED_CREDENTIALS'
}
conn.request("POST", "/subscription/updatenextbillingdate", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
async function main() {
  const response = await fetch('https://rest.cleverbridge.com/subscription/updatenextbillingdate', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'Authorization': 'Basic YOUR_BASE64_ENCODED_CREDENTIALS'
    },
    body: JSON.stringify({
      NextBillingDate: '2030-09-18T08:00:00.00Z',
      SubscriptionId: 'S23179293'
    })
  });

  if (!response.ok) {
    throw new Error(`Request failed with status ${response.status}`);
  }

  console.log(await response.text());
}

main().catch(console.error);
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
  public static void main(String[] args) throws Exception {
    String requestBody = "{"
        + "\"NextBillingDate\":\"2030-09-18T08:00:00.00Z\","
        + "\"SubscriptionId\":\"S23179293\""
        + "}";

    HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://rest.cleverbridge.com/subscription/updatenextbillingdate"))
        .header("Content-Type", "application/json")
        .header("Accept", "application/json")
        .header("Authorization", "Basic YOUR_BASE64_ENCODED_CREDENTIALS")
        .POST(HttpRequest.BodyPublishers.ofString(requestBody))
        .build();

    HttpResponse<String> response = HttpClient.newHttpClient().send(
        request,
        HttpResponse.BodyHandlers.ofString()
    );

    System.out.println(response.body());
  }
}

Response

{
  "ResultMessage": "OK"
}

Step 3: Receive the PaidOrderNotification

Cleverbridge charges the customer's stored payment method and sends a PaidOrderNotification to your configured notification URL once the payment succeeds.

The notification confirms the renewal. Use it to confirm the reactivation on your side instead of polling the subscription status. For the full payload structure, see PaidOrderNotification in the Cleverbridge API reference.

PaidOrderNotification parameters

ParameterDefinition
subscriptionIdUnique ID of the Cleverbridge subscription.
intervalNumberNumber of the billing interval associated with the subscription item.
nextBillingDateDate on which the subscription is currently scheduled to renew. When the subscription item is aligned to the current interval, it follows the existing renewal schedule.
{
  "meta": {
    "type": "PaidOrderNotification",
    "date": "2026-09-18T14:47:34.857671",
    "schemaUrl": "https://www.cleverbridge.com/JsonNotificationSchemas/PaidOrderNotification"
  },
  "purchaseId": 123456789,
  "...": "...",
  "items": [
    {
      "...": "...",
      "recurringBilling": {
        "subscriptionId": "S23179293",
        "intervalNumber": 1,
        "nextBillingDate": "2026-10-18T14:47:34.857671"
      }
    }
  ]
}



Did this page help you?