curl --request POST \
--url https://console.advinservers.com/api/v1/client/billing/managed-services/{service}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "end_of_billing",
"delete_floating_ip_uuids": []
}
'import requests
url = "https://console.advinservers.com/api/v1/client/billing/managed-services/{service}/cancel"
payload = {
"type": "end_of_billing",
"delete_floating_ip_uuids": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: 'end_of_billing', delete_floating_ip_uuids: []})
};
fetch('https://console.advinservers.com/api/v1/client/billing/managed-services/{service}/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://console.advinservers.com/api/v1/client/billing/managed-services/{service}/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([
'type' => 'end_of_billing',
'delete_floating_ip_uuids' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://console.advinservers.com/api/v1/client/billing/managed-services/{service}/cancel"
payload := strings.NewReader("{\n \"type\": \"end_of_billing\",\n \"delete_floating_ip_uuids\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://console.advinservers.com/api/v1/client/billing/managed-services/{service}/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"end_of_billing\",\n \"delete_floating_ip_uuids\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.advinservers.com/api/v1/client/billing/managed-services/{service}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"end_of_billing\",\n \"delete_floating_ip_uuids\": []\n}"
response = http.request(request)
puts response.read_body{
"service_id": 7312,
"name": "Standard 4 GB",
"hostname": "lambda-core.blackmesa.example.com",
"status": "Active",
"billing_cycle": "Monthly",
"recurring_amount": "12.00",
"currency": "USD",
"server_id": "ecc6f4f1",
"next_due_date": "2026-10-02",
"period": {
"starts_at": "2026-09-02",
"ends_at": "2026-10-02",
"total_days": 30,
"days_remaining": 18,
"days_overdue": 0,
"remaining_fraction": 0.6,
"state": "healthy"
},
"autopay": true,
"autopay_ending": true,
"subscription": {
"uuid": "a216c52c-ccea-430f-b3bf-09aaf1025a44",
"status": "active",
"next_charge_at": null,
"ends_at": "2026-10-02T19:15:08+00:00",
"amount": "12.00",
"currency": "USD"
},
"cancellation": {
"requested_at": "2026-09-14T16:42:09+00:00",
"type": "end_of_billing",
"type_label": "At the end of the billing period",
"reason": "Consolidating the test chamber workloads onto sector-c-db."
},
"can_start_subscription": true,
"can_cancel_subscription": false,
"can_change_cycle": true,
"can_cancel_service": false,
"can_withdraw_cancellation": true,
"immediate_refund": "7.20",
"pays_from_credit": true,
"can_change_credit": true,
"autopay_provider": "paddle",
"autopay_details": "active",
"suspension_reason": null
}{
"message": "Unauthenticated."
}{
"message": "This API key is not allowed to do that in this team. It needs the \"snapshot.delete\" permission."
}{
"message": "Not found."
}{
"message": "The name field is required.",
"errors": {}
}{
"message": "Too Many Attempts."
}Cancel a service
Overview
Requests cancellation of the service and stops its automatic payments. Cancelling a server permanently deletes the server and its data. Cancellation can take effect immediately or at the end of the paid period.
Send type using a value from cancellation_types. For a server, optionally send delete_floating_ip_uuids containing attached secondary floating IPs to cancel too. An empty or omitted list preserves the IPs and their billing. Selected rentals use the chosen cancellation timing and their own billing periods; granted IPs are released when the server is deleted. Cancelling rentals requires billing.purchase; deleting granted IPs requires network.delete. Primary addresses cannot be selected.
A server that is busy with another operation, such as an upgrade, cannot be cancelled until that operation finishes. The same applies to a floating IP attached to such a server. A suspended server can still be cancelled.
This call records the request; server deletion happens later. If billing fails partway through, completed IP cancellations remain in effect. Returns the service with its pending cancellation.
Permissions
Requires the billing.manage (Manage service billing) permission for the selected team. Resources outside that team return 404.
curl --request POST \
--url https://console.advinservers.com/api/v1/client/billing/managed-services/{service}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "end_of_billing",
"delete_floating_ip_uuids": []
}
'import requests
url = "https://console.advinservers.com/api/v1/client/billing/managed-services/{service}/cancel"
payload = {
"type": "end_of_billing",
"delete_floating_ip_uuids": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: 'end_of_billing', delete_floating_ip_uuids: []})
};
fetch('https://console.advinservers.com/api/v1/client/billing/managed-services/{service}/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://console.advinservers.com/api/v1/client/billing/managed-services/{service}/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([
'type' => 'end_of_billing',
'delete_floating_ip_uuids' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://console.advinservers.com/api/v1/client/billing/managed-services/{service}/cancel"
payload := strings.NewReader("{\n \"type\": \"end_of_billing\",\n \"delete_floating_ip_uuids\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://console.advinservers.com/api/v1/client/billing/managed-services/{service}/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"end_of_billing\",\n \"delete_floating_ip_uuids\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.advinservers.com/api/v1/client/billing/managed-services/{service}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"end_of_billing\",\n \"delete_floating_ip_uuids\": []\n}"
response = http.request(request)
puts response.read_body{
"service_id": 7312,
"name": "Standard 4 GB",
"hostname": "lambda-core.blackmesa.example.com",
"status": "Active",
"billing_cycle": "Monthly",
"recurring_amount": "12.00",
"currency": "USD",
"server_id": "ecc6f4f1",
"next_due_date": "2026-10-02",
"period": {
"starts_at": "2026-09-02",
"ends_at": "2026-10-02",
"total_days": 30,
"days_remaining": 18,
"days_overdue": 0,
"remaining_fraction": 0.6,
"state": "healthy"
},
"autopay": true,
"autopay_ending": true,
"subscription": {
"uuid": "a216c52c-ccea-430f-b3bf-09aaf1025a44",
"status": "active",
"next_charge_at": null,
"ends_at": "2026-10-02T19:15:08+00:00",
"amount": "12.00",
"currency": "USD"
},
"cancellation": {
"requested_at": "2026-09-14T16:42:09+00:00",
"type": "end_of_billing",
"type_label": "At the end of the billing period",
"reason": "Consolidating the test chamber workloads onto sector-c-db."
},
"can_start_subscription": true,
"can_cancel_subscription": false,
"can_change_cycle": true,
"can_cancel_service": false,
"can_withdraw_cancellation": true,
"immediate_refund": "7.20",
"pays_from_credit": true,
"can_change_credit": true,
"autopay_provider": "paddle",
"autopay_details": "active",
"suspension_reason": null
}{
"message": "Unauthenticated."
}{
"message": "This API key is not allowed to do that in this team. It needs the \"snapshot.delete\" permission."
}{
"message": "Not found."
}{
"message": "The name field is required.",
"errors": {}
}{
"message": "Too Many Attempts."
}Authorizations
Your API key, sent as a bearer token. Create one in the control panel under API Keys, give it only the permissions the integration needs, and copy it when it is created. It cannot be shown again. Each key is restricted to one owned team. The key determines the team for every request.
Path Parameters
The service ID returned by the billing endpoints.
7312
Body
Send a JSON object containing the fields below. Required fields are marked in the schema.
Response
The record, as a JSON object. There is no envelope.
The service id ID.
7312
The name shown to customers.
"Standard 4 GB"
The fully qualified hostname.
"lambda-core.blackmesa.example.com"
The value of status.
"Active"
How often the service renews and is billed.
"Monthly"
The amount charged each billing cycle.
"12.00"
The three-letter currency code used for monetary amounts.
"USD"
The server id ID.
"ecc6f4f1"
The value of next_due_date.
"2026-10-02"
The value of period.
Show child attributes
Show child attributes
{
"starts_at": "2026-09-02",
"ends_at": "2026-10-02",
"total_days": 30,
"days_remaining": 18,
"days_overdue": 0,
"remaining_fraction": 0.6,
"state": "healthy"
}
Whether anything will be charged automatically. The tick or the cross in the Autopay column.
true
Autopay that has been turned off but has not stopped yet. Its own state, drawn between the tick and the cross.
false
The value of subscription.
Show child attributes
Show child attributes
{
"uuid": "a216c52c-ccea-430f-b3bf-09aaf1025a44",
"status": "active",
"next_charge_at": "2026-10-02T19:15:08+00:00",
"ends_at": null,
"amount": "12.00",
"currency": "USD"
}
The value of cancellation.
Show child attributes
Show child attributes
null
Whether the customer can start subscription.
false
Whether the customer can cancel subscription.
true
Whether the customer can change cycle.
true
Whether the customer can cancel service.
true
Whether the customer can withdraw cancellation.
false
What stopping this service today would put back on the account, in the currency beside it.
"7.20"
Whether renewals of this service are paid out of the account's credit balance where there is one. True unless the customer has turned it off, which is what the balance does by default.
true
Whether that can be changed from here. False where the installation does not offer account credit at all, or cannot enforce the answer per service.
true
The value of autopay_provider.
"paddle"
The value of autopay_details.
"active"
The value of suspension_reason.
null