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 'authorization: Bearer REPLACE_BEARER_TOKEN'
{- "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 'authorization: Bearer REPLACE_BEARER_TOKEN'
{- "cancellationReasons": [
- {
- "reason": "I no longer need it",
- "reasonCode": "CANCEL_NO_NEED"
}, - {
- "reason": "I was using it for trial only",
- "reasonCode": "CANCEL_TRIAL_ONLY"
}, - {
- "reason": "I purchased another service at Leaseweb",
- "reasonCode": "CANCEL_PURCHASED_OTHER"
}, - {
- "reason": "I found a better alternative elsewhere",
- "reasonCode": "CANCEL_BETTER_ALTERNATIVE"
}, - {
- "reason": "Product delivery was below expectations",
- "reasonCode": "CANCEL_DELIVERY_QUALITY"
}, - {
- "reason": "Product quality and/or stability was below expectations",
- "reasonCode": "CANCEL_PRODUCT_QUALITY"
}, - {
- "reason": "Customer support quality was below expectations",
- "reasonCode": "CANCEL_SUPPORT_QUALITY"
}, - {
- "reason": "Product features/possibilities below expectations",
- "reasonCode": "CANCEL_FEATURE_QUALITY"
}, - {
- "reason": "Customer Portal and/or API to manage the products was below expectations",
- "reasonCode": "CANCEL_MANAGE_QUALITY"
}, - {
- "reason": "Product price was too high",
- "reasonCode": "CANCEL_PRICE"
}, - {
- "reason": "Do not agree with offered Substitution",
- "reasonCode": "CANCEL_NEW_OFFER"
}, - {
- "reason": "My service was suspended",
- "reasonCode": "CANCEL_SUSPENSION"
}, - {
- "reason": "Other, please specify:",
- "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 'authorization: Bearer REPLACE_BEARER_TOKEN'
{- "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 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 'authorization: Bearer REPLACE_BEARER_TOKEN'