Skip to content

Cancel an automatic payment

POST/billing/subscriptions/{subscription}/cancel

Overview

Stops a subscription at the end of its paid period. The service continues to run, and future invoices must be paid manually. To stop the service, use the service cancellation endpoint. can_cancel indicates whether cancellation is allowed. Subscriptions belonging to another account return 404.

Permissions

Requires the account permission billing.manage (Manage billing).

curl --request POST \
  --url 'https://console.advinservers.com/api/v1/client/billing/subscriptions/{subscription}/cancel' \
  --header 'Authorization: Bearer <token>' \
  --header 'Accept: application/json'
{
  "uuid": "a216c52c-ccea-430f-b3bf-09aaf1025a44",
  "uuid_short": "Uuid short",
  "provider": "card",
  "status": "active",
  "is_healthy": true,
  "is_cancelled": false,
  "is_ending": true,
  "description": "Standard 4 GB · Kansas City, MO · Monthly",
  "billing_cycle": "monthly",
  "amount": "12.00",
  "currency": "USD",
  "next_charge_at": null,
  "ends_at": "2026-10-02T19:15:08+00:00",
  "cancelled_at": null,
  "last_paid_at": "2026-09-02T19:15:08+00:00",
  "can_cancel": false,
  "services": [
    {
      "service_id": 7312,
      "name": "Standard 4 GB",
      "hostname": "lambda-core.blackmesa.example.com",
      "status": "Active",
      "next_due_date": "2026-10-02",
      "server_id": "ecc6f4f1",
      "server": {
        "id": "ecc6f4f1",
        "name": "lambda-core",
        "hostname": "lambda-core.blackmesa.example.com",
        "location": "Kansas City, MO",
        "windows": false,
        "template_name": "Ubuntu 24.04",
        "template_icon_url": "/assets/icons/ubuntu.png"
      },
      "is_known": true
    }
  ],
  "cancellation_service_id": null,
  "paypal_account": "Paypal account"
}

Authorization

Authorizationstringheaderrequired

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.

Send it as Bearer <token>.

Path parameters

subscriptionstringrequired

The subscription ID.

Response 200

application/json

The record, as a JSON object. There is no envelope.

uuidstringrequired

The uuid UUID.

uuid_shortstringrequired

The value of uuid_short.

providerstringrequired

The payment provider, such as card, paypal, or stripe.

statusstringrequired

The payment provider's current status.

is_healthybooleanrequired

Whether the resource is healthy.

is_cancelledbooleanrequired

Whether the resource is cancelled.

is_endingbooleanrequired

Whether the resource is ending.

descriptionstring | nullrequired

What it was bought as. The fallback name for a row whose services have gone away.

billing_cyclestring | nullrequired

How often the service renews and is billed.

amountstring | nullrequired

Excludes tax.

currencystring | nullrequired

The three-letter currency code used for monetary amounts.

next_charge_atstring | nullrequired

The next charge date, or null if no further payments are scheduled. Ending subscriptions have no next charge date. If the payment provider has not reported a date, this is the next due date of the earliest service covered.

ends_atstring | nullrequired

When the agreed cancellation actually takes effect.

cancelled_atstring | nullrequired

The date and time for cancelled at, in UTC.

last_paid_atstring | nullrequired

The date and time for last paid at, in UTC.

can_cancelbooleanrequired

Whether the subscription can still be cancelled through its payment provider.

servicesobject[]required

The value of services.

Show child attributes
service_idintegerrequired

The service id ID.

namestring | nullrequired

The name shown to customers.

hostnamestring | nullrequired

The fully qualified hostname.

statusstring | nullrequired

The value of status.

next_due_datestring | nullrequired

The value of next_due_date.

server_idstring | nullrequired

The server id ID.

serverobject | nullrequired

The machine itself, where the account still holds one for this service. Null for anything else a subscription pays for, and for a server that has since been handed back.

Show child attributes
idstringrequired

The id ID.

namestringrequired

The name shown to customers.

hostnamestringrequired

The fully qualified hostname.

locationstringrequired

The city the server stands in, e.g. "Nuremberg, DE".

windowsbooleanrequired

The value of windows.

template_namestring | nullrequired

The value of template_name.

template_icon_urlstring | nullrequired

The value of template_icon_url.

is_knownbooleanrequired

Whether the resource is known.

cancellation_service_idinteger | nullrequired

For external payments, use the service autopay cancellation endpoint.

paypal_accountstring | nullrequired

The email address of the saved PayPal account it is charged to, when it is one.

Errors

401
The key was missing, malformed, revoked, or belongs to an account that no longer exists.
403
Access denied. Check the key's team, permissions and allowed IP addresses. Some actions, such as managing API keys, require a browser session. The response message explains the reason.
404
The resource was not found in the selected team. Resources in another account or team also return 404.
422
A field is missing or invalid, or the resource cannot accept this change in its current state. Check message for details. Field validation also includes an errors object keyed by field name.
429
Too many requests. The Retry-After header says how many seconds to wait. Limits are per account, so several keys on one account share them.