With the introduction of the Ordering API for Object Storage, we enable you to order Leaseweb Object Storage 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?
- Product scope: Both Object Storage products can be ordered via the API:
- Reserved: a fixed storage capacity for a contract term. You choose the capacity (500 GB to 1,000,000 GB, in steps of 100 GB) and the contract term (1 month to 3 years). Longer terms get a discount.
- On Demand: no fixed capacity and no contract term. You only pay for what you use.
- Usage billing: for both products, usage (stored data, outgoing traffic and API calls) is billed on top of the periodic price, at the usage prices returned by the API.
- Eligibility: Only existing, verified customers who are on invoice payment with no prepayment obligation can order via the API. If you are on invoice payment but get an error when ordering, your account probably has a prepayment requirement; contact Leaseweb Sales or log a support ticket to have it removed. New customers must complete the Know Your Customer (KYC) process first.
- Sales Organization: you can only order in locations that belong to the Leaseweb entity of your API key. For example, a key from the US entity can only order Object Storage in US data centers.
- Dry run: you can validate an order without placing it. Nothing is ordered and nothing is charged.
- Available locations:
- Amsterdam (AMS-01)
- Frankfurt am Main (FRA-01)
- London (LON-01)
- Montreal (MTL-02)
- Singapore (SIN-01)
- Washington DC (WDC-02)
- Note: the available locations can change. New locations are added when capacity becomes available, and an existing location may no longer show up when its capacity is full. The list above reflects the locations at the time of writing.
First steps
- Generate an API key in the Customer Portal under Administration > API Keys.
- For detailed instructions, refer to API Key Management
- For all endpoints, set the
X-LSW-Authheader to your API key:X-LSW-Auth: {API_KEY} - All endpoints use the base URL
https://api.leaseweb.com/ordering/v1.
Endpoints
There are 2 endpoints.
- Get an Object Storage product and its price
- Place an order for Object Storage product
Object Storage has only two products, so there is no list endpoint. Use reserved or onDemand as the {objectStorageId} in the path.
Get an Object Storage product and its price
GET /products/objectStorages/{objectStorageId}
Returns the product, its price for the configuration you ask for, the discount per contract term, and the usage prices.
| Query parameter | Required | Values | Notes |
|---|---|---|---|
location | Yes | AMS-01, FRA-01, LON-01, MTL-02, SIN-01, WDC-02Note: The available locations can change depending on the availability. | The data center location |
storageQuantity | No | 500 to 1000000, multiple of 100 (default 500) | Capacity in GB. Only for reserved |
contractTerm | No | 1_MONTH (default), 3_MONTHS, 6_MONTHS, 1_YEAR, 2_YEARS, 3_YEARS | Only for reserved |
The response includes:
price.total: the periodic price for the selected capacity and term, with the term discount applied.price.contractTerms: the total and discount for every contract term, so you can compare them in one call.price.usagePrices: the price per unit for stored data (per GB/month), outgoing traffic (per GB/month) and API calls (per 1,000). These are billed on top ofprice.total.configurationOptions.storageQuantity: the accepted capacity range and step (only forreserved).
Note: the location field in the response lists every location where the product exists, regardless of your API key’s entity. You can only order in the locations of your own entity.
Order Object Storage
POST /products/objectStorages/{objectStorageId}/order
Places the order. Each request orders one Object Storage, so to order several you send several requests. A successful order returns 201 Created with the orderId.
| Body field | Required | Values | Notes |
|---|---|---|---|
location | Yes | AMS-01, FRA-01, LON-01, MTL-02, SIN-01, WDC-02Note: The available locations can change depending on the availability. | Must belong to your API key’s entity |
storageQuantity | No | 500 to 1000000, multiple of 100 (default 500) | Capacity in GB. Only for reserved |
contractTerm | No | 1_MONTH (default), 3_MONTHS, 6_MONTHS, 1_YEAR, 2_YEARS, 3_YEARS | Only for reserved |
dryRun | No | true or false (default) | Validates the order without placing it |
Important: for onDemand, send only location (and optionally dryRun). Ordering onDemand with storageQuantity or contractTerm returns 400 Bad Request.
Dry run: set "dryRun": true to check an order before you place it. The request is validated the same way as a real order, including your payment eligibility. The response contains "dryRun": true and a placeholder orderId. No contract is created and nothing is charged.
Examples
Getting the price of 1,000 GB Reserved Object Storage in AMS-01 on a 1-year term:
curl --request GET \
--url 'https://api.leaseweb.com/ordering/v1/products/objectStorages/reserved?location=AMS-01&storageQuantity=1000&contractTerm=1_YEAR' \
--header 'X-LSW-Auth: {API_KEY}'
Getting the usage prices of On Demand Object Storage in FRA-01:
curl --request GET \
--url 'https://api.leaseweb.com/ordering/v1/products/objectStorages/onDemand?location=FRA-01' \
--header 'X-LSW-Auth: {API_KEY}'
Checking an order with a dry run (1,000 GB Reserved, AMS-01, 1 year):
curl --request POST \
--url 'https://api.leaseweb.com/ordering/v1/products/objectStorages/reserved/order' \
--header 'X-LSW-Auth: {API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
"location": "AMS-01",
"storageQuantity": 1000,
"contractTerm": "1_YEAR",
"dryRun": true
}'
Response (201 Created, nothing ordered):
{
"orderId": 0,
"dryRun": true
}
Placing the same order: send the same request without dryRun. Response (201 Created):
{
"orderId": 44011723
}
Ordering On Demand Object Storage in FRA-01:
curl –request POST \
–url ‘https://api.leaseweb.com/ordering/v1/products/objectStorages/onDemand/order’ \
–header ‘X-LSW-Auth: {API_KEY}’ \
–header ‘Content-Type: application/json’ \
–data ‘{“location”: “FRA-01”}’
After you order
- Track the order: use the orderId with the Orders API: GET /account/v1/orders/{Id}. You can also list all your orders with GET /account/v1/orders.
- Set up your storage: once delivered, the Object Storage API (/objectStorage/v1/objectStorages) lets you manage buckets, users, groups and access keys. You can also do this in the Customer Portal.
Errors
All errors return a correlationId, an errorCode and an errorMessage. Please include the correlationId when you contact Support.