This format allows you to send events to ActivePOS on behalf of the POS terminal. The messages in this format can be sent both via TCP and UDP.
As can be seen from its name, this protocol is based on XML. Each event that happens on at point-of-sale terminal is represented by a transaction block:
<?xml version="1.0" encoding="utf-8"?> <transaction> <event_type>POSNG_RECEIPT_OPEN</event_type> <operation_id>E44D0F4A</operation_id> <cashier>Ivanov I</cashier> <date>11/01/2017</date> <time>16:40:08</time> <location>cas_1</location> </transaction> <?xml version="1.0" encoding="utf-8"?> <transaction> <event_type>POSNG_POSITION_ADD</event_type> <operation_id>E44D0F4A</operation_id> <cashier>Ivanov I</cashier> <date>11/01/2017</date> <time>16:40:10</time> <position>1</position> <weight>1.234</weight> <barcode>1149990037</barcode> <text>Rollton LBE chicken Caesar 65g (Mareven Food Central): 24</text> <price>185.4</price> <location>cas_1</location> </transaction> <?xml version="1.0" encoding="utf-8"?> <transaction> <event_type>POSNG_POSITION_ADD</event_type> <operation_id>E44D0F4A</operation_id> <cashier>Ivanov I</cashier> <date>11/01/2017</date> <time>16:40:15</time> <position>2</position> <quantity>2</quantity> <price_per_unit>51.99</price_per_unit> <barcode>0760557822035</barcode> <text>Buttermilk milk ster.1,5% 0,95l t / brik (Unimilk): 1.12</text> <price>103.98</price> <location>cas_1</location> </transaction> <?xml version="1.0" encoding="utf-8"?> <transaction> <event_type>POSNG_POSITION_ADD</event_type> <operation_id>E44D0F4A</operation_id> <cashier>Ivanov I</cashier> <date>11/01/2017</date> <time>16:40:15</time> <position>3</position> <volume>10.723</volume> <barcode>12843745092347</barcode> <text>Benzin AI95</text> <price>76.45</price> <location>cas_1</location> </transaction> <?xml version="1.0" encoding="utf-8"?> <transaction> <event_type>POSNG_RECEIPT_CLOSE</event_type> <operation_id>E44D0F4A</operation_id> <cashier>Ivanov I</cashier> <price>313.84</price> <date>11/01/2017</date> <time>16:40:20</time> <location>cas_1</location> </transaction>
Each unit of transactions has:
- Mandatory set of transferred data:
- event_type - the event type;
- operation_id - unique identifier (sequential number of document) all operations by which are combined into single receipt;
- cashier - user name;
- date - the operation's completion date (MM/dd/yyyy);
- time - the operation's completion time (hh:mm:ss).
- Set of parameters describing the operation:
- position - number of item in receipt;
- quantity - parameter containing quantitative characteristic of operation expressed in whole number;
- weight - parameter containing fractional quantitative characteristic of operation;
- volume - a parameter containing a fractional quantitative characteristic of the volume of the goods;
- price - parameter containing information of the price or cost of operation being conducted;
- price_per_unit - price per unit of goods;
- barcode - item bar code;
- article - item number;
- location - parameter connecting operation being conducted with video channel (see section Configuring POS terminals);
- text - parameter is intended for the transfer of text data concerning operation (for example, item name, error code, etc.).
List of events and parameters describing given event can differ depending on videosurveillance object:
Tip
The list of event types is continuously added to. You can get an up-to-date list by contacting DSSL technical support.
A frequently-used option is to have a script send messages to 127.0.0.1 using UDP. The port number must match the terminal created in the ActivePOS settings dialog.
t = "<?xml version= ... <transaction> ... </transaction>" import socket try: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(("127.0.0.1", port)) s.send(t) s.close() except socket.error, msg: error("can't forward to port %i: %s" % (port, msg)) s.close()