Migrating to the new /invoices endpoint and other REST news
Dear e-conomic API developer,
In this edition of the e-conomic developer newsletter you can learn about the new /invoices endpoint in REST and see what you need to do to migrate to the new endpoint. Also in REST: New and stable customer functionality and accruals on invoice lines.
Migrating to the new /invoices endpoint
When we first set out to create a REST API the first proof of concept was the /invoices endpoint. We learned a lot from working with this endpoint, but ultimately we decided that the only thing worth reusing from that endpoint was the experiences we made.
So we created a new endpoint to replace the old /invoices endpoint. The new endpoint is now stable and safe for production consumption. So what does that mean for you? Two things:
- You get added value with the new /invoices endpoint in the form of new functionality and a simpler model
- You need to switch your apps to the new endpoint using the migration path we have created
For now, in Stage 1 of the migration, the most important thing for you to do is to change your code to start using the aliased /invoices-deprecated endpoint which exposes the same functionality as the deprecated /invoices endpoint.
By doing this, your application won’t break when we change the functionality of /invoices. This will happen in Stage 2 starting September 1st when we will change the functionality of /invoices to be the same as /invoices-experimental.
In terms of added value with the new endpoint, you get single document invoices, template functionality, invoice totals, annotated errors and accruals on invoice lines (see more below) by switching to the new /invoices endpoint.
Stable customer functionality in REST
The /customers endpoint has also become stable and fully verified for production purposes, without any need for a new endpoint.
We might add more properties to the endpoint along the way, but the basic signature will not change. We have already added various improvements to the customer functionality, including better handling of customer numbers and contacts, plus new /delivery-locations and /totals endpoints.
With customers being stable and the migration to the new /invoices endpoint, we now allow you to perform all the operations required for creating, handling and booking invoices using REST.
Set accruals on invoice lines
As another new feature available with the new /invoices endpoint, you can now set accruals on invoice lines in REST.
With the Accruals add-on module you can distribute costs and/or income over a number of periods so you can easily handle rental, insurance, subscription and other distributed payments. This way you get more accurate results for each period and a better overview of how the company is doing.
Setting accruals on a line is as simple as adding an accruals object containing the properties startDate and endDate (YYYY-MM-DD) to the invoice line object.
Your e-conomic API team