curl --request PATCH \
--url https://console.advinservers.com/api/v1/client/billing/managed-services/{service}/billing-cycle \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"billing_cycle": "quarterly"
}
'import requests
url = "https://console.advinservers.com/api/v1/client/billing/managed-services/{service}/billing-cycle"
payload = { "billing_cycle": "quarterly" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({billing_cycle: 'quarterly'})
};
fetch('https://console.advinservers.com/api/v1/client/billing/managed-services/{service}/billing-cycle', 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}/billing-cycle",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'billing_cycle' => 'quarterly'
]),
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}/billing-cycle"
payload := strings.NewReader("{\n \"billing_cycle\": \"quarterly\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://console.advinservers.com/api/v1/client/billing/managed-services/{service}/billing-cycle")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"billing_cycle\": \"quarterly\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.advinservers.com/api/v1/client/billing/managed-services/{service}/billing-cycle")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"billing_cycle\": \"quarterly\"\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": false,
"subscription": {
"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"
},
"cancellation": null,
"can_start_subscription": false,
"can_cancel_subscription": true,
"can_change_cycle": true,
"can_cancel_service": true,
"can_withdraw_cancellation": false,
"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."
}Change a service's billing cycle
Overview
Changes a service’s billing cycle. Send an available billing_cycle. The new cycle and price apply to the next invoice. The request is rejected if the account has an outstanding invoice or the service cannot change cycles. The error message explains the reason. Returns the updated service.
Permissions
Requires the billing.manage (Manage service billing) permission for the selected team. Resources outside that team return 404.
curl --request PATCH \
--url https://console.advinservers.com/api/v1/client/billing/managed-services/{service}/billing-cycle \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"billing_cycle": "quarterly"
}
'import requests
url = "https://console.advinservers.com/api/v1/client/billing/managed-services/{service}/billing-cycle"
payload = { "billing_cycle": "quarterly" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({billing_cycle: 'quarterly'})
};
fetch('https://console.advinservers.com/api/v1/client/billing/managed-services/{service}/billing-cycle', 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}/billing-cycle",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'billing_cycle' => 'quarterly'
]),
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}/billing-cycle"
payload := strings.NewReader("{\n \"billing_cycle\": \"quarterly\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://console.advinservers.com/api/v1/client/billing/managed-services/{service}/billing-cycle")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"billing_cycle\": \"quarterly\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.advinservers.com/api/v1/client/billing/managed-services/{service}/billing-cycle")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"billing_cycle\": \"quarterly\"\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": false,
"subscription": {
"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"
},
"cancellation": null,
"can_start_subscription": false,
"can_cancel_subscription": true,
"can_change_cycle": true,
"can_cancel_service": true,
"can_withdraw_cancellation": false,
"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.
How often the service renews and is billed.
monthly, quarterly, semiannually, annually, biennially, triennially 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