API Documentation

/invoices

Invoices sent to companies. The invoice state is an enum with the possible values OUTSTANDING, OVERDUE or PAID.

Endpoints

MethodPath
GET/
GET/{id}
GET/search/findByInvoiceState
GET/search/findByIdentifierLikeIgnoreCaseAndInvoiceState
GET/search/findByCreationDateBetween
POST/
POST/{id}/markPaid
PUT/{id}
DELETE/{id}

Projections

NameDescription
withDebitorThe debitor company is embedded.

Structure

FieldnameFieldtypeValidations
idLong
versionInteger
identifierStringnot empty, unique
creationDateDatenot null
invoiceTotalNumber> 0
dueDateDate
invoiceStateinvoice state enumnot empty
LinksSecurity

GET /

Get all invoices.

Security

ROLE_ADMIN

Returns

A page of invoices.

Parameters

pageable

GET /{id}

Get a single invoice by its id.

Security

ROLE_ADMIN

Returns

One invoice.


GET /search/findByInvoiceState

Find invoices by their state.

Security

ROLE_ADMIN

Returns

A page of invoices.

Parameters

pageable
nametyperequireddescription
stateinvoice statetrueThe invoice state to search for.

GET /search/findByIdentifierLikeIgnoreCaseAndInvoiceState

Find invoices by their state and identifier.

Security

ROLE_ADMIN

Returns

A page of invoices.

Parameters

pageable
nametyperequireddescription
identifierStringtrueThe identifier to search for. % is wildcard.
stateinvoice statetrueThe invoice state to search for.

GET /search/findByCreationDateBetween

Find invoices in an interval.

Security

ROLE_ADMIN

Returns

A list of invoices.

Parameters

nametyperequireddescription
startDatetrueThe start of the interval.
endDatetrueThe end of the interval.

POST /

Create a new invoice. Returns the created object. If the due date is in the past the state is set to OVERDUE. If the debitor has a timeForPayment and the due date is not set it is calculated from that.

Security

ROLE_ADMIN

Returns

A single invoice.


POST /{id}/markPaid

Mark an invoice as paid.

Security

ROLE_ADMIN

Returns

"Ok." if it succeeded.


PUT /{id}

Update the invoice identified by id. Returns the updated object. If the due date is in the past the state is set to OVERDUE. If the debitor has a timeForPayment and the due date is not set it is calculated from that.

Security

ROLE_ADMIN

Returns

An invoice.


DELETE /{id}

Delete the invoice identified by id.

Security

ROLE_ADMIN

Returns

Nothing