Attachments are additional information linked to a transaction. Precoro supports several file formats for the attachments:

  • PDF files,
  • XLSX files,
  • DOCX files,
  • and pictures of various formats.

The GET method supports downloading the content of a single attachment or downloading attachments in a bulk. All you need to know is these Attachments' IDs.

Follow this sequence of requests to download the attachment you need:

    1. GET request for the list of the documents with their # (IDNs).

Apply filters you need in the Precoro interface to use later in your API request to get a filtered list of documents.

Example code: Get the Invoices list

Getting the list of the documents via API

    2. Extract all the # (IDNs) from the response.

    3. GET request for every document by its # (IDN).
Example code: Get Invoice by IDN

    4. Extract IDs of all attachments.

Getting Attachment's ID 

    5. GET request for the attachment by its ID.
Example code: Download document attachment by ID