API guidesDocuments and attachments

Documents and attachments

Loading of documents, details, history of changes and attachments, export status, loading and uploading of unprocessed documents.

Use these operations when transferring documents from Doklado to your own system.

All operations on this page use method POST, JSON body and header api_key. Access settings can be found in the Authentication. Click on an endpoint to open its inputs and responses in the REST API reference.

Loading documents

EndpointUsage
POST /v2/documentsLoading the list of documents by organization and filters.
POST /v2/documents/getLoading the detail of one document according to its identifier.
POST /v2/documents/changesLoading the history of changes of selected documents.

You can also use the data.identificationNumber filter according to company identification number (IČO) counterparty for the list. Model InvoiceV2 also includes deliveryNoteNumber with delivery note number. Please read the next pages according to page guide.

Export processing and confirmation

EndpointUsage
POST /v2/documentsLoading documents intended for transfer, for example with a filter isExported: false.
POST /v2/documents/setExportedSetting the export status for successfully processed documents.

setExported changes state in Doklado. Your integration ensures that the documents are saved in the target accounting system. Confirm the export only after successful processing and check the result for each document. You can find examples in the manual How to work correctly with API.

Download attachments

EndpointUsage
POST /v2/documents/attachments/getObtaining public links to download document attachments.

The operation returns references to existing attachments. It is not used to upload or attach a new attachment. Although the input uses an identifier field, Swagger currently lists support for only one document per request.

Unprocessed documents

EndpointUsage
POST /v1/unprocessed-documentsLoading documents from the Unprocessed section according to the specified period.

Loading unprocessed documents remains at v1. Optional data.limit sets the number of results per page in the range 1–50. For 0, only the numbers totalDocuments and notApprovedDocuments are returned, without documents. If you do not specify a limit, the server's default page size is used. For other pages, use searchAfter according to page instructions.

Uploading an unprocessed document

EndpointUsage
POST /v3/unprocessed-documents/uploadUpload a single file as Base64 to the Unprocessed documents section.

Send a JSON object data with the following fields:

FieldTypeMeaning
organizationIdstringcompany identification number (IČO) of the organization you are uploading the file to
fileNamestringOriginal file name including extension
fileBase64stringFile contents encoded as Base64

One request uploads one file. Swagger states a maximum size of 10 MB and saves to temporary storage. When preparing the request, also take into account the increase in size with Base64 encoding.

Supported extensions are doc, docx, xls, xlsx, csv, odt, ods, txt, xml, zip, pdf, png, jpeg, jpg and heic. The name is modified before saving and the MIME type is determined by the file name. Use a suffix that matches its content.

Accounting settings of the uploaded document

Optional data.accountingSettings assigns settings after processing the document. Supports numericCodeId, cashRegisterId, projectId, orderId, activityId, expenditureCenterId, accountingItemId, classificationVatId, accountingSoftwareAgendaId and debitAccountingAccountId.

The value can be an internal ID, value, code, or name of the relevant organization setting. If any value cannot be matched, the API rejects the entire request with APP_INCORRECT_INPUT_DATA and does not save the file. Details are in the guide to accounting settings.

Example of uploading a PDF

Replace BASE64_FILE_CONTENT with the Base64 encoded content of document.pdf. Also add your own company identification number (IČO) and API key:

curl --request POST --fail-with-body --silent --show-error \
  'https://api-gateway-prod-europe-west-1-7epuecvu.ew.gateway.dev/v3/unprocessed-documents/upload' \
  --header 'api_key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --data-raw '{
  "data": {
    "organizationId": "12345678",
    "fileName": "document.pdf",
    "fileBase64": "BASE64_FILE_CONTENT"
  }
}'

A successful response contains data.organizationFileId, the identifier of the created organization file record. Save it together with the result of the call. The answer extends the model ApiResponseSimple. Also check the HTTP status of success and code in the JSON body.

HTTPMeaning according to Swagger
200Successful call
400Incorrect input data
403Missing authorization
404The requested resource was not found
409The file already exists
500Server error

The current specification does not guarantee recording idempotency. After the timeout, first verify the resulting status before sending the file again.

Attachments issued eInvoice

Process the attachments to the issued invoice by upload URL → file upload → attach attachment. These are separate operations invoice-attachments/upload-url, invoice-attachments/add and invoice-attachments/get. When reading documents, models DocumentV2 and InvoiceV2 may also contain accountingSoftwareInternalId and deliveryId. The second identifier serves to check delivery via invoice-send-status.

More information

Consider paging and errors and API consumption when integrating. For a full list of operations, see endpoint overview.