Join us at Fortnox App Market today!

Updating document rows using RowId

The new possibility to specify RowId on each row when updating a document will ensure that the correct row is always updated, regardless of the order in which they are set.

Changes to endpoints
https://apps.fortnox.se/apidocs#operation/update_ContractTemplatesResource
https://apps.fortnox.se/apidocs#operation/update_ContractsResource
https://apps.fortnox.se/apidocs#operation/update_InvoicesResource
https://apps.fortnox.se/apidocs#operation/update_OffersResource
https://apps.fortnox.se/apidocs#operation/update_OrdersResource

What
The possibility to specify RowId for each row in the update request for documents is added.
If RowId is set on one or more rows the corresponding rows with those ids on the current document will be updated. If a row is set without a RowId in this case it will be interpreted as a new row.
If a row should be left intact on the document but not updated you need to send the RowId in the array as { “RowId”: 123 } where 123 is the id of the row, otherwise it will be deleted.
Note: Every time a document is updated, new RowId will be generated and set on all rows

Why
Today, when updating rows on any document (offer, order, invoice, contract, contract template) the rows must be in the same order as on the current document. If a new row is added in the middle of the array the mapping to the current rows will be incorrect, resulting in some fields having the wrong value (i.e VAT).

Impact
The possibilty to use RowId is an added feature meaning it’s fully backwards compatible. You don’t have to change anything in your implementation if you don’t want, but using RowId is recommended in order to secure that the correct row is updated as it should.
This change will be rolled out to our customers over a period of time, starting in the beginning of September 2021.