What this call does

Downloads every file attached to one business document, an order, delivery note or invoice, as a single ZIP archive.

Last updated: 15.05.2026

The address saved in this entry does not work. It is saved as POST /api/gateways/integration/documents/{documentId}/download. The address that answers is GET /api/documents/{businessDocumentId}/attachments/download, a GET, and it takes no companyAccountId.

What you need first

  • A valid API key in the API-Key header.
  • The businessDocumentId, the id field from Search business documents.
  • A client that can save a binary answer as a file.

Parameters

Parameter

Required

Default

Meaning

businessDocumentId

Yes

none

In the path, between /documents/ and /attachments/download. The CATHAGO ID of the document.

There are no query parameters.

The fields

This call has no data packet. Do not send one.

What you get back

200 OK, content type application/zip, with the header Content-Disposition: attachment; filename="documents-{businessDocumentId}.zip".

One entry per attachment, named after its fileName; a file with no name is stored as file, and a repeated name gets (1), (2) … before the extension. An ORDER in status IN_APPROVAL carries one extra file, an order preview named Vorschau Bestellung {externalId}.pdf. A document with no attachments returns 200 and a valid, empty archive.

A 200 does not promise that every attachment is in the archive. A file that cannot be fetched is skipped in silence.

Common mistakes

What you see

Why

What to do

404 Not Found

The saved POST …/download address was used, or the document does not exist

Use the GET address above, with an ID from Search business documents.

405 Method Not Allowed

Called with POST

It is a GET.

401 Unauthorized

Key missing or wrong

A staging key does not work in production.

The file will not open

The answer was saved as text

It is a ZIP archive. Save the bytes as they arrive.

A file you expected is missing

It could not be fetched, so it was skipped

Read attachedFiles from Search business documents and fetch that file's url directly.

Adresse

HTTP
POST https://api.cathago.de/api/gateways/integration/documents/:documentId/download?companyAccountId=<companyAccountId>

Beispielaufruf

Terminal
curl -X POST 'https://api.cathago.de/api/gateways/integration/documents/:documentId/download?companyAccountId=<companyAccountId>' \
  -H 'API-Key: <Ihr API-Schlüssel>'

Beispielantworten

OK

Status: 200 OK