Ordering API
Leaseweb products are offered via a direct sales channel or by ordering via the leaseweb.com website.
With the introduction of the Ordering API, we enable you to order products via the API. You can leverage the Ordering API to streamline and automate your ordering process, enhancing efficiency and reducing manual effort. The release of the Ordering API is for Dedicated Servers and provides 3x endpoints. More endpoints will be made available for other products in the future.
What is included in this release?
- The API supports ordering some pre-defined Dedicated Servers that are available in 1 hour.
- Only the customers with invoice payments can place the orders.
- Orders are restricted to the sales organisation the API key belongs to.
First steps
- Generate an API key
- Go to https://secure.leaseweb.com > Administration > API Keys.
- For detailed instructions, refer to API Key Management
- For all endpoints, you need to set the following header: X-LSW-Auth: {API_KEY}
Endpoints
- List available Dedicated Servers
- You can get a list of available dedicated servers using the following endpoint:
- METHOD: GET
- URI: /v1/products/dedicatedServers
- Allowed query params:
- location: Desired datacenter for the dedicated server. Only location in your api key’s sales organization are allowed. Example: “AMS-01”
- ram: Desired amount of RAM for the Dedicated Server. Example: 128GB
- diskSize: Desired amount of disk space for the dedicated server. Example: SSD960GB
- diskAmount: Desired amount of disks for the dedicated server. Example: 2
- Will return a list of Dedicated Servers that match the criteria. Note that the price is not available in this endpoint.
{
"_metadata": {
"totalCount": 2,
"limit": 2,
"offset": 0
},
"dedicatedServers": [
{
"id": "27f38ef06cf3bf62e21e75401feac6cd",
"name": "Dell R730XD (12xLFF) 2x Intel Xeon E5-2650v4",
"chassis": "Dell R730XD (12xLFF)",
"cpu": {
"coresPerCPU": "12",
"totalCores": "24",
"quantity": "Dual",
"speed": "2,2 GHz",
"type": "Intel Xeon E5-2650v4"
},
"deliveryMethod": "1 hour",
"hdd": [
{
"amount": "2",
"size": "SSD480GB"
}
],
"ram": {
"size": "32",
"unit": "GB"
},
"location": [
"AMS-01",
"AMS-02"
]
},
{
"id": "e2f0e2f2a3083d9f4b5ca9ebe34ae5d3",
"name": "Dell R7525 (16SFF+8NVMe) 2x AMD EPYC 7543",
"chassis": "Dell R7525 (16SFF+8NVMe)",
"cpu": {
"coresPerCPU": "32",
"totalCores": "64",
"quantity": "Dual",
"speed": "2,8 GHz",
"type": "AMD EPYC 7543"
},
"deliveryMethod": "1 hour",
"hdd": [
{
"amount": "2",
"size": "SSD960GB"
},
{
"amount": "2",
"size": "U2_3.2TB"
}
],
"ram": {
"size": "128",
"unit": "GB"
},
"location": [
"AMS-01"
]
}
]
}
Get a Dedicated Server
- To get more detailed information about a Dedicated Server, including pricing and availability, you can use the following endpoint:
- METHOD: GET
- URI: /v1/products/dedicatedServers/{dedicatedServerId}
- Allowed query params:
- location (required): Desired datacenter for the dedicated server. Only location in your api key’s sales organization are allowed. Example: “AMS-01”
- connectedToAggregationPool: Whether you want the dedicated server to connected to an aggregation pool. Note that you’ll need to have at least one aggregation pool in your api key’s sales organization. Example: true
- contractTerm: Desired contract term. Example: “3_YEARS”
- This will return a single dedicated server object with the price by contract term type.
{
"id": "a0d5da7fa1126f688e2144ce00ab5d75",
"cpu": {
"coresPerCPU": "12",
"totalCores": "24",
"quantity": "Dual",
"speed": "2,2 GHz",
"type": "Intel Xeon E5-2650v4"
},
"chassis": "Dell R730XD (12xLFF)",
"hdd": [
{
"amount": "2",
"size": "SSD480GB"
}
],
"ram": {
"size": "128",
"unit": "GB"
},
"deliveryMethod": "1 hour",
"name": "Dell R730XD (12xLFF) 2x Intel Xeon E5-2650v4",
"locations": [
"AMS-01"
],
"price": {
"currency": "EUR",
"basePrice": 155.26,
"tax": 41.27,
"setupFee": 0,
"fee": 196.54,
"discounts": [],
"total": 237.81,
"contractTerms": [
{
"key": "1_MONTH",
"description": "1 month",
"discount_text": "0%",
"discount_value": 0,
"total": 237.81
},
{
"key": "3_MONTHS",
"description": "3 months",
"discount_text": "-3%",
"discount_value": -3,
"total": 230.68
},
{
"key": "6_MONTHS",
"description": "6 months",
"discount_text": "-3%",
"discount_value": -3,
"total": 230.68
},
{
"key": "1_YEAR",
"description": "1 year",
"discount_text": "-5%",
"discount_value": -5,
"total": 225.92
},
{
"key": "2_YEARS",
"description": "2 years",
"discount_text": "-10%",
"discount_value": -10,
"total": 214.03
},
{
"key": "3_YEARS",
"description": "3 years",
"discount_text": "-15%",
"discount_value": -15,
"total": 202.14
}
],
"billingCycle": "1 month"
}
}
Order a Dedicated Server
- To order a dedicated server, you can use the following endpoint:
- METHOD: POST
- URI: /v1/products/dedicatedServers/{dedicatedServerId}/order
- ALLOWED BODY PARAMS (JSON):
- location (required): Desired datacenter for the dedicated server. Only the location in your api key’s sales organisation is allowed. Example: “AMS-01”
- connectedToAggregationPool: Whether you want the dedicated server to connect to an aggregation pool. Note that you must have at least one aggregation pool in your api key’s sales organisation. Example: true
- contractTerm: Desired contract term. Example: “3_YEARS”
- This will return an order ID.
{
"orderId": 44011723
}
We want to keep it simple. There is no “adding to cart” concept, and the orders are asynchronous. The status of the order can be checked in the Customer Portal > All Products > Orders.
Steps to order a Dedicated Server via API
- Browse the list of available servers
- Get more information on a Dedicated Server and get the pricing details
- Place the order
The API documentation can be found at https://developer.leaseweb.com/docs/#tag/Ordering