Extend the Next Billing Date
Overview
This guide shows you how to implement Update Next Billing Date endpoint to extend the next billing date.
Use Case
Cloudify, a fictitious company offering cloud storage, wants to retain its customer by offering a pause in the subscription.
- Jan 12th: Cloudify charges the customer for the monthly subscription.
- Jan 13th: The customer contacts support to cancel. The support agent pauses billing for 3 months to retain the customer.
- Update Next Billing Date API endpoint called to extend the billing interval.
- April 12th: Billing resumes.
Implement Update Next Billing Date endpoint
Before you start
Make sure that:
- The subscription has the status
Active. - The date to which the next billing date is updated is in the future.
If the date must be set to today, set it at least one minute in the future.
ImportantGet the customer's consent for changes to subscriptions. 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.
Parameters
In the call to the Update Next Billing Date API endpoint, pass the following two parameters:
| Parameter | Type | Required | Example | Notes |
|---|---|---|---|---|
| SubscriptionId | str | Yes | S67204221 | The unique identifier of the subscription. |
| NextBillingDate | date-time | Yes | 2026-04-12T23:20:50.52Z | The next billing date of the subscription. |
Request
curl --request POST \
--url "https://rest.cleverbridge.com/subscription/updatenextbillingdate" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Basic YOUR_BASE64_ENCODED_CREDENTIALS" \
--data '{
"SubscriptionId": "S67204221",
"NextBillingDate": "2026-04-12T23:20:50.52Z"
}'import json
import urllib.request
url = "https://rest.cleverbridge.com/subscription/updatenextbillingdate"
payload = {
"SubscriptionId": "S67204221",
"NextBillingDate": "2026-04-12T23:20:50.52Z",
}
req = urllib.request.Request(
url=url,
method="POST",
data=json.dumps(payload).encode("utf-8"),
headers={
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Basic YOUR_BASE64_ENCODED_CREDENTIALS",
},
)
try:
with urllib.request.urlopen(req, timeout=30) as resp:
body = resp.read().decode("utf-8")
print("Status:", resp.status)
print("Body:", body)
except urllib.error.HTTPError as e:
print("HTTP Error:", e.code)
print(e.read().decode("utf-8", errors="replace"))
const https = require("https");
const data = JSON.stringify({
SubscriptionId: "S67204221",
NextBillingDate: "2026-04-12T23:20:50.52Z",
});
const options = {
method: "POST",
hostname: "rest.cleverbridge.com",
path: "/subscription/updatenextbillingdate",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
"Content-Length": Buffer.byteLength(data),
Authorization: "Basic YOUR_BASE64_ENCODED_CREDENTIALS",
},
};
const req = https.request(options, (res) => {
let body = "";
res.setEncoding("utf8");
res.on("data", (chunk) => (body += chunk));
res.on("end", () => {
console.log("Status:", res.statusCode);
console.log("Body:", body);
});
});
req.on("error", (err) => console.error("Request error:", err));
req.write(data);
req.end();
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class UpdateNextBillingDateExample {
public static void main(String[] args) throws Exception {
String url = "https://rest.cleverbridge.com/subscription/updatenextbillingdate";
String jsonBody = """
{
"SubscriptionId": "S67204221",
"NextBillingDate": "2026-04-12T23:20:50.52Z"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.header("Authorization", "Basic YOUR_BASE64_ENCODED_CREDENTIALS")
.POST(HttpRequest.BodyPublishers.ofString(jsonBody))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println("Status: " + response.statusCode());
System.out.println("Body: " + response.body());
}
}
Response
Status: 200
Body: {"ResultMessage":"OK"}Diagram
flowchart LR
classDef mainColor fill:#ffffff,color:#96C34B,stroke:#7D32C3,stroke-width:2px;
A([<b>Jun 23</b><br/>Subscription renews + charged normal monthly price]):::mainColor
--> BC([<b>Jul 26</b><br/>Customer contacts support to cancel<br/>Agent pauses billing for<b> 3 months</b>]):::mainColor
--> D([<b>Oct 10</b><br/>Billing resumes automatically<br/>Charged normal monthly price]):::mainColor
Updated 6 days ago