# Buy a floating IP

`POST https://console.advinservers.com/api/v1/client/floating-ips`

### Overview

Orders a floating IP. A prepaid team pays from account credit. A postpaid team pays nothing now and its credit is not checked: the address 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`. Send `location_id`, `type` (`ipv4` or `ipv6`) and `quote_token`. Returns the address as `pending_payment`. Poll the address list until it becomes `active`. Optionally send `server` with the ID of one of your servers in the same location to attach the address once it is paid for. This also requires permission to change networking. `attaching_to` names the server until the address is attached. In a prepaid team, insufficient credit rejects the request before reserving an address. If credit becomes insufficient during processing, `status_label` shows `Needs funds` and `progress_message` explains the shortfall. `limits` contains account address allowances.

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

- `location_id` (integer, required): The location id ID.
- `type` (string, required): The type of operation or resource. One of: `ipv4`, `ipv6`.
- `quote_token` (string, required): The value of `quote_token`. At most 4096 characters
- `server` (string | null): The value of `server`. At most 36 characters

## Response 201

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

- `limits` (object, required): The value of `limits`.
  - `ipv4` (object, required): The value of `ipv4`.
    - `quota` (integer, required): The value of `quota`.
    - `used` (integer, required): The value of `used`.
    - `remaining` (integer, required): The value of `remaining`.
  - `ipv6` (object, required): The value of `ipv6`.
    - `quota` (integer, required): The value of `quota`.
    - `used` (integer, required): The value of `used`.
    - `remaining` (integer, required): The value of `remaining`.
- `uuid` (string, required): The uuid UUID.
- `uuid_short` (string, required): The first eight characters of the UUID. Either form can identify the address.
- `status` (string, required): The value of `status`. One of: `pending_payment`, `active`, `pending_cancellation`, `deleting`, `expired`, `cancelled`, `payment_review`.
- `status_label` (string, required): The value of `status_label`.
- `progress_message` (string | null, required): One sentence about why a purchase is waiting, or null.
- `needs_funds` (boolean, required): Whether the purchase is waiting on account credit, which is the one wait the customer can end themselves.
- `type` (string, required): The type of operation or resource. One of: `ipv4`, `ipv6`.
- `address` (string | null, required): The IP address. A cancelled or expired one names the address it had.
- `cidr` (integer | null, required): The network prefix length.
- `gateway` (string | null, required): The gateway address for the network.
- `onlink` (string | null, required): The value of `onlink`.
- `is_primary` (boolean, required): Whether the resource is primary.
- `location` (string | null, required): The value of `location`.
- `location_id` (integer | null, required): The location id ID.
- `is_granted` (boolean, required): Whether the resource is granted.
- `can_release` (boolean, required): Whether the customer can release.
- `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.
- `can_cancel_checkout` (boolean, required): Whether the customer can cancel checkout.
- `can_request_cancellation` (boolean, required): Whether the customer can request cancellation.
- `can_withdraw_cancellation` (boolean, required): Whether the cancellation standing against this address can still be taken back. False for an immediate one, which gave the address away as it was filed.
- `cancellation_type` (string | null, required): The value of `cancellation_type`. One of: `immediate`, `end_of_billing`, `null`.
- `cancellation_requested_at` (string | null, required): The date and time for cancellation requested at, in UTC.
- `created_at` (string | null, required): The date and time for created at, in UTC.
- `server` (object | null, required): Null whenever the address is held but parked on nothing, which is a perfectly ordinary state for a floating address to sit in.
  - `id` (string, required): The id ID.
  - `name` (string, required): The name shown to customers.
  - `hostname` (string, required): The fully qualified hostname.
  - `windows` (boolean, required): The value of `windows`.
  - `template_name` (string | null, required): The value of `template_name`.
  - `template_icon_url` (string | null, required): The value of `template_icon_url`.
- `attaching_to` (object | null, required): The server this address was bought for, while it waits to be put there. It is attached as soon as the purchase has been paid for, and this goes back to null.
  - `id` (string, required): The id ID.
  - `name` (string, required): The name shown to customers.
  - `hostname` (string, required): The fully qualified hostname.
  - `windows` (boolean, required): The value of `windows`.
  - `template_name` (string | null, required): The value of `template_name`.
  - `template_icon_url` (string | null, required): The value of `template_icon_url`.
- `attachment_status` (string | null, required): Which way the address is moving while a worker attaches or detaches it, or null once it has settled. An attaching address is not on `attaching_to` yet; a detaching one is still on `server`. One of: `attaching`, `detaching`, `null`.

```json
{
  "uuid": "83061988-1a5c-49d7-b67b-f7300ad18f70",
  "uuid_short": "83061988",
  "status": "pending_payment",
  "status_label": "Provisioning",
  "progress_message": null,
  "needs_funds": false,
  "type": "ipv4",
  "address": "198.51.100.43",
  "cidr": 24,
  "gateway": "198.51.100.1",
  "onlink": null,
  "is_primary": false,
  "location": "Kansas City, MO",
  "location_id": 3,
  "is_granted": false,
  "can_release": false,
  "billing": {
    "service_id": null,
    "invoice_id": null,
    "invoice_url": null,
    "checkout_uuid": null,
    "invoice_status": null,
    "amount": "3.00",
    "currency": "USD",
    "billing_cycle": "monthly",
    "payment_due_at": null,
    "payment_window_minutes": null,
    "paid_at": null
  },
  "can_cancel_checkout": true,
  "can_request_cancellation": false,
  "can_withdraw_cancellation": false,
  "cancellation_type": null,
  "cancellation_requested_at": null,
  "created_at": "2026-09-14T16:42:09+00:00",
  "server": null,
  "attaching_to": null,
  "attachment_status": null,
  "limits": {
    "ipv4": {
      "quota": 10,
      "used": 2,
      "remaining": 8
    },
    "ipv6": {
      "quota": 5,
      "used": 0,
      "remaining": 5
    }
  }
}
```

## Errors

- `400`: The address cannot be reserved or purchased in its current state.
- `401`: The key was missing, malformed, revoked, or belongs to an account that no longer exists.
- `402`: The account credit, or in a postpaid team the postpaid spending limit, does not cover this purchase.
- `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 requested server was not found in the selected team.
- `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/floating-ips' \
  --header 'Authorization: Bearer <token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "location_id": 3,
  "type": "ipv4",
  "quote_token": "eyJpdiI6InlCb3ZvTkV4NFJwQnpSMHVPNkpMXC9RPT0iLCJ2YWx1ZSI6InF6V2ZzTnIrd3hQcUJMNFZPSlF1MU9IZ0FnWXh1UVhXNm5zSlZBQjk3SHRYZVNVRFFXcGtrUnkxQjBOUXZpaXhPWGJNUzRhSEZxZ0g2dmhpZXkyWXQ5MFwvVVQrU0ViM1lnMTR1bnFPWkJCb0NWVUI1RFdcL1dORkRJSXloK2pyM3EiLCJtYWMiOiJhMTBjM2NmZDNlNWI4NTg3ODQ4ODk2YjFmODMxZGY2NTA5ZTIwMjViMzJhMjljODdlOTdjZDM2NDM2NzljOWQ4IiwidGFnIjoiIn0=",
  "server": null
}'
```
