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

200
401

Authentication is required.

403
500
503
get/invoices
https://api.leaseweb.com/invoices/v1/invoices

Request samples

Copy
curl --request GET \
  --url 'https://api.leaseweb.com/invoices/v1/invoices?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'leaseweb api key: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "invoices":
    [
    ],
  • "_metadata":
    {
    }
}

Inspect an invoice

This endpoint will return a single invoice for the customer.

Authorizations:
path Parameters
invoiceId
required
string
Example: 00000001

Invoice Id

Responses

200
401

Authentication is required.

403
404

Resource not found.

500
503
get/invoices/{invoiceId}
https://api.leaseweb.com/invoices/v1/invoices/{invoiceId}

Request samples

Copy
curl --request GET \
  --url https://api.leaseweb.com/invoices/v1/invoices/00000001 \
  --header 'leaseweb api key: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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":
    [
    ],
  • "lineItems":
    [
    ]
}