Pohoda Node icon

Pohoda Node

Stormware Pohoda Integration Node

Pokladní doklady → Print

AI-generated

Overview

This node integrates with the Pohoda accounting system, specifically supporting operations such as exporting data, creating entities, retrieving company info, and printing reports or documents. The "Print" operation for the "Pokladní doklady" (Cash Register Documents) resource allows users to generate and print specific reports based on a record ID and report ID, saving the output as a file (typically PDF). This is useful in scenarios where automated generation and printing of financial or transactional documents from Pohoda are needed, such as printing cash register receipts or summaries directly from workflow automation.

Example use cases:

  • Automatically printing a cash register document after a sale transaction.
  • Generating PDF reports of specific financial records for archiving or auditing.
  • Exporting and printing customized reports defined in Pohoda by their report IDs.

Properties

Name Meaning
ID záznamu Item Row ID — the identifier of the specific record/document to print.
ID sestavy Report ID — identifier of the report template to use for printing; found in report properties.
Název/cesta k souboru File name/path — destination path and filename where the printed file will be saved (e.g., "n8n.pdf").
XML Output Boolean flag indicating whether to return raw XML output instead of parsed data.
UTF8 Conversion Boolean flag to convert encoding from Windows-1250 to UTF-8 for proper character representation.
Delete File After Print Boolean flag indicating whether to delete the generated file after printing.

Output

The node outputs JSON data and optionally binary data depending on the operation and settings:

  • For the "Print" operation:

    • If XML Output is enabled, the node returns the raw XML response as a string in the json.data field.
    • Otherwise, if the print response contains attachments (such as a PDF), it outputs the print details in json and the PDF file as binary data under binary.data. The binary data includes:
      • data: Base64-encoded PDF content.
      • mimeType: "application/pdf".
      • fileExtension: "pdf".
      • fileName: The original filename from the response.
    • If no attachment is present, it outputs the parsed print details as JSON.
  • For other operations (export, create, company-info), the output varies but generally includes parsed JSON objects representing requested data or confirmation responses.

Dependencies

  • Requires an API authentication credential with username and password for Pohoda's API.
  • Uses HTTP requests to Pohoda's XML API endpoints.
  • Depends on external libraries bundled with the node:
    • iconv-lite for character encoding conversion.
    • xmlbuilder2 for XML parsing and building.
  • Requires proper configuration of the Pohoda API base URL and credentials in n8n.

Troubleshooting

  • Common issues:

    • Authentication failures due to incorrect or missing API credentials.
    • Invalid report ID or record ID causing errors in generating the print request.
    • Encoding issues if UTF8 conversion is disabled but the response contains Windows-1250 encoded characters.
    • File write permission errors when saving the output file.
  • Error messages:

    • Errors returned from Pohoda API are surfaced with messages from the response's @note attribute.
    • Node may throw NodeApiError if the API response state is not "ok".
    • If the operation/resource combination is not implemented, an error indicating "Not implemented for [resource]" is thrown.
  • Resolutions:

    • Verify API credentials and permissions.
    • Confirm that the report ID and record ID exist and are correct.
    • Enable UTF8 conversion if you see garbled characters.
    • Ensure the file path specified in fileName is writable by n8n.

Links and References

Discussion