EMDI can be connected to any e-shop or external database by downloading plain text separated by semicolons (csv).
Note that the following procedure is not always necessary because there are ready-made bridges in php language for e-shop of several companies. You can download the ready-made e-shop bridges here.
Bridge for e-shop connection
The files needed to be produced by your e-shop are: (indicatively)
orderlist: http://www.domain.com/neworders.asp
selectedorder: http://www.domain.com/neworder.asp?id=
confirmorder: http://www.domain.com/orderok.asp?docid=#docid&shipcomp=#shipcomp&voucherno=#voucherno&orderid=
cancelorder: http://www.domain.com/cancelorder.asp?orderid=
modifiedcustomers: http://www.domain.com/newclients.asp
customersconfirm: http://www.domain.com/allclientsok.asp
modifiedproducts: http://www.domain.com/newproducts.asp
productsconfirm: http://www.domain.com/allproductsok.asp
productavailability: http://www.domain.com/changequantity.asp?id=
quantityvariable: &quantity=
resetdates
uploadproduct
uploadcustomer
redirect
orderlist
The link produces a csv list containing the orders. Each line is an order.
File Format products order (the order of the fields must not be changed. The first line is ignored.):
1 |
ORDER ID;CUSTOMER ID;SHIPPING COST;PAYMENT COST;DISCOUNT;DATE;NOTE;USER;VOUCHER;STATUS;SHIPPING CUSTOMER ID;PAYMENT METHOD;SHIPPING METHOD;DOCUMENT;CUSTOM FIELD 1;CUSTOM FIELD 1;<br>\n |
example:
1 2 3 4 |
ORDER ID;CUSTOMER ID;SHIPPING COST;PAYMENT COST;DISCOUNT;DATE;NOTE;USER;VOUCHER;STATUS;SHIPPING CUSTOMER ID;PAYMENT METHOD;SHIPPING METHOD;DOCUMENT;CUSTOM FIELD 1;CUSTOM FIELD 1;<br>\n 405; C209; 0; 0; 0; 01/12/2011 21:40:20;<br>\n 407; C215; 0; 0; 0; 02/12/2011 23:18:35;<br>\n 416; C209; 0; 0; 0; 06/12/2011 20:50:32;<br>\n |
If the “CUSTOMER ID” is not associated with the EMDI customer list then the association is based on the VAT ID contained in the “NOTE” field. Also based on the “USER” field, EMDI automatically sets the user.
Also, if “PAYMENT COST” is 0.01 then the payment cost line in EMDI is normally entered at zero price.
In the new Status field you specify which will be saved in the settings->E-shop connection->Status field in field.
confirmorder
#shipcomp Shipping method
#voucherno Tracking number
#docid Document line ID. The document line number is sent by EMDI. So on any connector we can get the value:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
if ($action == 'confirmorder') { $orderid = $_REQUEST['orderid']; $voucherno = $_REQUEST['voucherno']; $shipcomp = $_REQUEST['shipcomp']; $docid = $_REQUEST['docid']; ... if ($docid == 123) { ... } else { ... } ... } |
cancelorder
Informs the e-shop that the order canceled. Thus, only the outstanding ones appear in the EMDI order list. EMDI sends the order number.
selectedorder
File format orders (the order of the fields must not be changed. The first line is ignored.):
1 |
PRODUCT ID;DESCRIPTION 1;DESCRIPTION 2;DESCRIPTION 3;QUANTITY;MEASUREMENT UNIT;PRICE;TAX;DISCOUNT;START DATE;END DATE;POSITION;ORDER ID;<br>\n |
example:
1 2 3 4 |
PRODUCT ID;DESCRIPTION 1;DESCRIPTION 2;DESCRIPTION 3;QUANTITY;MEASUREMENT UNIT;PRICE;TAX;DISCOUNT;START DATE;END DATE;POSITION;ORDER ID;<br>\n 6314;CUP;WHITE;12,5hx19,5d;1;PIECES;9,50;19;0;<br>\n 6307;CUP;BLUE;LARGE;1;PIECES;15,00;19;0;<br>\n 6231;ORANGE;ORANGE;15hx15d;2;PIECES;8,00;19;0;<br>\n |
modifiedcustomers
Customer file format (the order of the fields must not be changed. The first line is ignored.):
1 |
CUSTOMER ID;FIRST NAME;LAST NAME;ADDRESS;ZIP;COUNTRY;CITY/STATE;AREA;PHONE;MOBILE;EMAIL;VAT;TAX OFFICE;COMPANY;OCCUPATION;LANGUAGE;PO BOX;<br>\n |
example:
1 2 3 |
CUSTOMER ID;FIRST NAME;LAST NAME;ADDRESS;ZIP;COUNTRY;CITY/STATE;AREA;PHONE;MOBILE;EMAIL;VAT;TAX OFFICE;COMPANY;OCCUPATION;LANGUAGE;PO BOX;<br>\n C62; SOLON; ZENETZIS; Plapouta 10; 16777; GR; ATTICA; GREEK; 2109648161; 6944777777; host@sound.gr; 045313872; ARGYROUPOLIS; SOLON ZENETZIS; SOFTWARE SERVICES; GR;<br>\n C77; COSTAS; PAPADOPOULOS; PARASKEVOPOULOU 38; 16777; GR; ATTICA; ARGYROUPOLI; 2109648161; 6944777777; sound@sound.gr; 045313872; GLYFADA; Kostas Papadopoulos; TRADE; GR;<br>\n |
In order to be submited, the country must follow the official alpha-2 coding.
modifiedproducts
File Format products (the order of the fields must not be changed. The first line is ignored.):
1 |
PRODUCT ID;DESCRIPTION1;DESCRIPTION2;TAX;PRICE;PURCHASE PRICE;AVAILABILITY;MEASUREMENT UNIT;CATEGORY;PHOTO;URL;CATEGORY ORDER;WEIGHT;ACTIVE;<br>\n |
example:
1 2 3 4 5 |
PRODUCT ID;DESCRIPTION1;DESCRIPTION2;TAX;PRICE;PURCHASE PRICE;AVAILABILITY;MEASUREMENT UNIT;CATEGORY;PHOTO;URL;CATEGORY ORDER;WEIGHT;ACTIVE;<br>\n P1;round pork pie;;23.00;1.80;;;Piece;Skewers with pie;<br>\n P2;chicken pita round;;23.00;2.00;;;Piece;Skewers with pie;<br>\n P3;straw pork pie;;23.00;1.80;;;Piece;Skewers with pie;<br>\n P4;skewer chicken pie;;23.00;2.00;;;Piece;Skewers with pie;<br>\n |
In “PRICE” you can include up to 4 pricelist prices:
|Pricelist Line ID 1:Price 1|Pricelist Line ID 2:Price 2|Pricelist Line ID 3:Price 3|Pricelist Line ID 4 :Price 4
So, in case that you want to include 1 additional price, the above example is modeled as follows:
1 2 3 4 5 |
PRODUCT ID;DESCRIPTION1;DESCRIPTION2;TAX;PRICE;PURCHASE PRICE;AVAILABILITY;MEASUREMENT UNIT;CATEGORY;PHOTO;URL;;WEIGHT;<br>\n P1;round pork pie;;23.00;1,80|2:2,00;;;Piece;Skewers with pie;<br>\n P2;chicken pita round;;23.00;2,00|2:1,20;;;Piece;Skewers with pie;<br>\n P3;straw pork pie;;23.00;1,80|4:3,50;;;Piece;Skewers with pie;<br>\n P4;skewer chicken pie;;23.00;2,00|2:2,00;;;Piece;Skewers with pie;<br>\n |
Clicking on EMDI purchases/sales INS button opens the window with the orders.
Opening this window the links “modifiedcustomers”, “modifiedproducts” automatically inserts the list of customers and products. If there are changes, “customersconfirm” and “productsconfirm” called accordingly, to inform the e-shop that the data imported.
E-shop should be always sending new customers and products and not the whole list. However in all cases only the differences are imported.
After the above “orderlist” link is called and brings the list of pending orders.
Every time you select an order in the left side the link “selectedorder” called in order to show the products of the selected order.
Then once you select the order and close the window, automatically inserted to the document all the products included and “pulled” from the e-shop.
When you click “Save” on EMDI then only the link that updates “confirmorder” e-shop that the order was billed. Then called the link “productavailability” in combination with variable “quantityvariable” sends e-shop availability.
To meet the availability needs to register the purchase invoices to EMDI, otherwise ignore the link.
Caution: The client code in EMDI must only contain numbers and uppercase characters.
Variables in the file bridge.ini: (for information)
vatincluded = If the price includes VAT 1 else 0
grabtype = How to use the file name. 0: kodikos.txt, 1: * 2 _kodikos.txt: kodikos_ *. Txt 3: kodikos.txt where code, the corresponding client code.
For auto = automatically download orders otherwise 1 0
dirtype = 0 From the list of file 1. From file uses the following variables
orderlist = Link gives orders
selectedorder = Link that gives selected order. At the end of the line the script needs to call number order.
confirmorder = Order Confirmation. At the end of the line the script needs to call number order.
modifiedcustomers = List new customers
customersconfirm = Confirm new customers joined the basis of EMDI
modifiedproducts = List new products
productsconfirm = Confirmation that the new products came on the basis of EMDI
Send productavailability = stock. At the end of the line the script should invite product code and then *
quantityvariable = * by this variable, quantity