The base URL for this API is: https://api.leaseweb.com/invoices/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.",
"reference": "https://developer.leaseweb.com/errors/APP00800"
}
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 will return an overview of all the invoices for the customer.
limit | integer Example: limit=20 Limit the number of results returned. |
offset | integer Example: offset=10 Return results starting from the given offset. |
curl --request GET \ --url 'https://api.leaseweb.com/invoices/v1/invoices?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "limit": 0,
- "offset": 0,
- "totalCount": 3
}, - "invoices": [
- {
- "currency": "EUR",
- "date": "2019-05-06T00:00:00+00:00",
- "dueDate": "2019-05-30T00:00:00+00:00",
- "id": "00000001",
- "isPartialPaymentAllowed": true,
- "openAmount": 1756.21,
- "status": "OVERDUE",
- "taxAmount": 0,
- "total": 1756.21
}, - {
- "currency": "EUR",
- "date": "2019-05-06T00:00:00+00:00",
- "dueDate": "2019-05-30T00:00:00+00:00",
- "id": "00000002",
- "isPartialPaymentAllowed": true,
- "openAmount": 34,
- "status": "OPEN",
- "taxAmount": 0,
- "total": 34
}, - {
- "currency": "EUR",
- "date": "2019-04-06T00:00:00+00:00",
- "dueDate": "2019-04-30T00:00:00+00:00",
- "id": "00000003",
- "isPartialPaymentAllowed": false,
- "openAmount": 0,
- "status": "PAID",
- "taxAmount": 0,
- "total": 14.37
}
]
}
This endpoint will return an overview of contract items that will be invoiced as of the 1st of the upcoming month.
limit | integer Example: limit=20 Limit the number of results returned. |
offset | integer Example: offset=10 Return results starting from the given offset. |
curl --request GET \ --url 'https://api.leaseweb.com/invoices/v1/invoices/proforma?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 2
}, - "contractItems": [
- {
- "contractId": "50000103",
- "currency": "EUR",
- "endDate": "2021-01-01T00:00:00+00:00",
- "equipmentId": "26430",
- "poNumber": "40002154000110",
- "price": 150.05,
- "product": "Backup",
- "reference": "this is a reference",
- "startDate": "2020-01-01T00:00:00+00:00"
}, - {
- "contractId": "50000103",
- "currency": "EUR",
- "endDate": "2021-01-01T00:00:00+00:00",
- "equipmentId": "26430",
- "poNumber": "40002154000110",
- "price": 150.05,
- "product": "Dedicated server",
- "reference": "this is a reference",
- "startDate": "2020-01-01T00:00:00+00:00"
}
], - "currency": "EUR",
- "proformaDate": "2020-06-01T00: 00: 00+00: 00",
- "subTotal": 300.04,
- "total": 352.55,
- "vatAmount": 52.51
}
This endpoint will return a single invoice for the customer.
invoiceId required | string Example: 00000001 Invoice Id |
curl --request GET \ --url https://api.leaseweb.com/invoices/v1/invoices/00000001 \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "credits": [
- {
- "date": "2019-05-06T00:00:00+00:00",
- "id": "00001211",
- "taxAmount": 1.5,
- "total": 15
}
], - "currency": "EUR",
- "date": "2019-05-06T00:00:00+00:00",
- "dueDate": "2019-05-30T00:00:00+00:00",
- "id": "00000001",
- "isPartialPaymentAllowed": true,
- "lineItems": [
- {
- "contractId": "12345678",
- "equipmentId": "1234",
- "product": "Rackspace",
- "quantity": 1,
- "reference": "This is a reference",
- "total": 151.5,
- "unitAmount": 151.5,
- "fromDate": "2023-02-01T00:00:00Z",
- "toDate": "2023-02-28T00:00:00Z"
}
], - "openAmount": 1756.21,
- "status": "OPEN",
- "taxAmount": 0,
- "total": 1756.21
}
This endpoint will return a PDf of a single invoice for the customer.
invoiceId required | string Example: 00000001 Invoice Id |
curl --request GET \ --url https://api.leaseweb.com/invoices/v1/invoices/00000001/pdf \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "401",
- "errorMessage": "You are not authorized to view this resource."
}