This is how communication works between pixi* and the shop system:
pixi* calls a shops PHP or CGI script using username and password to get a session ID.
After a successful authorization, the shop system should send a XML file with a session ID as a respond.
Catalogue import URL call - pixi* calls a shops PHP or CGI script with a valid session ID, to get only not exported items.
The shop system confirms the valid session ID and responds with an XML file, which contains maximum 250 items (because of a possible PHP buffer overflow), that are not marked as exported, yet.
As soon as the shop system returns the XML file, it is downloaded, stored locally on the pixi* servers and immediately processed. In case syntax or content errors are detected on parsing the XML file, the imported XML file will be dropped and a message (barcode is not unique, barcode replaced, basic errors, etc.) is sent to a predefined e-mail address.
All pixi* calls are dynamically created. The called scripts do not underlie any restrictions regarding syntax and function.
Read more: BMEcat Syntax Specification for the item import via XML format, openTRANS Syntax Specification for the order import via XML format
Authorization URL Call
Before any function call like item/order import or status export, pixi* requests a so called session ID, which is only valid for a specific time frame (depending on the setting in the shop system). In case username and password are correct, the shop system should return the session ID in a XML file.
Http Authorization URL Call Examples
http://www.myshop.de/pixi.cgi?action=session_start&user=pixi_interface&pass=thisisasecret
or
http://www.madshop.de/index.php?fnc=OSCAuthorization&usr=pixi_interface&pwd=thisisasecret
Hint: Single URLs are completely dynamic. They can be predefined induvidually per pixi* database. But: Only one set of URL calls can be predefined per pixi* database. In case you want to connect more than one shop to pixi*, all shops need to use the same kind of URLs.
Variables
Username (in this case: „pixi_interface“)
Password (in this case: „thisisasecret“)
Returned XML Example
<?xml version="1.0" encoding="ISO-8859-1"?>
<ANSWER>
<STATUS>SUCCESS</STATUS>
<sessionID>1155558302.83</sessionID>
<DESCRIPTION></DESCRIPTION>
</ANSWER>Variables in the XML File
STATUS returns „SUCCESS“ or „FAILURE“.
sessionID represents the valid session ID.
DESCRIPTION - In the case of an error, it contains the error message.
Catalogue Update URL Call
The catalogue update call is used, to export all new or changed items after the last call to pixi*. pixi* uses the UNIX time format, to index the last catalogue update call. Also in the shop system a field is needed, which contains the time stamp of the last catalogue export in UNIX format.
This value is compared to the last imported XML file on the next catalogue update call. After every catalogue update call and the successful import of the XML file to pixi*, a confirmation is immediately sent to the shop system. The confirmation contains the time stamp of the last XML file, which is then updated in the shop database. This process ensures, that on every catalogue update call only those items are exported to pixi* which are new or were changed after the last update call.
URL Catalogue Update Call Examples
http://www.myshop.de/pixi.cgi?action=export_update&session=1155558302.83
or
http://www.myshop.de/index.php?fnc=OSCExportCatalog&session_id=1155558302.83&onlynew=n
Variables
session_id (in this case: „1155558302.83“) represents the session ID, which is returned after the authorization.
onlynew (in this case: „n“) If the value equals „y“, only new items after the last catalogue update are considered. If the value equals „n“, new and changed items are considered.
Example URLs for Confirming the Catalogue Import
http://www.myshop.de/index.php?fnc=OSCConfirmCatalog&session_id=1155542302.97&date=1192710892
or
http://www.myshop.de/pixi.cgi?action=reset_export_status&date=1192710892&session=1155542302.97
Variables
session_id (in this case: „1155542302.97“) represents the session ID, which is returned after the authorization.
date (in this case: „1192710892“) represents the time stamp of the last catalogue update.
Full Catalogue Import URL Call
This call is used, to trigger the export of the whole stock list. It should trigger a function in the shop system, to set the time stamp to „0“. This causes a full item import on the next catalogue update call.
Example URL for a full Catalogue Item Import
http://www.madshop.de/index.php?fnc=OSCConfirmCatalog&session_id=2568542387.21&date=0000000000
Variables
session_id (in this case: „2568542387.21“) represents the session ID, which is returned after the authorization.
Returned XML Example
<?xml version="1.0" encoding="ISO-8859-1"?>
<ANSWER>
<EXPORT_DATE>1970-01-01 01:00:00</EXPORT_DATE>
<STATUS>SUCCESS</STATUS>
<sessionID>1155558691.76</sessionID>
<DESCRIPTION>Date was updated successfully</DESCRIPTION>
</ANSWER>Variables in the XML File
STATUS returns „SUCCESS“ or „FAILURE“.
sessionID represents the valid session ID.
DESCRIPTION - In the case of an error, it contains the error message.
EXPORT_DATE returns the UNIX date, which is transmitted in the URL function.
URL Call to export the available Stock
The stock, which is managed in pixi*, can be transmitted to the shop system up-to-the-minute. For this, pixi* calls a script in your shop system using a URL, which can process the values (in XML format), that are included in this URL.
Example URLs for Stock Export
http://www.madshop.de/index.php?fnc=OSCImportStock&session_id='5687245686.01&data=$$$data$$$'
or
http://www.madshop.de/pixi.cgi?action=import_stock&data=$$$data$$$&session=5687245686.01
Variables
session_id (in this case: „5687245686.01“) represents the session ID, which is returned after the authorization.
data (in this case: „$$$data$$$“) contains information regarding stock, delivery days, etc.
XML Example, which is returned to the Shop as Parameter
<?xml version="1.0" encoding="ISO-8859-1"?>
<ARTICLE_ITEM>
<ARTICLE_ITEM_ID>18201-180160-bl</ARTICLE_ITEM_ID>
<QUANTITY>12</QUANTITY>
<DELIVERY_DATE>2006-10-18T00:00:00</DELIVERY_DATE>
<MIN_STOCK_QTY>0</MIN_STOCK_QTY>
<ACTIVE>True</ACTIVE>
<EAN>4000053269821</EAN>
<OPENSUPPLORDERS>12</OPENSUPPLORDERS>
</ARTICLE_ITEM> Variables
ARTICLE_ITEM_ID (in this case: „18201-180160-bl“) equals the SUPPLIER_AID and establishes a connection to the item in the shop system.
QUANTITY (in this case: „12“) represents the currently available stock
DELIVERY_DATE (in this case: 2006-10-18T00:00:00) represents the manufacturers/suppliers delivery date. The last delivery date is transmitted. This way it can be assured, that former orders are already shipped and items are available to this specific delivery date.
MIN_STOCK_QTY represents the current items reorder level, which is set in pixi*.
EAN represents the current EAN, which is set in pixi*.
OPENSUPPLORDERS represents the quantity, which is currently ordered at the manufacturer/supplier.
ACTIVE represents, if the item is active in pixi*. It can be used to show the item in the shop or not. If ACTIVE is TRUE, the item should be shown. This also applies, when it is FALSE but additionally has stock > 0.
In order to export the status to the shop, the shop interface might need to be modified.
Example of a Shop Systems XML Respond
<?xml version="1.0" encoding="ISO-8859-1"?>
<ANSWER>
<code>OK</code>
<message></message>
</ANSWER> OR
<?xml version="1.0" encoding="ISO-8859-1"?>
<ANSWER>
<code>ERROR</code>
<message>ErrorMessage</message>
</ANSWER> Variables
CODE (in this case: „OK“) returns „OK“ or „ERROR“.
MESSAGE contains the message..
Hints (optional possibilities, usages)
Using the stock quantity, you can show the items status in your shop system precisely: e.g. if stock > 0, show "Item is on stock"; if stock = 0, show "Delivery time: X days" or "Item currently not available" depending on the item.
Using the returned delivery date, you can show the items next possible availability in your shop.
The EAN field always contains the EAN, which is currently set in pixi*. Users can directly change an items EAN in pixi*. So they have the possibility, to synchronize an items current EAN also in the shop system.
If the Code is "ERROR", the Message needs to contain a text.
Batch Export for several Items per URL Call
Using a setting in pixi* Control Center , aso more than 1 item can be transmitted in one call.
XML Example, which is returned to the Shop as Parameter (on active batch export)
<?xml version="1.0" encoding="ISO-8859-1"?>
<ARTICLES><ARTICLE_ITEM>
<ARTICLE_ITEM_ID>18201-180160-bl</ARTICLE_ITEM_ID>
<QUANTITY>12</QUANTITY>
<DELIVERY_DATE>2006-10-18T00:00:00</DELIVERY_DATE>
<MIN_STOCK_QTY>0</MIN_STOCK_QTY>
<ACTIVE>True</ACTIVE>
<EAN>4000053269821</EAN>
<OPENSUPPLORDERS>12</OPENSUPPLORDERS>
</ARTICLE_ITEM> <ARTICLE_ITEM>
<ARTICLE_ITEM_ID>18201-180160-b2</ARTICLE_ITEM_ID>
<QUANTITY>0</QUANTITY>
<MIN_STOCK_QTY>0</MIN_STOCK_QTY>
<ACTIVE>True</ACTIVE>
<EAN>4000053269821</EAN>
</ARTICLE_ITEM> </ARTICLES>