curl --request POST \
--url https://apiv2.example.com/subscriptions/{subscriptionId}/cancel \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"cancelAt": {
"nextDay": true
},
"comment": "Switching to a different provider",
"metadata": {}
}
'import requests
url = "https://apiv2.example.com/subscriptions/{subscriptionId}/cancel"
payload = {
"cancelAt": { "nextDay": True },
"comment": "Switching to a different provider",
"metadata": {}
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cancelAt: {nextDay: true},
comment: 'Switching to a different provider',
metadata: {}
})
};
fetch('https://apiv2.example.com/subscriptions/{subscriptionId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiv2.example.com/subscriptions/{subscriptionId}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cancelAt' => [
'nextDay' => true
],
'comment' => 'Switching to a different provider',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiv2.example.com/subscriptions/{subscriptionId}/cancel"
payload := strings.NewReader("{\n \"cancelAt\": {\n \"nextDay\": true\n },\n \"comment\": \"Switching to a different provider\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiv2.example.com/subscriptions/{subscriptionId}/cancel")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cancelAt\": {\n \"nextDay\": true\n },\n \"comment\": \"Switching to a different provider\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.example.com/subscriptions/{subscriptionId}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cancelAt\": {\n \"nextDay\": true\n },\n \"comment\": \"Switching to a different provider\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"subscriptionId": "<string>",
"status": "PENDING",
"type": "<string>",
"display": "<string>",
"msisdn": "<string>",
"customer": {
"customerId": "<string>",
"name": "<string>"
},
"sim": {
"esim": true,
"imei": "<string>",
"iccid": "<string>"
},
"activatedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"referenceId": "crm-subscription-12345",
"productOffering": {
"productOfferingId": "<string>",
"name": "<string>",
"price": {
"currency": "USD",
"priceType": "ONE_TIME",
"discount": 5,
"netPrice": 5,
"boundMonths": 12,
"billingCycle": {
"period": "MONTHLY",
"interval": 1
},
"currencyOptions": {}
},
"group": {
"productOfferingGroupId": "mobile-plans",
"name": "Mobile Plans",
"category": "PRODUCT_CATEGORY_SUBSCRIPTION_CELL",
"description": "Bundled cell subscriptions with unlimited calls and SMS with ILD enabled.",
"internalDescription": "Core mobile offerings targeting consumer and business segments"
},
"imageUrl": "https://cdn.example.com/images/mobile-basic.png"
},
"subscriber": {
"subscriberId": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"address": {
"street1": "500 S Main St",
"city": "Natick",
"zip": "01701",
"country": "US",
"street2": "Apt 1",
"state": "CA",
"region": "<string>",
"attention": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"extensions": {},
"pendingMsisdn": {
"msisdn": "<string>",
"scheduledAt": "2023-12-25"
},
"pendingStatus": {
"status": "PENDING",
"scheduledAt": "2023-12-25"
},
"pendingProductOffering": {
"scheduledAt": "2023-12-25",
"product": {
"productOfferingId": "<string>",
"name": "<string>",
"price": {
"currency": "USD",
"priceType": "ONE_TIME",
"discount": 5,
"netPrice": 5,
"boundMonths": 12,
"billingCycle": {
"period": "MONTHLY",
"interval": 1
},
"currencyOptions": {}
},
"group": {
"productOfferingGroupId": "mobile-plans",
"name": "Mobile Plans",
"category": "PRODUCT_CATEGORY_SUBSCRIPTION_CELL",
"description": "Bundled cell subscriptions with unlimited calls and SMS with ILD enabled.",
"internalDescription": "Core mobile offerings targeting consumer and business segments"
},
"imageUrl": "https://cdn.example.com/images/mobile-basic.png"
}
},
"porting": {
"msisdn": "<string>",
"status": "PENDING",
"direction": "INBOUND",
"scheduledAt": "2023-12-25"
},
"cancelledAt": "2023-11-07T05:31:56Z",
"metadata": {}
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}Cancel subscription
This endpoint allows cancelling a subscription with various timing options:
- Next day cancellation
- Beginning of next month cancellation
- Specific date cancellation
Standardized churn reasons help with reporting and analysis.
curl --request POST \
--url https://apiv2.example.com/subscriptions/{subscriptionId}/cancel \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"cancelAt": {
"nextDay": true
},
"comment": "Switching to a different provider",
"metadata": {}
}
'import requests
url = "https://apiv2.example.com/subscriptions/{subscriptionId}/cancel"
payload = {
"cancelAt": { "nextDay": True },
"comment": "Switching to a different provider",
"metadata": {}
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cancelAt: {nextDay: true},
comment: 'Switching to a different provider',
metadata: {}
})
};
fetch('https://apiv2.example.com/subscriptions/{subscriptionId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiv2.example.com/subscriptions/{subscriptionId}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cancelAt' => [
'nextDay' => true
],
'comment' => 'Switching to a different provider',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiv2.example.com/subscriptions/{subscriptionId}/cancel"
payload := strings.NewReader("{\n \"cancelAt\": {\n \"nextDay\": true\n },\n \"comment\": \"Switching to a different provider\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiv2.example.com/subscriptions/{subscriptionId}/cancel")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cancelAt\": {\n \"nextDay\": true\n },\n \"comment\": \"Switching to a different provider\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.example.com/subscriptions/{subscriptionId}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cancelAt\": {\n \"nextDay\": true\n },\n \"comment\": \"Switching to a different provider\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"subscriptionId": "<string>",
"status": "PENDING",
"type": "<string>",
"display": "<string>",
"msisdn": "<string>",
"customer": {
"customerId": "<string>",
"name": "<string>"
},
"sim": {
"esim": true,
"imei": "<string>",
"iccid": "<string>"
},
"activatedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"referenceId": "crm-subscription-12345",
"productOffering": {
"productOfferingId": "<string>",
"name": "<string>",
"price": {
"currency": "USD",
"priceType": "ONE_TIME",
"discount": 5,
"netPrice": 5,
"boundMonths": 12,
"billingCycle": {
"period": "MONTHLY",
"interval": 1
},
"currencyOptions": {}
},
"group": {
"productOfferingGroupId": "mobile-plans",
"name": "Mobile Plans",
"category": "PRODUCT_CATEGORY_SUBSCRIPTION_CELL",
"description": "Bundled cell subscriptions with unlimited calls and SMS with ILD enabled.",
"internalDescription": "Core mobile offerings targeting consumer and business segments"
},
"imageUrl": "https://cdn.example.com/images/mobile-basic.png"
},
"subscriber": {
"subscriberId": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"address": {
"street1": "500 S Main St",
"city": "Natick",
"zip": "01701",
"country": "US",
"street2": "Apt 1",
"state": "CA",
"region": "<string>",
"attention": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"extensions": {},
"pendingMsisdn": {
"msisdn": "<string>",
"scheduledAt": "2023-12-25"
},
"pendingStatus": {
"status": "PENDING",
"scheduledAt": "2023-12-25"
},
"pendingProductOffering": {
"scheduledAt": "2023-12-25",
"product": {
"productOfferingId": "<string>",
"name": "<string>",
"price": {
"currency": "USD",
"priceType": "ONE_TIME",
"discount": 5,
"netPrice": 5,
"boundMonths": 12,
"billingCycle": {
"period": "MONTHLY",
"interval": 1
},
"currencyOptions": {}
},
"group": {
"productOfferingGroupId": "mobile-plans",
"name": "Mobile Plans",
"category": "PRODUCT_CATEGORY_SUBSCRIPTION_CELL",
"description": "Bundled cell subscriptions with unlimited calls and SMS with ILD enabled.",
"internalDescription": "Core mobile offerings targeting consumer and business segments"
},
"imageUrl": "https://cdn.example.com/images/mobile-basic.png"
}
},
"porting": {
"msisdn": "<string>",
"status": "PENDING",
"direction": "INBOUND",
"scheduledAt": "2023-12-25"
},
"cancelledAt": "2023-11-07T05:31:56Z",
"metadata": {}
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}Authorizations
An API key that grants access to the Connect API. You can create and manage API keys in the portal.
Headers
A unique key to ensure idempotency of requests. If a request with the same key has already been processed, the same result will be returned. The key must be unique for each distinct operation. Keys are expired after 24 hours, but we recommend using a new key for each request.
Modified requests with the same idempotency keys are rejected with a 409 Conflict status code.
256Path Parameters
The identifier of the subscription. May be the entity's internal UUID or an external reference identifier.
Reference identifiers MUST be prefixed with rid_ (e.g., rid_crm-subscription-12345) so the API
can distinguish them from internal UUIDs. The prefix is stripped before lookup.
Body
Request to cancel a subscription.
When the subscription should be cancelled.
- CancelNextDay
- CancelAtBeginningOfNextMonth
- CancelAtDate
Show child attributes
Show child attributes
Standardized reason for the cancellation used for reporting and analysis.
If OTHER is provided, please also provide a comment.
BETTER_DEAL_PRICE, NOT_HAPPY_MISSING_FUNCTIONS, NOT_HAPPY_COVERAGE_SLA, NOT_HAPPY_COMPLEX_ADMIN, NOT_HAPPY_SUPPORT_ENGAGEMENT, FRAUD, FRAUD_ATTEMPT, TEST_OR_MARKETING, NO_NEED, WRONG_ORDER, OTHER Optional comment about the cancellation.
"Switching to a different provider"
A set of key-value pairs that can be attached to an object for storing additional information in a semi-structured format.
Show child attributes
Show child attributes
Response
Subscription cancellation scheduled successfully.
A subscription represents a telecommunications service provisioned for a customer with embedded product and pricing details.
The unique identifier for the subscription.
The status of the subscription.
PENDING, ACTIVATED, BLOCKED, CANCELLED, PAUSED, SUSPENDED The type of subscription, categorizing the service into various telecommunications service types.
The display name for the subscription, typically a pretty-print of the msisdn.
The currently active phone number for this subscription.
Customer information embedded in responses. Sensitive details require separate API calls with appropriate authorization.
Show child attributes
Show child attributes
SIM card information for the subscription. Sensitive details like PUK require separate API calls.
Use dedicated SIM API endpoints with proper authorization to access sensitive information such as PUK.
Show child attributes
Show child attributes
The date and time when the subscription was activated.
The date and time when the subscription was created.
The date and time when the subscription was last updated.
A reference identifier provided by API clients to identify this subscription in their own systems. Must be unique per tenant. Use this field to look up subscriptions by your external identifier or to create/retrieve subscriptions during order creation.
255"crm-subscription-12345"
Embedded representation of a product offering.
Show child attributes
Show child attributes
A subscriber is a user that has a subscription.
Show child attributes
Show child attributes
Additional subscription extensions fields provided for custom subscription types.
Show child attributes
Show child attributes
Details about when a pending phone number change is scheduled for this subscription.
Show child attributes
Show child attributes
Details about when a pending status change is scheduled for this subscription.
Show child attributes
Show child attributes
Pending product offering change.
Show child attributes
Show child attributes
Number porting information for subscriptions, indicating scheduled number transfers.
To get the detailed porting information, use the porting endpoint.
Show child attributes
Show child attributes
The date and time when the subscription was cancelled (if applicable).
A set of key-value pairs that can be attached to an object for storing additional information in a semi-structured format.
Show child attributes
Show child attributes