pixi

Orders - Data Communication

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.

  • Order import URL call – pixi* calls a shops PHP or CGI script with a valid session ID, to get only not exported orders.

  • The shop system confirms the valid session ID and returns one XML file for every call, which contains only one order, which is 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 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


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.

Back to top

Order Export URL Call

The order export URL call is used, to get an XML file, which contains an order from the shop system. Only one order can be exported per call.


Order Export URL Call Examples

http://www.madshop.de/index.php?fnc=OSCExportOrder&session_id=$$$session$$$

or

http://www.madshop.de/opentrans_pixi.cgi?action=export_order&session=$$$session$$$


Variables in the XML File

  • 'session_id represents the session ID, which is returned after the authorization.

You can find an example of a returned XML file here.


Back to top

URL Call to confirm a successful Export

If pixi* was able to import and process the order, pixi* returns a confirmation using a URL call. Like this, the shop system can mark the order as exported. In case an error occurs on importing the XML file, the shop owner will be automatically notified via e-mail. Nevertheless, the order will be marked as exported, in order to prevent a loop.


Example URLs for Confirming the Order Export

http://www.madshop.de/pixishopconnection/index.php/pixi/export/confirm/$$$session$$$/pix_order/pix_orderc/
$$$order_id$$$


Variables in the XML File

  • session_id represents the session ID, which is returned after the authorization.

  • dateexport represents the order export date in UNIX format.

  • orders_id represents the order number, which is included in the XML file.


XML Response

<ANSWER>
<ORDER_ID>$$$orders_id$$$</ORDER_ID>
<STATUS>$$$status$$$</STATUS>
<sessionID>$$$session_id$$$</sessionID>
<DESCRIPTION>$$$description$$$</DESCRIPTION>
</ANSWER>";


Variables in the XML Response

  • session_id represents the session ID, which is returned after the authorization.

  • status returns SUCCESS or FAILURE.

  • orders_id represents either the external order id or the external order number that was contained in the XML.

  • description contains an appropriate message.


Back to top

URL Call for Order Status Changes

pixi* returns status changes per orderline due to partial and additional deliveries, undeliverable items, etc. The export contains the orderline price, quantity, status and shipping vendor tracking code. In case the export is answered and confirmed by the shop, the status change will be marked as exported in pixi*.


Example URL Calls

http://www.madshop.de/index.php?fnc=OSCSendOrderChange&session_id=$$$session_id$$$&data=$$$data$$$

or

http://www.madshop.de/pixi.cgi?action=import_order_status&data=$$$data$$$&session=$$$session$$$


Possible Variables

  • session_id represents the session ID, which is returned after the authorization.

  • data contains the data transmitted in XML format


Example XML, which is transmitted to the Shop

<ORDER_ITEM>
<LINE_ITEM_ID>12871287329_2</LINE_ITEM_ID>
<QUANTITY>1</QUANTITY>
<FULL_PRICE>121.6800</FULL_PRICE>
<DISCOUNT_PERC>5.00</DISCOUNT_PERC>
<DISCOUNT_VALUE>6.0800</DISCOUNT_VALUE>
<PRICE_AMOUNT>115.6000</PRICE_AMOUNT>
  <ITEM_NOTE>Item note</ITEM_NOTE>
<STATUS>AUS</STATUS>
  <TRACKINGID>41201245456478</TRACKINGID>
<ORDER_NR_EXT>238474842</ORDER_NR_EXT>
  <INVOICE_NR>DEM0000021</INVOICE_NR>
<SHIPPING_VENDOR>DHL</SHIPPING_VENDOR>
</ORDER_ITEM>

The '<STATUS>' tag can contain these values:

  • HAL -> The orderline is on hold, since the payment was not received yet.

  • ANG -> The orderline is released - the payment has been received and is being processed.

  • EIN -> The orderline is currently being shipped.

  • AUS -> The orderline has been shipped.

  • RET -> The orderline has been returned by the customer.

  • STO -> The orderline has been canceled by the customer.

  • NLB -> The item is undeliverable.

  • MIN -> The item has been replaced with another item.


In case the status change has been received, the shop should respond like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<ANSWER>
<code>OK</code>
<message></message>
</ANSWER>


In case the status change was not transmitted successfully, this should be the response:

<?xml version="1.0" encoding="ISO-8859-1"?>
<ANSWER>
<code>FAILURE</code>
<message></message>
</ANSWER>


Back to top

General Hints regarding URL Calls

  • pixi* URL calls for the item (BMECat) and order (OPENtrans) import happen every 10 to 180 seconds (depending on the current server workload).

  • URL calls for stock and order status exports are directly triggered after the corresponding action in pixi*, e.g. stock increase or decrease or order status change, etc.



Back to top