Pohoda Node icon

Pohoda Node

Stormware Pohoda Integration Node

Příjemky → Create Entity

AI-generated

Overview

This node integrates with the Stormware Pohoda accounting system, enabling users to perform various operations such as exporting data, creating entities, retrieving company info, and printing reports. Specifically, for the "Příjemky" (Receipts) resource with the "Create Entity" operation, the node allows creating new address book entries in Pohoda by sending structured XML requests.

Common scenarios include automating the creation of new contacts or suppliers in Pohoda based on external triggers or workflows, such as adding a new supplier when a purchase order is received. This helps maintain synchronized records between n8n workflows and Pohoda's database without manual entry.

Example: Automatically create a new supplier contact in Pohoda when a form is submitted on a website, using the "Create Entity" operation with the "Příjemky" resource.

Properties

Name Meaning
XML Output If enabled (true), the node returns the raw XML response from Pohoda instead of parsed JSON.
UTF8 Conversion If enabled (true), converts the response encoding from Windows-1250 to UTF-8 for proper character display.

Note: For the "Create Entity" operation on the "Příjemky" resource, the node expects an input collection named createEntity containing fields relevant to the entity being created (e.g., company name, address, contact details). However, in this bundled code, creation is implemented only for the address book resource, so "Příjemky" creation may not be supported directly.

Output

The node outputs an array of items corresponding to each input item processed:

  • When XML Output is enabled, the output contains a JSON object with a data field holding the raw XML string returned by Pohoda.
  • Otherwise, the XML response is parsed into a JSON object representing the Pohoda response structure.
  • In case of print operations, the node can output binary PDF data with metadata such as filename and MIME type.
  • For create operations, the output reflects the success or failure state of the request.

The output JSON structure typically includes status information (@state), notes, and detailed response data from Pohoda.

Dependencies

  • Requires an API authentication credential with Pohoda (username, password, base URL).
  • Uses HTTP POST requests with XML payloads to communicate with Pohoda's API endpoints.
  • Depends on external libraries:
    • iconv-lite for character encoding conversion.
    • xmlbuilder2 for XML parsing.
    • Custom utility module ./utils/xmlGenerator for generating XML requests.

Troubleshooting

  • Common issues:

    • Authentication failures due to incorrect or missing API credentials.
    • Encoding problems if UTF8 conversion is disabled but the response contains special characters.
    • Unsupported resource or operation errors if attempting to create entities for resources other than the address book.
    • Network or connectivity issues when reaching the Pohoda API endpoint.
  • Error messages:

    • Errors with messages from Pohoda's response note field indicate issues reported by the API (e.g., invalid data, permission denied).
    • NodeApiError thrown when the response state is not "ok".
  • Resolutions:

    • Verify API credentials and permissions.
    • Enable UTF8 conversion if you see garbled characters.
    • Confirm that the resource-operation combination is supported.
    • Check network connectivity and endpoint URLs.

Links and References

Discussion