The base URL for this API is: https://api.leaseweb.com/services/v1/
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 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
This endpoint returns all your Services.
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 |
curl --request GET \ --url https://api.leaseweb.com/services/v1/services \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "metadata": {
- "limit": 2,
- "offset": 0,
- "totalCount": 10
}, - "services": [
- {
- "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
}, - {
- "attributes": {
- "domainName": "test.com"
}, - "billingCycle": "1 YEAR",
- "cancellable": true,
- "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",
- "id": "10000000000011",
- "orderDate": "2019-01-01T00:00:00+00:00",
- "pricePerFrequency": 139.99,
- "productId": "DOMAIN",
- "startDate": "2019-01-01T00:00:00+00:00",
- "status": "ACTIVE",
- "uncancellable": false
}
]
}
This endpoint will return our predefined cancellation reasons.
curl --request GET \ --url https://api.leaseweb.com/services/v1/services/cancellationReasons \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "cancellationReasons": [
- {
- "reason": "End of trial period?",
- "reasonCode": "CANCEL_TRIAL_PERIOD"
}, - {
- "reason": "Product switch within Leaseweb?",
- "reasonCode": "CANCEL_PRODUCT_SWITCH"
}, - {
- "reason": "Missing functions/features of product?",
- "reasonCode": "CANCEL_FEATURE_QUALITY"
}, - {
- "reason": "High prices?",
- "reasonCode": "CANCEL_HIGH_PRICE"
}, - {
- "reason": "Suspension of service?",
- "reasonCode": "CANCEL_SUSPENSION"
}, - {
- "reason": "Disagreement with the offered substitution?",
- "reasonCode": "CANCEL_NEW_OFFER"
}, - {
- "reason": "Long order delivery time?",
- "reasonCode": "CANCEL_DELIVERY_TIME"
}, - {
- "reason": "Order was out of stock?",
- "reasonCode": "CANCEL_OUT_OF_STOCK"
}, - {
- "reason": "Faulty delivery?",
- "reasonCode": "CANCEL_FAULTY_DELIVERY"
}, - {
- "reason": "Inconsistency of contract and offer?",
- "reasonCode": "CANCEL_INCONSISTENCY"
}, - {
- "reason": "Performance of product?",
- "reasonCode": "CANCEL_PERFORMANCE"
}, - {
- "reason": "Network issues?",
- "reasonCode": "CANCEL_NETWORK"
}, - {
- "reason": "Technical knowledge of Support?",
- "reasonCode": "CANCEL_SUPPORT_QUALITY"
}, - {
- "reason": "Slow response of Support?",
- "reasonCode": "CANCEL_SUPPORT_RESPONSE"
}, - {
- "reason": "Long resolution times of Support?",
- "reasonCode": "CANCEL_SUPPORT_RESOLUTION_TIME"
}, - {
- "reason": "Usability issues on Customer Portal/API?",
- "reasonCode": "CANCEL_CP_USABILITY"
}, - {
- "reason": "Missing functions/features on Customer Portal/API?",
- "reasonCode": "CANCEL_CP_FEATURE_QUALITY"
}, - {
- "reason": "Reliability of product?",
- "reasonCode": "CANCEL_RELIABILITY"
}, - {
- "reason": "Other selection?",
- "reasonCode": "CANCEL_OTHER"
}
]
}
This endpoint will return a single service for the customer.
id required | string Example: 41000000000000 The ID of a service |
curl --request GET \ --url https://api.leaseweb.com/services/v1/services/41000000000000 \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "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
}
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.
id required | string Example: 41000000000000 The ID of a service |
reference | string non-empty The reference of the service |
{- "reference": "Awesome service reference"
}
{- "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
}
This endpoint will cancel a specified service.
id required | string Example: 41000000000000 The ID of a service |
reason | string If |
reasonCode | string The reason code respresents a defined reason. |
{- "reason": "I am scaling down",
- "reasonCode": "CANCEL_OTHER"
}
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "404",
- "errorMessage": "Resource not found"
}
This endpoint will uncancel an already cancelled service.
id required | string Example: 41000000000000 The ID of a service |
curl --request POST \ --url https://api.leaseweb.com/services/v1/services/41000000000000/uncancel \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "404",
- "errorMessage": "Resource not found"
}