Invoices (v1)

License: Apache 2.0

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": "https://developer.leaseweb.com/errors/APP00800"
}

API Key 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:
X-LSW-Auth
query Parameters
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

Responses

Request samples

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'

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:
X-LSW-Auth
query Parameters
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

Responses

Request samples

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'

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:
X-LSW-Auth
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:
X-LSW-Auth
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."
}