# Buy a plan change

`POST https://console.advinservers.com/api/v1/client/servers/{server}/upgrades`

### Overview

Reserves capacity and creates an invoice for a plan change. **In a prepaid team, payment is required.** Send the `quote_token` with the same `plan_key` and `resize_disk` used for the quote. Include `acknowledge_ip_replacement` if the quote requires an IP address change.

In a prepaid team the server changes only after payment. In a postpaid team nothing is paid now and account credit is not checked: the new price is billed by the hour once the change applies, any location change fee goes on the monthly postpaid invoice, and the change is refused with 402 if it would take the monthly recurring cost past its `limit`. Payment details are in `billing`. The reservation expires if payment is not received by `billing.payment_due_at`. Use the current-upgrade endpoint to track progress.

### Permissions

Requires the `billing.purchase` (Make purchases) permission for the selected team. Resources outside that team return 404.

## Authorization

Send `Authorization: Bearer <token>` with the request. 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

- `server` (string, required): The server uuid short

## Body

Sent as `application/json`.

- `plan_key` (string, required): The value of `plan_key`. Exactly 64 characters
- `resize_disk` (boolean, required): The value of `resize_disk`.
- `acknowledge_ip_replacement` (boolean): The value of `acknowledge_ip_replacement`.
- `quote_token` (string, required): The value of `quote_token`. At most 20000 characters

## Response 201

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

- `uuid` (string, required): The uuid UUID.
- `uuid_short` (string, required): The value of `uuid_short`.
- `status` (string, required): The value of `status`. One of: `pending_payment`, `queued`, `stopping`, `migrating`, `resizing`, `networking`, `finalizing`, `completed`, `failed`, `expired`, `payment_review`, `cancelled`.
- `status_label` (string, required): The value of `status_label`.
- `stage` (string | null, required): The value of `stage`.
- `progress` (integer, required): The value of `progress`.
- `progress_message` (string | null, required): The value of `progress_message`.
- `location_change_fee` (string | null, required): The value of `location_change_fee`.
- `billing` (object, required): The value of `billing`.
  - `service_id` (integer | null, required): The customer's service number, once a recurring service exists.
  - `invoice_id` (integer | null, required): The customer's invoice number, once an invoice exists.
  - `invoice_url` (string | null, required): A complete URL where the invoice can be paid.
  - `checkout_uuid` (string | null, required): The checkout UUID, or null when no checkout is available.
  - `checkout_uuid_short` (string | null, required): The value of `checkout_uuid_short`.
  - `invoice_status` (string | null, required): The current invoice status, or null before an invoice exists.
  - `amount` (string | null, required): The amount in the currency shown by `currency`.
  - `currency` (string | null, required): The three-letter currency code used for `amount`.
  - `billing_cycle` (string | null, required): How often the service renews, or null for a one-time charge.
  - `payment_due_at` (string | null, required): When payment is due before the reservation is released.
  - `payment_window_minutes` (integer | null, required): How many minutes the original payment window allowed.
  - `paid_at` (string | null, required): When the charge was paid, or null while payment is outstanding.
- `source_location` (string | null, required): The value of `source_location`.
- `target_location` (string | null, required): The value of `target_location`.
- `requires_migration` (boolean, required): Whether this action requires migration.
- `crosses_location` (boolean, required): The value of `crosses_location`.
- `requires_ip_replacement` (boolean, required): Whether this action requires ip replacement.
- `resize_disk` (boolean, required): The value of `resize_disk`.
- `plan_name` (string | null, required): The value of `plan_name`.
- `product_group_name` (string | null, required): The value of `product_group_name`.
- `source_cpu` (integer | null, required): The plan the customer bought, spelled out against what the server has today. These are the snapshot taken at checkout, so they keep describing the change even after the feed moves on.
- `source_memory` (integer | null, required): The value of `source_memory`.
- `source_disk` (integer | null, required): The value of `source_disk`.
- `source_bandwidth` (integer | null, required): The value of `source_bandwidth`.
- `target_cpu` (integer | null, required): The value of `target_cpu`.
- `target_memory` (integer | null, required): The value of `target_memory`.
- `target_disk` (integer | null, required): The value of `target_disk`.
- `target_bandwidth` (integer | null, required): The value of `target_bandwidth`.
- `transferred_bytes` (integer | null, required): The value of `transferred_bytes`.
- `total_bytes` (integer | null, required): The value of `total_bytes`.
- `can_cancel` (boolean, required): Whether the customer can cancel.
- `error` (string | null, required): A customer-safe explanation of the failure. Internal billing diagnostics are never published here.
- `support_reference` (string | null, required): The value of `support_reference`.
- `created_at` (string | null, required): The date and time for created at, in UTC.
- `started_at` (string | null, required): The date and time for started at, in UTC.
- `completed_at` (string | null, required): The date and time for completed at, in UTC.

```json
{
  "uuid": "2946b7c6-1b8d-4279-880f-629c9dd8f48c",
  "uuid_short": "Uuid short",
  "status": "pending_payment",
  "status_label": "Paying from account credit",
  "stage": "awaiting_billing",
  "progress": 0,
  "progress_message": "Paying for the change from your account credit.",
  "location_change_fee": "0.00",
  "billing": {
    "service_id": null,
    "invoice_id": null,
    "invoice_url": null,
    "checkout_uuid": null,
    "invoice_status": null,
    "amount": "6.00",
    "currency": "USD",
    "billing_cycle": null,
    "payment_due_at": "2026-09-14T17:12:09+00:00",
    "payment_window_minutes": null,
    "paid_at": null
  },
  "source_location": "Kansas City, MO",
  "target_location": "Kansas City, MO",
  "requires_migration": false,
  "crosses_location": false,
  "requires_ip_replacement": false,
  "resize_disk": true,
  "plan_name": "Standard 8 GB",
  "product_group_name": "Standard VPS",
  "source_cpu": 4,
  "source_memory": 4294967296,
  "source_disk": 85899345920,
  "source_bandwidth": 5497558138880,
  "target_cpu": 6,
  "target_memory": 8589934592,
  "target_disk": 171798691840,
  "target_bandwidth": 10995116277760,
  "transferred_bytes": null,
  "total_bytes": null,
  "can_cancel": true,
  "error": null,
  "support_reference": null,
  "created_at": "2026-09-14T16:42:09+00:00",
  "started_at": null,
  "completed_at": null
}
```

## 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.

## Example request

```bash
curl --request POST \
  --url 'https://console.advinservers.com/api/v1/client/servers/{server}/upgrades' \
  --header 'Authorization: Bearer <token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "plan_key": "84ee2bf7fc22f495e76aead064154e1d5ae66fee1ac71cda7cf48d9e607a60bc",
  "resize_disk": true,
  "acknowledge_ip_replacement": false,
  "quote_token": "eyJpdiI6InZVUENaRU81VXMyL1psak9tNS8xTGc9PSIsInZhbHVlIjoib2JiS0ZkbXVmREY0OXBHeXorZEx5Wi81Z3F1UzF0L3RENFBnNTFIZHJ6YUl3RGZYclUrbWoydFpOYkkyT1Q2SklmbVlYdGU4WEVHaWlPRHBQbExSUnp4VkdZbk1ZY0JRZ0U4d0NNbDB1eFVSbVFIZ0xkdkxLdDZzZTZodkFZdEFqV3dBTk1HaTVPNWRpTmpJdjlQSEVNNjZjYWV1UnhGUW1pTEovY2VSQUdPMEg3MDRldWxEN2tBc0Rzd1VEK2pNa01uNEx1bXlLSExZUldobUw0ODVWbWlNZjlKRWIvTFJlaThQd1A0S2kwY3dFejgrZ2NmczZlWGdLVENRL1VoelBJczJ0LzgxMTBXZnlOaFRHSEplRk0zWTQ5cXZHRXhlUGFyV292ZGRHN0FpaWtVVzZhUnFBOGRLcm40TUx3TFIiLCJtYWMiOiJhNmViM2NiYTY0OWI5ZTUxMDkzNGQxYjBkMjRmMWIzZTg2NWE4MWMzYjk2YjIxZDc1NTAyMThjMTliYWQzZGM2IiwidGFnIjoiIn0="
}'
```
