LeaseWeb API for all Services (v1)

The base URL for this API is: https://api.leaseweb.com/services/v1/

Errors

The API uses standard HTTP status codes to indicate the success or failure of the API call. The response will be JSON. Most APIs use the following format:

{
"errorCode" : "APP00800",
"errorMessage" : "The connection with the DB cannot be established.",
"correlationId" : "550e8400-e29b-41d4-a716-446655440000",
"userMessage" : "Cannot handle your request at the moment. Please try again later."}

Authentication

Authentication for the APIs is required. To authenticate your call, you will need to sent your API key as X-LSW-Auth header.

You can generate API keys in the Customer Portal

Services

Get all your Services

This endpoint returns all your Services.

Authorizations:
X-LSW-Auth
query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

productId
string

Filter the services endpoint with a productId

reference
string

Filter the services endpoint with a reference

equipmentId
string

Filter the services endpoint with an equipmentId

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/services/v1/services \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "metadata": {
    },
  • "services": [
    ]
}

Get cancellation reasons

This endpoint will return our predefined cancellation reasons.

Authorizations:
X-LSW-Auth

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/services/v1/services/cancellationReasons \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "cancellationReasons": [
    ]
}

Inspect a service

This endpoint will return a single service for the customer.

Authorizations:
X-LSW-Auth
path Parameters
id
required
string
Example: 41000000000000

The ID of a service

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/services/v1/services/41000000000000 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "billingCycle": "1 MONTH",
  • "cancellable": false,
  • "contractId": "00000110",
  • "contractTerm": "1 YEAR",
  • "contractTermEndDate": "2020-01-31T00:00:00+00:00",
  • "currency": "EUR",
  • "deliveryDate": "2019-01-01T00:00:00+00:00",
  • "deliveryEstimate": "5 - 7 business days",
  • "endDate": "2020-01-31T00:00:00+00:00",
  • "equipmentId": "12345678",
  • "id": "10000000000010",
  • "orderDate": "2019-01-01T00:00:00+00:00",
  • "pricePerFrequency": 396.01,
  • "productId": "DEDICATED_SERVER",
  • "reference": "this is a reference",
  • "startDate": "2019-01-01T00:00:00+00:00",
  • "status": "ACTIVE",
  • "uncancellable": true
}

Update a service

This endpoint allows you to update the reference of a service.

Additionally, if you're already using other product API's, you have the flexibility to modify the reference not only via this endpoint but also through their respective APIs. Please note that not all services have a corresponding product API.

Authorizations:
X-LSW-Auth
path Parameters
id
required
string
Example: 41000000000000

The ID of a service

Request Body schema: application/json
reference
string non-empty

The reference of the service

Responses

Request samples

Content type
application/json
{
  • "reference": "Awesome service reference"
}

Response samples

Content type
application/json
{
  • "billingCycle": "1 MONTH",
  • "cancellable": false,
  • "contractId": "00000110",
  • "contractTerm": "1 YEAR",
  • "contractTermEndDate": "2020-01-31T00:00:00+00:00",
  • "currency": "EUR",
  • "deliveryDate": "2019-01-01T00:00:00+00:00",
  • "deliveryEstimate": "5 - 7 business days",
  • "endDate": "2020-01-31T00:00:00+00:00",
  • "equipmentId": "12345678",
  • "id": "10000000000010",
  • "orderDate": "2019-01-01T00:00:00+00:00",
  • "pricePerFrequency": 396.01,
  • "productId": "DEDICATED_SERVER",
  • "reference": "Awesome service reference",
  • "startDate": "2019-01-01T00:00:00+00:00",
  • "status": "ACTIVE",
  • "uncancellable": true
}

Cancel a service

This endpoint will cancel a specified service.

Authorizations:
X-LSW-Auth
path Parameters
id
required
string
Example: 41000000000000

The ID of a service

Request Body schema: application/json
reason
string

If reasonCode is set to CANCEL_OTHER, this field is required and respresents the reason.

reasonCode
string

The reason code respresents a defined reason.

Responses

Request samples

Content type
application/json
{
  • "reason": "I am scaling down",
  • "reasonCode": "CANCEL_OTHER"
}

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "404",
  • "errorMessage": "Resource not found"
}

Uncancel a service

This endpoint will uncancel an already cancelled service.

Authorizations:
X-LSW-Auth
path Parameters
id
required
string
Example: 41000000000000

The ID of a service

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/services/v1/services/41000000000000/uncancel \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "404",
  • "errorMessage": "Resource not found"
}