Invoices (v1)

The base URL for this API is: https://api.leaseweb.com/invoices/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.",
"reference" : "http://developer.leaseweb.com/errors/APP00800"
}

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.

Invoices

List invoices

This endpoint will return an overview of all the invoices for the customer.

Authorizations:
query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/invoices/v1/invoices \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "_metadata": {
    },
  • "invoices": [
    ]
}

Pro Forma

This endpoint will return an overview of contract items that will be invoiced as of the 1st of the upcoming month

Authorizations:
query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/invoices/v1/invoices/proforma \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "_metadata": {
    },
  • "contractItems": [
    ],
  • "currency": "EUR",
  • "proformaDate": "2020-06-01T00: 00: 00+00: 00",
  • "subTotal": 300.04,
  • "total": 352.55,
  • "vatAmount": 52.51
}

Inspect an invoice

This endpoint will return a single invoice for the customer.

Authorizations:
path Parameters
invoiceId
required
string
Example: 00000001

Invoice Id

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/invoices/v1/invoices/00000001 \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "credits": [
    ],
  • "currency": "EUR",
  • "date": "2019-05-06T00:00:00+00:00",
  • "dueDate": "2019-05-30T00:00:00+00:00",
  • "id": "00000001",
  • "isPartialPaymentAllowed": true,
  • "lineItems": [
    ],
  • "openAmount": 1756.21,
  • "status": "OPEN",
  • "taxAmount": 0,
  • "total": 1756.21
}

Get invoice PDF

This endpoint will return a PDf of a single invoice for the customer.

Authorizations:
path Parameters
invoiceId
required
string
Example: 00000001

Invoice Id

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/invoices/v1/invoices/00000001/pdf \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "401",
  • "errorMessage": "You are not authorized to view this resource."
}