PDA Files

Minimal approach integration using text files

Introduction

Integration via PDA files is an alternative to integration via the HTTP WEB API interface. Compared to HTTP WEB API integration, it is faster to implement but limited in its possibilities.

When is it appropriate to choose integration via PDA files instead of integration via HTTP WEB API?

The connection between your external application (eshop, etc.) and the PORTOS system should be handled via PDA files if all below apply:

  • the connection is only related to the creation or printing of the receipt and there is no need to transfer other data.

  • the external application does not need to obtain any additional information from the system (e.g. list of goods, change stock balances, etc.).

  • an external application can create a text file directly on the computer running PORTOS.

If all the mentioned points meet your needs, integration via PDA files may be the solution for you. On the contrary, if you need a more complex exchange of information between your application and the PORTOS system, integration via the HTTP WEB API interface will be the right choice, as it provides comprehensive options and has no limitations.

How the integration works

The integration is based on one-way (from external application to PORTOS) exchange of files (with .PDA extension) in specified directory (usually C:/POS). PORTOS will observe this directory and process file content of all files with matching extension with goal to create or print receipt.

File requirements

  • File extension: must be *.pda or *.PDA.

  • Name: unique name, generated by external application. We recommend to use timestamp or ID related to transaction.

  • File content: formatted as stated in this documentation.

Error handling

Once file is processed successfuly (and receipt is printed), file is deleted by PORTOS.

When any error occurs during file processing, file is moved to "unprocessed files directory" (usually C:/POS/FAILED, can be configured). You can retry file processing moving file from this directory back to input directory.

Error logs are available in API working directory (usually C:/ProgramData/NineDigit/PORTOS/API/Logs).

When contacting technical support, please attach the log file as well.

File content

File content consists of various types of lines. Type of line is specified by first character of each line.

Ticket item line

Each receipt item is represented by separate line containing 77+ characters and has following format:

Optional footer text that will be printed at the end of receipt. For multiline footers, use multiple lines with D character as prefix.

Fiscal name line

Optional name of fiscal printer, on which receipt will be printed. If not specified, value configured in PORTOS will be used.

Ticket location

Optional name of table and zone, separated by @ character.

E.g.: Table named B01 in Bar zone.

LB01@Bar

File example

  • First line: Contains ticket item referencing product with code 1 (product with given code must exist in PORTOS). When no product with code 1 is defined in PORTOS, PDA file processing would fail. Quantity is set to one, price to 3.50 and discount rate to 33.33%. Payment type is set to 1, VAT category as well to 1.

  • Second line: contains “anonymous product” – product that is not created in PORTOS. To indicate “anonymous product” Product code (PLU) must be set to zero, product name must be specified. Quantity is set to one, price to 3.50 and discount rate to 33.33%. Payment type is set to 1, VAT category to 1, unit to 'x'. Product name is "Product name goes here".

  • Third and fourth line: Optional multiline footer printed at the end of the receipt.

  • Fifth line: Optional name of fiscal printer (for example “eKasa”) on which receipt printing should be performed. Fiscal printers are defined in PORTOS.

A999Receipt name            1   100    350        03333                    011
A999Receipt name            0   100    350        03333                    011  xProduct name goes here
DThis is receipt footer.
DThis is another line for receipt footer
LB01@Bar
FeKasa

Versioning

This API uses semantic versioning. Given a version number MAJOR.MINOR, increment the:

  • MAJOR version: incompatible API changes are introduced.

  • MINOR version: functionality is added in a backward compatible manner.

Changelog

Version 1.1 (2023-07-10)

  • Added:

    • Ticket location support added. PORTOS API v4.0.46 required.

Version 1.0 (2023-01-12)

  • Added:

    • Documentation for V1 processor supported in PORTOS API v4.0.31.

Last updated