Incremental Sync
This section shows how to implement a strategy to download only the new received Peppol documents from My Azur API and the the list of sent document that changed their statuses.
It is important to adopt an efficient strategy for downloading Peppol documents from My Azur API. In this chapter, we will see how to maintain a client-side timestamp of the last sync performed and how to request from My Azur API the list of documents following that timestamp.
We start by requesting the list of all received documents (First sync, no previous requests).

We'll get the list of documents in JSON format as following:
We get a list of objects and the created_at timestamp. We should save this timestamp as last synced at timestamp. To request the new received documents we'll send the saved timestamp as query arg in the next request as following:

The same strategy can be used to fetch the list of sent documents that changed their statuses. Initially when you submit a document it gets a status_id = 1 (Submitted). You are supposed to periodically check for status change by sending the request illustrated above with the query arg incoming = false. You'll get all the documents that you previously sent that changed status.
Last updated