Version 2.0.6
New feature: your Supplier Documents in the API
The documents you receive from your suppliers (purchase invoices, credit notes, ...) are now available in the API.
GET /supplier-documents: paginated list of your supplier documents, with sorting, free text search and filters on reference, supplier, type, status, issue date, due date and amounts. Requires thereadscope.GET /supplier-documents/{id}: a single supplier document. Requires thereadscope.GET /supplier-documents/{id}/pdf: the PDF of a supplier document, encoded in base64, in the same format asGET /documents/{id}/pdf. Requires thereadscope.GET /supplier-documents/{id}/events: the status history of a supplier document, most recent first. Requires thereadscope.POST /supplier-documents/upload-asset: upload the PDF of a supplier document and get the temporary key to create it with. Requires thewritescope.POST /supplier-documents: create a supplier document from an uploaded PDF. Requires thewritescope.PATCH /supplier-documents/{id}/status: approve, refuse or dispute a supplier document, or declare a payment sent to the supplier. Requires thewritescope.
Note: a supplier document whose PDF is not available yet (for example while an uploaded image is still being converted) returns a 404 on the /pdf endpoint. Status changes follow the very same rules as in the INFast app: a transition that is not allowed on the document returns a 400.
Note: creating a supplier document is a two-step import: upload the PDF first, then create the document with the returned assetKey as its fileKey. Only PDFs are accepted, the supplierId must be one of your suppliers, and the created document is a manualImport in the approved status, in euros.
New feature: Supplier Document webhooks
Three webhook events notify you of the changes on your supplier documents, whatever their origin — INFast App, a manual import, or a document received through the e-invoicing network.
supplier-document.createdandsupplier-document.updated: the payload is the supplier document, in the same shape asGET /supplier-documents/{id}.supplier-document.status-change: the payload carries the updated supplier document and the status it had before, as{ "supplierDocument": { ... }, "previousStatus": { ... } }. The new status is not repeated: it is already insupplierDocument.status.
supplier-document.updated is also triggered when the tags of a supplier document change, and is not triggered when only internal fields are modified.
Note: there is no supplier-document.deleted event — the deletion of a supplier document is not exposed in webhooks.
New feature: your Suppliers in the API
The companies you buy from are now available in the API.
GET /suppliers: paginated list of your suppliers, with sorting, free text search and filters on legal name, legal identifier and tags. Requires thereadscope.POST /suppliers: create a supplier. Requires thewritescope.GET /suppliers/{id}: a single supplier. Requires thereadscope.PATCH /suppliers/{id}: update a supplier. Requires thewritescope.DELETE /suppliers/{id}: delete a supplier. Requires thewritescope.
Note: the legalIdentifier identifies a supplier inside your portal. It must be unique among your suppliers — a duplicate returns a 409 — and cannot be changed after creation. A supplier that still has supplier documents attached to it cannot be deleted and returns a 409.
New feature: Supplier webhooks
Three webhook events notify you of the changes on your suppliers, whatever their origin — the API, INFast App, or a supplier created automatically from a document you received.
supplier.createdandsupplier.updated: the payload is the supplier, in the same shape asGET /suppliers/{id}.supplier.deleted: the payload only carries the id of the deleted supplier, as{ "supplierId": "..." }.
supplier.updated is also triggered when the tags of a supplier change, and is not triggered when only internal fields are modified.