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" : "http://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 Default: 10 Limit the number of results returned |
offset | integer Default: 0 Return results starting from the given offset |
Authentication is required.
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'
{- "invoices": [
- {
- "id": "00000001",
- "date": "2019-05-06T00:00:00+00:00",
- "dueDate": "2019-05-30T00:00:00+00:00",
- "taxAmount": 0,
- "total": 1756.21,
- "openAmount": 1756.21,
- "currency": "EUR",
- "isPartialPaymentAllowed": true,
- "status": "OVERDUE"
}, - {
- "id": "00000002",
- "date": "2019-05-06T00:00:00+00:00",
- "dueDate": "2019-05-30T00:00:00+00:00",
- "taxAmount": 0,
- "total": 34,
- "openAmount": 34,
- "currency": "EUR",
- "isPartialPaymentAllowed": true,
- "status": "OPEN"
}, - {
- "id": "00000003",
- "date": "2019-04-06T00:00:00+00:00",
- "dueDate": "2019-04-30T00:00:00+00:00",
- "taxAmount": 0,
- "total": 14.37,
- "openAmount": 0,
- "currency": "EUR",
- "isPartialPaymentAllowed": false,
- "status": "PAID"
}
], - "_metadata": {
- "totalCount": 3,
- "offset": 0,
- "limit": 0
}
}
This endpoint will return a single invoice for the customer.
invoiceId required | string Example: 00000001 Invoice Id |
Authentication is required.
Resource not found.
curl --request GET \ --url https://api.leaseweb.com/invoices/v1/invoices/00000001 \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'
{- "id": "00000001",
- "date": "2019-05-06T00:00:00+00:00",
- "dueDate": "2019-05-30T00:00:00+00:00",
- "total": 1756.21,
- "taxAmount": 0,
- "openAmount": 1756.21,
- "currency": "EUR",
- "isPartialPaymentAllowed": true,
- "status": "OPEN",
- "credits": [
- {
- "id": "00001211",
- "date": "2019-05-06T00:00:00+00:00",
- "taxAmount": 1.5,
- "total": 15
}
], - "lineItems": [
- {
- "contractId": "12345678",
- "equipmentId": "1234",
- "product": "Rackspace",
- "reference": "This is a reference",
- "quantity": 1,
- "unitAmount": 151.5,
- "totalAmount": 151.5
}
]
}