Extend the Free Trial Period

Overview

This guide shows you how to extend a free trial period by updating a subscription’s next billing date using the Update Next Billing Date API endpoint.

Use Case

A Cloudify customer is nearing the end of a 14-day free trial period and wants to cancel before being charged. Cloudify offers to extend the free trial by 30 days. If the customer accepts, Cloudify uses the Update Next Billing Date endpoint to move the subscription’s next billing date into the future. The customer will only be billed once the updated trial period ends.

Update Next Billing Date via API

Before you start

Make sure that:

  • The subscription's status is Active.
  • You know the subscription’s current NextBillingDate
  • You have the new target date you want to set for NextBillingDate.
  • The new NextBillingDate is set at least 1 minute into the future (not equal to “right now”).
  • The customer must have provided payment details during checkout for a trial-to-paid subscription.
🚧

Important

Get 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:

ParameterTypeRequiredExampleNotes
SubscriptionIdstrYesS67203942The unique identifier of the subscription.
NextBillingDatestrYes2025-03-14T23:20:50.52ZThe next billing date of the subscription.

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": "2026-04-13T23:20:50.52Z",
  "SubscriptionId": "S67203942"
}'
import http.client
import json

conn = http.client.HTTPSConnection("rest.cleverbridge.com")
payload = json.dumps({
  "NextBillingDate": "2026-04-13T23:20:50.52Z",
  "SubscriptionId": "S67203942"
})
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"))
var https = require('follow-redirects').https;
var fs = require('fs');

var options = {
  'method': 'POST',
  'hostname': 'rest.cleverbridge.com',
  'path': '/subscription/updatenextbillingdate',
  'headers': {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'Authorization': 'Basic YOUR_BASE64_ENCODED_CREDENTIALS',
  },
  'maxRedirects': 20
};

var req = https.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function (chunk) {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });

  res.on("error", function (error) {
    console.error(error);
  });
});

var postData = JSON.stringify({
  "NextBillingDate": "2026-04-13T23:20:50.52Z",
  "SubscriptionId": "S67203942"
});

req.write(postData);

req.end();
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://rest.cleverbridge.com/subscription/updatenextbillingdate")
  .header("Content-Type", "application/json")
  .header("Accept", "application/json")
  .header("Authorization", "Basic YOUR_BASE64_ENCODED_CREDENTIALS")
  .body("{\n  \"NextBillingDate\": \"2026-04-13T23:20:50.52Z\",\n  \"SubscriptionId\": \"S67203942\"\n}")
  .asString();

Response

{"ResultMessage":"OK"}

Diagram

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

  A(["&nbsp;&nbsp;<br/>Customer wants to <br/>cancel before the end of free trial&nbsp;&nbsp;<br/>&nbsp;"]):::mainColor
    --> B(["&nbsp;&nbsp;<br/>Cloudify offers  <br/>a 30-day free trial extension<br/>using <i>Update Next Billing Date</i>&nbsp;&nbsp;<br/>&nbsp;"]):::mainColor
    --> C(["&nbsp;&nbsp;<br/>Customer is billed <br/> only after the extended <br/> trial ends&nbsp;&nbsp;<br/>&nbsp;"]):::mainColor