Sign Up for a Free Trial (Anonymous Customer)
Overview
This guide explains how to implement a subscription-based free trial using the Cleverbridge platform.
During signup, the customer provides payment information for authorization, but no payment is collected. If the customer does not cancel the trial before it ends, Cleverbridge automatically starts the paid subscription using the stored payment information.
Use case
- A visitor clicks Start Free Trial on your website.
- Your application redirects the customer to a Cleverbridge checkout URL.
- The customer enters payment information for authorization but is not charged.
- After checkout, your system can immediately grant access using the subscription notification.
Result
If the customer does not cancel before the trial ends, Cleverbridge automatically starts the paid subscription.
flowchart LR
classDef mainColor fill:#ffffff,color:#555555,stroke:#96C34B,stroke-width:2px;
A([" <br/><b>Free trial starts</b><br/>The customer starts trial. Your application redirects to the checkout <br/> "]):::mainColor
--> B([" <br/><b>Checkout completed</b><br/>The customer authorizes payment
and confirms the subscription <br/> "]):::mainColor
--> C([" <br/><b>Your system activates the trial</b><br/>Cleverbridge sends a notification and your system grants access <br/> "]):::mainColor
Implement a free trial signup
ImportantIf you want to offer free trials without collecting payment information at signup, you must create and manage your free trials outside of the Cleverbridge platform.
When the customer decides to purchase your product or service, redirect them to a Cleverbridge checkout page to create the subscription.
For more information, see Set Up a Free Trial Period for a Subscription.
Step 1: Create a checkout URL
Create a checkout URL for the free trial.
Optionally, include x-parameter to pass tracking or reporting information to Cleverbridge.
Cleverbridge returns these values in notifications, allowing you to correlate purchases with internal records.
Common examples include:
x-sourcex-campaign
https://www.cleverbridge.com/864/?scope=checkout&cart=97771&language=en¤cy=USD&x-source=website-visit-05.2019Optional: Generate a protected checkout URL
NoteIn most free trial implementations, you can skip this step and redirect customers directly to the checkout URL created in Step 1.
If your checkout URL contains parameters that customers must not modify, such as a one-time 100% discount coupon, customer identifiers, or other sensitive values, call the Generate User Session URL endpoint to create a protected checkout URL.
The endpoint generates a secure URL that prevents customers from viewing or altering the original checkout URL parameters before they reach the Cleverbridge checkout page.
Example Request
curl --request POST \
--url 'https://rest.cleverbridge.com/urlgenerator/generateusersessionurl' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YOUR_BASE64_ENCODED_CREDENTIALS' \
--data '{
"TargetUrl": "https%3A%2F%2Fwww.cleverbridge.com%2F864%2F%3Fscope%3Dcheckout%26cart%3D97771%26language%3Den%26currency%3DUSD%26x-source%3Dwebsite-visit-07.2026"
}'import http.client
import json
conn = http.client.HTTPSConnection("rest.cleverbridge.com")
payload = json.dumps({
"TargetUrl": "https%3A%2F%2Fwww.cleverbridge.com%2F864%2F%3Fscope%3Dcheckout%26cart%3D97771%26language%3Den%26currency%3DUSD%26x-source%3Dwebsite-visit-07.2026"
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Basic YOUR_BASE64_ENCODED_CREDENTIALS'
}
conn.request("POST", "/urlgenerator/generateusersessionurl", 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': '/urlgenerator/generateusersessionurl',
'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({
"TargetUrl": "https%3A%2F%2Fwww.cleverbridge.com%2F864%2F%3Fscope%3Dcheckout%26cart%3D97771%26language%3Den%26currency%3DUSD%26x-source%3Dwebsite-visit-07.2026"
});
req.write(postData);
req.end();Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://rest.cleverbridge.com/urlgenerator/generateusersessionurl")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("Authorization", "Basic YOUR_BASE64_ENCODED_CREDENTIALS")
.body("{\"TargetUrl\":\"https%3A%2F%2Fwww.cleverbridge.com%2F864%2F%3Fscope%3Dcheckout%26cart%3D97771%26language%3Den%26currency%3DUSD%26x-source%3Dwebsite-visit-07.2026\"}")
.asString();
Step 2: Redirect the Customer to Cleverbridge Checkout
Redirect the customer to the checkout URL. If you generated a protected checkout URL in the previous step, redirect the customer to that URL instead.
During checkout, the customer:
- Reviews the free trial offer.
- Enters payment information for authorization.
- Confirms the subscription.
The payment method is authorized, but the customer is not charged until the trial ends unless they cancel the subscription beforehand.
After successful authorization, Cleverbridge creates the subscription and completes fulfillment according to your account configuration. If your account is configured to generate license keys, Cleverbridge generates the license key during fulfillment and includes it in the delivery information.
Step 3: Process the subscription notification
After the customer successfully completes checkout and the payment authorization succeeds, Cleverbridge sends a PaidOrderNotification. Use the notification to create or update the customer record in your CRM, licensing system, ERP, or other internal systems.
Notification Parameters
The notification contains the following parameters:
| Field | Description |
|---|---|
internalCustomer | Your internal customer identifier. |
items[].recurringBilling.subscriptionId | The Cleverbridge subscription ID. |
items[].recurringBilling.renewalType | Indicates whether the subscription renews automatically or manually. |
items[].recurringBilling.intervalNumber | The current recurring-billing interval number. |
items[].recurringBilling.nextBillingDate | The scheduled billing date after the trial ends. |
Example PaidOrderNotification
PaidOrderNotificationThe following example shows a trimmed PaidOrderNotification. For the complete payload, see the JSON reference.
{
"meta": {
"type": "PaidOrderNotification",
"date": "2026-07-19T14:47:34.857671",
"schemaUrl": "https://www.cleverbridge.com/JsonNotificationSchemas/PaidOrderNotification"
},
"purchaseId": 123456789,
"internalCustomer": "123456789",
"items": [
{
"recurringBilling": {
"subscriptionId": "S12345678",
"intervalNumber": 0,
"nextBillingDate": "2026-08-19T14:47:34.857671",
"renewalType": "Automatic"
}
}
]
}Updated 3 days ago