Ordering API for VPS

Ordering API for VPS

With the introduction of the Ordering API for VPS, we enable you to order VPS via the API. You can leverage this API to streamline and automate your ordering process, enhancing efficiency and reducing manual effort.

What is included in this release?

  • The API supports ordering all available VPS products
  • Only verified existing customers can place orders via API. If you are a new customer, KYC needs to be done before an order via the API can be available
  • Orders are restricted to the sales organisation the API key belongs to
    • For example, with an API key belonging to the US entity, customers can see and order the VPS products available in our US Data Centers
  • Available locations
    • Amsterdam (AMS-01)
    • Frankfurt am Main (FRA-01)
    • London (LON-01)
    • Montreal (MTL-02)
    • San Francisco (SFO-12)
    • Singapore (SIN-01)
    • Sydney (SYD-12)
    • Tokyo (TYO-11)
    • Washington DC (WDC-02)

First steps

  1. Generate an API key
  2. For all endpoints, you need to set the following header: X-LSW-Auth: {API_KEY}

Endpoints

There are 3 API endpoints available.

  1. List all available VPS
  2. Get more information on a particular VPS
  3. Place the order

1. List endpoint

/products/vps

With this GET endpoint, you can get all the available VPS products for the provided location. The response of this endpoint shows the base price of a VPS. Applicable discounted prices can be queried using the second endpoint.

2. Get a single VPS and its price

/products/vps/{vpsid}

This GET endpoint provides more details about a particular VPS, such as its price, discounts, and all configuration options.

Please note that not all control panels are compatible with the different operating systems. Refer to the link below for compatibility details.

By default, if no operating system is specified in the GET request, Ubuntu 24.04 is chosen as the default, and the response returns the control panels compatible with that operating system. To see the list of compatible control panels with a different operating system, please specify the respective operating system in the request.

Below is an example request to query the details of VPS 3 in AMS-01 location with Ubuntu 22.04 operating system. The response to this request will include the list of compatible control panels with Ubuntu 22.04.

/v1/products/vps/VPS02_3?&location=AMS-01&operatingSystem=Ubuntu 22.04

3. Order a VPS

/products/vps/{vpsid}/order 

A chosen VPS can be ordered with this POST endpoint. To order multiple VPSes, you should send multiple requests.

While placing an order, several extras can be chosen.

  • Disk can be upgraded. This upgrade disk is an extra disk that is added to the VPS.
  • An operating system can be chosen. This is free of cost. If you don’t provide any parameter for this, by default it is Ubuntu 24.04
  • A Control Panel can be added if required. As mentioned above, it needs to be compatible with the selected operating system.
  • A Service Level Agreement can be selected.

API Documentation

The API documentation can be found at https://developer.leaseweb.com/docs/#tag/Ordering/operation/getVpsList1

Examples:

Querying all the available VPS products in the Amsterdam entity

curl --location 'https://api.leaseweb.com/ordering/v1/products/vps?location=AMS-01' \
--header 'Content-Type: application/json' \
--header 'X-LSW-Auth: auth'

Querying more details about Leaseweb VPS 3

curl --location 'https://api.leaseweb.com/ordering/v1/products/vps/VPS02_3?location=AMS-01' \
--header 'Content-Type: application/json' \
--header 'X-LSW-Auth: auth'

Ordering Leaseweb VPS 2 in location AMS-01 with Debian 13, a 50GB disk upgrade, Bronze SLA, 1 year billing cycle for a 3-year contract term

curl --location 'https://api.leaseweb.com/ordering/v1/products/vps/VPS02_2/order?location=AMS-01' \
--header 'Content-Type: application/json' \
--header 'X-LSW-Auth: auth' \
--data '{
"operatingSystem": "Debian 13",
"diskUpgrade": "50GB",
"location": "AMS-01",
"serviceLevelAgreement": "BRONZE",
"billingCycle": "1_YEAR",
"contractTerm": "3_YEARS"
}'

Additional Documentation

You can find more information about the VPS product specifications below.