Skip to main content

Version 2.0.6

· 4 min read

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 the read scope.
  • GET /supplier-documents/{id}: a single supplier document. Requires the read scope.
  • GET /supplier-documents/{id}/pdf: the PDF of a supplier document, encoded in base64, in the same format as GET /documents/{id}/pdf. Requires the read scope.
  • GET /supplier-documents/{id}/events: the status history of a supplier document, most recent first. Requires the read scope.
  • POST /supplier-documents/upload-asset: upload the PDF of a supplier document and get the temporary key to create it with. Requires the write scope.
  • POST /supplier-documents: create a supplier document from an uploaded PDF. Requires the write scope.
  • PATCH /supplier-documents/{id}/status: approve, refuse or dispute a supplier document, or declare a payment sent to the supplier. Requires the write scope.

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.created and supplier-document.updated: the payload is the supplier document, in the same shape as GET /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 in supplierDocument.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 the read scope.
  • POST /suppliers: create a supplier. Requires the write scope.
  • GET /suppliers/{id}: a single supplier. Requires the read scope.
  • PATCH /suppliers/{id}: update a supplier. Requires the write scope.
  • DELETE /suppliers/{id}: delete a supplier. Requires the write scope.

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.created and supplier.updated: the payload is the supplier, in the same shape as GET /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.