Cancel a subscription contract
Cancels an existing subscription contract. This operation terminates all future billing and delivery cycles for the subscription. The cancellation takes effect immediately.
Important Notes:
- Any pending/scheduled orders will be cancelled
- The customer will receive a cancellation confirmation email if SUBSCRIPTION_CANCELLED email template is enabled
- Cancellation feedback and notes are stored for analytics and reporting
- The plan’s minimum number of billing cycles is enforced. PUT /api/external/v2/subscription-contracts-update-status with status=CANCELLED does not enforce it
- If the subscription is under a free trial period, minimum cycles are not enforced
Validation Rules:
- Cancelling a contract that is already cancelled returns 204 and does nothing: no second email is sent and the feedback and note are not saved
- A contract ID that is not found for the authenticated shop also returns 204 and does nothing, so a 204 does not prove the contract existed
- Must have completed minimum required billing cycles (unless in trial)
Post-Cancellation:
- Status changes to ‘cancelled’ (lowercase)
- Any pause settings are cleared
- Cancellation feedback and notes are saved
- Activity log entry is created
- Cancellation email is sent (if enabled)
- Any invalid discount codes are automatically removed
Authentication: Requires valid X-API-Key header
curl --request DELETE \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-contracts/{id}import requests
url = "https://subscription-admin.appstle.com/api/external/v2/subscription-contracts/{id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://subscription-admin.appstle.com/api/external/v2/subscription-contracts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://subscription-admin.appstle.com/api/external/v2/subscription-contracts/{id}';
const options = {method: 'DELETE'};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://subscription-admin.appstle.com/api/external/v2/subscription-contracts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://subscription-admin.appstle.com/api/external/v2/subscription-contracts/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://subscription-admin.appstle.com/api/external/v2/subscription-contracts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"message": "UserGeneratedError:Subscription requires minimum billing iterations of 3 before it can be cancelled.",
"params": "",
"status": 400,
"title": "UserGeneratedError:Subscription requires minimum billing iterations of 3 before it can be cancelled.",
"type": "https://appstle.com/problem/problem-with-message"
}{
"error": "Unauthorized",
"path": "/api/external/v2/subscription-contracts/123456789",
"status": 401,
"timestamp": "2026-11-01T08:01:36.642+00:00"
}Path Parameters
Query Parameters
Optional feedback from the customer about why they are cancelling. This information is valuable for understanding cancellation reasons and improving retention. Common values include: 'Too expensive', 'No longer needed', 'Found alternative', 'Quality issues', 'Delivery issues', 'Customer service', 'Product not as expected', etc. This field is stored permanently with the contract for analytics.
500Optional internal note for recording additional cancellation context. This field is for internal use and not visible to customers. Can be used to track special circumstances, support ticket references, competitor information, or other relevant details about why the customer cancelled. This note is stored permanently with the contract.
1000Response
Subscription cancelled, or there was nothing to cancel because the contract was already cancelled or was not found. No content returned.
curl --request DELETE \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-contracts/{id}import requests
url = "https://subscription-admin.appstle.com/api/external/v2/subscription-contracts/{id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://subscription-admin.appstle.com/api/external/v2/subscription-contracts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://subscription-admin.appstle.com/api/external/v2/subscription-contracts/{id}';
const options = {method: 'DELETE'};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://subscription-admin.appstle.com/api/external/v2/subscription-contracts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://subscription-admin.appstle.com/api/external/v2/subscription-contracts/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://subscription-admin.appstle.com/api/external/v2/subscription-contracts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"message": "UserGeneratedError:Subscription requires minimum billing iterations of 3 before it can be cancelled.",
"params": "",
"status": 400,
"title": "UserGeneratedError:Subscription requires minimum billing iterations of 3 before it can be cancelled.",
"type": "https://appstle.com/problem/problem-with-message"
}{
"error": "Unauthorized",
"path": "/api/external/v2/subscription-contracts/123456789",
"status": 401,
"timestamp": "2026-11-01T08:01:36.642+00:00"
}