# Order servers

`POST https://console.advinservers.com/api/v1/client/servers`

### Overview

Orders 1 to 10 servers from a quote. Send `quote_token`, `quantity`, a `hostnames` list (or `hostname` for one server), an optional `labels` list, and the operating system (`template_uuid`) or an app (`marketplace_app`), any SSH keys or setup script, and the root password as `account_password`. Instead of an operating system or an app, you may send `iso` with the ID of a finished image from your ISO library: the server is built with an empty disk and starts from the image, so you install the system yourself over the console, and the order takes no SSH keys, setup script or root password. Or send `backup` with the ID of a finished backup of one of your servers: the new server is built and that backup restored onto it, bringing the server's system, files, keys and passwords, so the order takes no SSH keys, setup script or root password. The plan's disk must be at least the size of the disk the backup was taken from, the plan may not have a second disk, and the location must be one the backup can be restored in. A restore copies the whole disk, so it can take a while for a large backup. An app may ask for settings of its own: send them in `app_variables`, keyed by the name of each app variable that has an `input`. For an app with `uses_domain`, an order for one server takes the domain name held with the hold endpoint, and may send `custom_domain`, a domain that is already a CNAME for that name. Leave the password out to have one generated for each server; the account holder is emailed a link to it when the server is ready, and the link works for 72 hours. To keep the servers on different hosts, send a host group ID as `host_group`, or a name in `host_group_name` to create one; a group that already has servers must be in the location and product being ordered. Each server is built on a host with no other member when one has room, and joins the group. In a prepaid team, payment is taken from account credit. In a postpaid team (the quote's `postpaid` is true), nothing is charged and account credit is not checked: each server is billed by the hour on the monthly postpaid invoice, and the order is refused with 402 if it would take the monthly recurring cost past its `limit`. Returns the purchase with one order per server. Poll the orders for their status and server ID.

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

## Body

Sent as `application/json`.

- `quote_token` (string, required): The value of `quote_token`. At most 20000 characters
- `quantity` (integer, required): The value of `quantity`. 1 to 10
- `hostname` (string | null): The fully qualified hostname. At most 191 characters
- `hostnames` (string[], required): The value of `hostnames`. Exactly 1 items
- `labels` (string[]): The value of `labels`. Exactly 1 items
- `label` (string | null): A short label shown to customers. At most 191 characters
- `template_uuid` (string | null): The template uuid UUID.
- `marketplace_app` (string | null): The value of `marketplace_app`. Exactly 36 characters
- `iso` (string | null): The value of `iso`. Exactly 36 characters
- `backup` (string | null): The value of `backup`. Exactly 36 characters
- `app_variables` (string[]): The value of `app_variables`. At most 50 items
- `custom_domain` (string | null): The value of `custom_domain`. At most 253 characters
- `account_password` (string | null): The value of `account_password`. 5 to 191 characters
- `ssh_keys` (string[]): The value of `ssh_keys`. At most 25 items
- `user_script` (string | null): The value of `user_script`. Exactly 36 characters
- `host_group` (string): The value of `host_group`.
- `host_group_name` (string): The value of `host_group_name`.

## Response 201

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

- `uuid` (string, required): The uuid UUID.
- `status` (string, required): The value of `status`. One of: `pending`, `needs_funds`, `paid`, `refused`, `expired`, `cancelled`.
- `status_label` (string, required): The value of `status_label`.
- `progress_message` (string | null, required): The value of `progress_message`.
- `amount` (string, required): The whole purchase, as a decimal string in `currency`.
- `currency` (string, required): The three-letter currency code used for monetary amounts.
- `quantity` (integer, required): The value of `quantity`.
- `orders` (object[], required): The value of `orders`.
  - `uuid` (string, required): The uuid UUID.
  - `uuid_short` (string, required): The value of `uuid_short`.
  - `purchase_uuid` (string | null, required): The checkout this machine was bought in, shared with every other machine ordered at the same time.
  - `purchase_status` (string | null, required): The purchase status, or null for an order without a purchase record. One of: `pending`, `needs_funds`, `paid`, `refused`, `expired`, `cancelled`, `null`.
  - `status` (string, required): The value of `status`. One of: `pending_payment`, `provisioning`, `configuring`, `completed`, `expired`, `payment_review`, `failed`, `cancelled`.
  - `status_label` (string, required): The value of `status_label`.
  - `is_placed` (boolean, required): Whether the billing system has taken and been paid for this order, which is what separates "still placing" from "being built".
  - `progress_message` (string | null, required): The value of `progress_message`.
  - `plan_name` (string, required): The value of `plan_name`.
  - `plan_key` (string, required): The value of `plan_key`.
  - `vcpu_cores` (integer, required): The value of `vcpu_cores`.
  - `memory` (integer, required): The value of `memory`.
  - `disk` (integer, required): The value of `disk`.
  - `bandwidth` (integer, required): The value of `bandwidth`.
  - `hdd` (boolean, required): The value of `hdd`.
  - `location` (string | null, required): The value of `location`.
  - `location_id` (integer | null, required): The location id ID.
  - `group_name` (string | null, required): The value of `group_name`.
  - `hostname` (string, required): The fully qualified hostname.
  - `label` (string | null, required): A short label shown to customers.
  - `template_name` (string | null, required): The value of `template_name`.
  - `template_icon_url` (string | null, required): The value of `template_icon_url`.
  - `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.
  - `server_id` (string | null, required): The installed server's short ID, or null until installation finishes.
  - `can_cancel` (boolean, required): Whether the customer can cancel.
  - `created_at` (string | null, required): The date and time for created at, in UTC.
- `created_at` (string | null, required): The date and time for created at, in UTC.

```json
{
  "uuid": "a930b81e-663e-4e12-a437-001f207d5ac6",
  "status": "pending",
  "status_label": "Provisioning",
  "progress_message": null,
  "amount": "12.00",
  "currency": "USD",
  "quantity": 1,
  "orders": [
    {
      "uuid": "0e6a7712-98ab-451b-8675-5c5ae96e4d3a",
      "uuid_short": "Uuid short",
      "purchase_uuid": "a930b81e-663e-4e12-a437-001f207d5ac6",
      "purchase_status": "pending",
      "status": "pending_payment",
      "status_label": "Provisioning",
      "is_placed": false,
      "progress_message": null,
      "plan_name": "Standard 4 GB",
      "plan_key": "032f97c3b0f718ae9a2edfba83d5adf321025b5d9af1e90d397e79b8667bb3a4",
      "vcpu_cores": 4,
      "memory": 4000,
      "disk": 80,
      "bandwidth": 5000,
      "hdd": false,
      "location": "Kansas City, MO",
      "location_id": 3,
      "group_name": "Standard VPS",
      "hostname": "hev-telemetry.blackmesa.example.com",
      "label": "hev-telemetry",
      "template_name": "Ubuntu 24.04",
      "template_icon_url": "/assets/icons/ubuntu.png",
      "billing": {
        "service_id": null,
        "invoice_id": null,
        "invoice_url": null,
        "checkout_uuid": null,
        "invoice_status": null,
        "amount": "12.00",
        "currency": "USD",
        "billing_cycle": "monthly",
        "payment_due_at": null,
        "payment_window_minutes": 30,
        "paid_at": null
      },
      "server_id": null,
      "can_cancel": true,
      "created_at": "2026-09-14T16:31:47+00:00"
    }
  ],
  "created_at": "2026-09-14T16:31:47+00:00"
}
```

## 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.
- `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' \
  --header 'Authorization: Bearer <token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "quote_token": "eyJ2ZXJzaW9uIjoxLCJub25jZSI6IjNmYWRiNjgyM2ZmZTkyY2Q0ZDkwYzRkNjg4YTdjZWY5ZjBiYjBjZDE1YjVhM2VlMGE2MzMyZmU1YmQ4Njg1YWYiLCJvd25lcl9pZCI6MTg3Mywib3duZXJfZW1haWwiOiJnb3Jkb24uZnJlZW1hbkBibGFja21lc2EuZXhhbXBsZS5jb20iLCJleHBpcmVzX2F0IjoxNzg5NDA0NzI5LCJ3aG1jc19jb25maWd1cmF0aW9uX2ZpbmdlcnByaW50IjoiZTY3ZDIzZTc4MjBjNDlhOCJ9.f84ed5bfb2e3e24710926d5ccf5902fc93d0c9a0a45365dd784e1aa72d4083f0",
  "quantity": 1,
  "hostname": null,
  "hostnames": [
    "hev-telemetry.blackmesa.example.com"
  ],
  "labels": [
    "hev-telemetry"
  ],
  "label": null,
  "template_uuid": "e28b39a8-059e-4a75-8048-c9a6e7231b9f",
  "account_password": "Resonance-Cascade-1998",
  "ssh_keys": [
    "97721fd4-746a-40cc-8da0-4c9f623c112e"
  ],
  "user_script": "8edb21bc-9aee-4bd9-8a02-17043fa82a87",
  "host_group": "b1d5a0e2-6c3f-4f7a-9e21-5d8c7a4e0f13",
  "host_group_name": null
}'
```
