/invoices
Invoices sent to companies. The invoice state is an enum with the possible values OUTSTANDING, OVERDUE or PAID.
Endpoints
Method | Path |
---|---|
GET | / |
GET | /{id} |
GET | /search/findByInvoiceState |
GET | /search/findByIdentifierLikeIgnoreCaseAndInvoiceState |
GET | /search/findByCreationDateBetween |
POST | / |
POST | /{id}/markPaid |
PUT | /{id} |
DELETE | /{id} |
Projections
Name | Description |
---|---|
withDebitor | The debitor company is embedded. |
Structure
Fieldname | Fieldtype | Validations |
---|---|---|
id | Long | |
version | Integer | |
identifier | String | not empty, unique |
creationDate | Date | not null |
invoiceTotal | Number | > 0 |
dueDate | Date | |
invoiceState | invoice state enum | not empty |
Links | Security |
GET /▲
Get all invoices.
Security
ROLE_ADMIN
Returns
A page of invoices.
Parameters
pageableGET /{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
pageablename | type | required | description |
---|---|---|---|
state | invoice state | true | The invoice state to search for. |
GET /search/findByIdentifierLikeIgnoreCaseAndInvoiceState▲
Find invoices by their state and identifier.
Security
ROLE_ADMIN
Returns
A page of invoices.
Parameters
pageablename | type | required | description |
---|---|---|---|
identifier | String | true | The identifier to search for. % is wildcard. |
state | invoice state | true | The invoice state to search for. |
GET /search/findByCreationDateBetween▲
Find invoices in an interval.
Security
ROLE_ADMIN
Returns
A list of invoices.
Parameters
name | type | required | description |
---|---|---|---|
start | Date | true | The start of the interval. |
end | Date | true | The 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