Skip to content

Preview the credit from a move to a postpaid team

POST/transfers/quote

Overview

Takes the same team and moves as the transfer endpoint and says what the move would do to billing, without moving or changing anything. Use it before sending accept_postpaid: true.

ends_prepaid_billing is true when the move would end prepaid billing for any of the resources. credit is then the unused paid time that would be added to account credit, as a decimal string in currency. Both are null when the move would not change how anything is billed. The amount is worked out for the current moment, so the move itself may credit slightly less a few minutes later.

The same checks as the move apply, so a move that would be refused is refused here with the same reason.

Permissions

Requires one of the server.transfer (Transfer servers to their own account), network.transfer (Transfer floating IPs to their own account) or snapshot.transfer (Transfer snapshot storage to their own account) permissions for the selected team, depending on the request. Resources outside that team return 404.

curl --request POST \
  --url 'https://console.advinservers.com/api/v1/client/transfers/quote' \
  --header 'Authorization: Bearer <token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "moves": [
    {
      "resource": "server",
      "uuids": [
        "ecc6f4f1-c89b-4dce-a20b-a330641c5b0b",
        "304e1794-a5b7-41f2-9a20-c0d444eb6683"
      ]
    },
    {
      "resource": "iso",
      "uuids": [
        "ec4fa5b5-cc7c-4fcf-b280-ee55eca8d44b"
      ]
    },
    {
      "resource": "firewall_group",
      "uuids": [
        "72a4a737-236f-456f-827f-6145d9c95727"
      ]
    },
    {
      "resource": "firewall_ip_group",
      "uuids": [
        "145e6e6f-a6b0-4b9e-9060-2d4f017baff8"
      ]
    },
    {
      "resource": "private_network",
      "uuids": [
        "5220f263-0e8e-4917-bf4f-4cae109ca4c5"
      ]
    },
    {
      "resource": "floating_ip",
      "uuids": [
        "1b8349e5-3568-43e0-bf89-fc3350dd7a08"
      ]
    }
  ],
  "team": "48454223-c5ac-461f-bead-ba8dda13eea9"
}'
{
  "ends_prepaid_billing": true,
  "credit": "4.12",
  "currency": "USD"
}

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

Body

application/json
movesobject[]required

The value of moves.

1 to 11 items

Show child attributes
resourcestringrequired

The type of resource this entry describes.

One of: server, ssh_key, user_script, iso, firewall_group, firewall_ip_group, private_network, floating_ip, snapshot_storage, website_hosting, license

uuidsstring[]required

The resource UUIDs to act on.

At least 1 items

teamstringrequired

The destination team UUID.

Exactly 36 characters

accept_postpaidboolean

The value of accept_postpaid.

Response 200

application/json

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

ends_prepaid_billingbooleanrequired

The value of ends_prepaid_billing.

creditstring | nullrequired

The available account credit, formatted for display.

currencystring | nullrequired

The three-letter currency code used for monetary amounts.

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.