Turn Off Automatic Renewal 2.0

Turn off auto-renew to switch the renewal type to Manual

Overview

This guide shows you how to implement the Update Subscription Renewal Type API endpoint to turn off automatic renewal when using Subscription Management 2.0.

Use case

Turn off the subscription in the Cleverbridge platform for Subscription Management 2.0 .

  1. A customer is subscribed to a plan that includes a monthly 20 GB data allowance. After reaching the data limit, the customer decides they no longer need the subscription and asks to cancel it.
  2. To ensure the customer is not charged again at the end of the current billing interval, your system must turn off automatic renewal for the subscription. This is done using the Update Subscription Renewal Type API endpoint,

Result

The subscription renewal type is changed from Automatic to Manual.

Implement the Update Subscription Renewal Type endpoint

📘

Note

In Subscription Management 2.0, renewal type is set at the subscription level. Turning off automatic renewal applies to the entire subscription rather than individual items.

Before you start

🚧

Important

Get the customer's consent before making changes to a subscription.

To avoid chargebacks and customer inquiries, it is also essential that you coordinate all price increases with Client Experience.

In the European Economic Area (EEA), Strong Customer Authentication (SCA) is required for recurring electronic payments when the amount changes. This means that some of your customers will have to authenticate their payment, which in turn might impact the renewal success rate.

For more information, see Best Practices: Obtain Customer Consent.

Make sure that:

  • The subscription has the status Active.
  • Subscription products have an Automatic renewal type by default.
  • When customers sign up for a subscription, they must confirm that they will be automatically billed in regular intervals by selecting a check box. This results in a subscription with an Automatic renewal type.
  • When a customer does not confirm automatic renewal, but still signs up, the subscription has a Manual renewal type. For more information, see About Subscription Billing Intervals.
🚧

Important

For more information about managing subscriptions, see Subscription Management 1.0 and 2.0.

🚧

Important

If the customer's subscription contains more than one subscription item (multi-item subscription), you must offer a "turn off automatic renewal" option for every subscription item. Customers can then decide for which subscription items they want to turn off automatic renewal: one item, several items, or all items.

Parameters

ParameterTypeRequiredExampleNotes
RenewalTypestrYesManualThe customer must initiate the renewal at the end of the billing interval.
SubscriptionIdstrYesS67670740The unique identifier of the subscription.

Request

curl -X POST "https://rest.cleverbridge.com/subscription/updatesubscriptionrenewaltype?RenewalType=Manual&SubscriptionId=S67670740" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Basic YOUR_BASE64_ENCODED_CREDENTIALS" \
  -d '{
    "RenewalType": "Manual",
    "SubscriptionId": "S67670740"
  }'
import http.client
import json

conn = http.client.HTTPSConnection("rest.cleverbridge.com")
payload = json.dumps({
  "SubscriptionId": "S23179293",
  "RunningNumber": "1"
})
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Basic YOUR_BASE64_ENCODED_CREDENTIALS'
}
conn.request("POST", "/subscription/deactivatesubscriptionitems?SubscriptionId=S67203942&RunningNumber=1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const https = require("https");

const payload = JSON.stringify({
  RenewalType: "Manual",
  SubscriptionId: "S67670740",
});

const options = {
  hostname: "rest.cleverbridge.com",
  path: "/subscription/updatesubscriptionrenewaltype?RenewalType=Manual&SubscriptionId=S67670740",
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Basic YOUR_BASE64_ENCODED_CREDENTIALS",
    "Content-Length": Buffer.byteLength(payload),
  },
};

const req = https.request(options, (res) => {
  let data = "";

  res.on("data", (chunk) => {
    data += chunk;
  });

  res.on("end", () => {
    console.log("Status:", res.statusCode);
    console.log(data);
  });
});

req.on("error", (err) => {
  console.error("Request error:", err);
});

req.write(payload);
req.end();
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 url = "https://rest.cleverbridge.com/subscription/updatesubscriptionrenewaltype"
                + "?RenewalType=Manual&SubscriptionId=S67670740";

        String payload = """
        {
          "RenewalType": "Manual",
          "SubscriptionId": "S67670740"
        }
        """;

        HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create(url))
                .header("Content-Type", "application/json")
                .header("Accept", "application/json")
                .header("Authorization", "Basic YOUR_BASE64_ENCODED_CREDENTIALS")
                .POST(HttpRequest.BodyPublishers.ofString(payload))
                .build();

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

        System.out.println("Status: " + response.statusCode());
        System.out.println(response.body());
    }
}

Response

{
    "ResultMessage": "OK"
}

Diagram

flowchart LR
  classDef mainColor fill:#ffffff,color:#555555,stroke:#96C34B,stroke-width:2px;

  A(["&nbsp;&nbsp;<br/><b>Data limit reached</b><br/>The customer uses up the 20 GB data limit&nbsp;&nbsp;<br/>&nbsp;"]):::mainColor
    --> B(["&nbsp;&nbsp;<br/><b>Cancellation</b><br/>The customer decides to cancel their subscription&nbsp;&nbsp;<br/>&nbsp;"]):::mainColor
    --> C(["&nbsp;&nbsp;<br/><b>Deactivation</b><br/><i>Update Subscription Renewal Type</i> API endpoint used to turn off automatic renewal&nbsp;&nbsp;<br/>&nbsp;"]):::mainColor
📘

Turn On Automatic Renewal

If you need to turn on the automatic renewal of a subscription , see Turn On automatic Renewal.