EMDI connects to any e-shop (or your own backend) through simple HTTP calls. The response is text with fields separated by a semicolon (;), i.e. CSV. You do not need a JSON API or a specific programming language.

Any language that can open a URL and answer GET or POST is enough: C#, Java, Python, Node.js, Go, ASP / .NET, Ruby, PHP, even a static file. The ready-made SBZ bridges are PHP because OpenCart, WooCommerce, Magento and CS-Cart run on PHP. If you want to connect your own e-shop or service, implement the same links in the programming language you use.

The ready-made SBZ bridges are open source on GitHub: https://github.com/sbzsystems/emdi-eshop-bridges-connectors.

Open Settings → E-shop connection. Enable the connection, enter the site address and the key, then apply so the links are filled in. You can open each link with the button next to it for a test. In the browser you should see CSV, not an HTML error page.

In Sales, on a new document, press Insert. The window «Insert item lines from the internet» opens. Select an order on the left, press Import, and close the window. The document is filled automatically with customer, payment/shipping method, comment and lines. The e-shop is updated when you press Save, not when you close the orders window.

Call order when you open the window:
modifiedcustomers → (if rows arrived)
customersconfirmmodifiedproducts → (if rows arrived) productsconfirmorderlist.
Each time you select an order, selectedorder is called.
On save, confirmorder is called and then, for every item with the internet option, productavailability together with quantityvariable.

Sending an item from the warehouse is POST multipart. The response must be UTF-8. The first line is a header and is ignored. Do not change the field order. Leave an empty field between two ;. Do not put a semicolon inside a field value.

Endpoints

Method Name Example URL
GET orderlist https://www.domain.com/orders
GET selectedorder https://www.domain.com/order?id=
GET confirmorder https://www.domain.com/confirm?docid=#docid&shipcomp=#shipcomp&voucherno=#voucherno&orderid=
GET cancelorder https://www.domain.com/cancel?orderid=
GET modifiedcustomers https://www.domain.com/customers
GET customersconfirm https://www.domain.com/customersok
GET modifiedproducts https://www.domain.com/products
GET productsconfirm https://www.domain.com/productsok
GET productavailability https://www.domain.com/stock?productid=
QUERY quantityvariable &stock=
GET deletetmp https://www.domain.com/reset
POST senditem / uploadproduct https://www.domain.com/uploadproduct
GET redirect https://www.domain.com/redirect?customerid=#CID

Endpoints that change state in the e-shop (confirmorder, cancelorder, customersconfirm, productsconfirm, productavailability, deletetmp) are called by EMDI with GET (parameters in the URL).
Only uploadproduct is POST multipart.

In the ready-made PHP bridges the names look like ?key=…&action=orders. Another implementation may use paths such as /orders.

GETorderlist· order list · text/csv
https://www.domain.com/orders

Each line is one pending order. Preferably send only orders that are not completed yet.

The customer is matched by code in EMDI. The user field matches the EMDI user name. Shipping cost and discount become extra document lines. If COD cost is exactly 0.01, a COD line with value 0 is inserted. Status is stored in the field you set as «Status field in field». Payment and shipping methods must match the descriptions in EMDI settings. Document is the document-type title (e.g. SALES INVOICE).

In the VOUCHER field, in addition to the voucher number, there can also be the locker id after the separator |

VOUCHER|LOCKER ID

In the above example, order number 412 has voucher number 101755210 and locker id skroutz_demo (example for Skroutz Locker)

Also in the above example, order number 413 does not have a voucher number but has locker_id 11474 (example for Box Now Locker)

GETselectedorder· order lines · text/csv
https://www.domain.com/order?id=


The call works in 2 ways:

  1. If the link in settings ends with =, EMDI appends the order code and reads only that order.
  2. If it does not end with =, it reads the whole file and keeps the lines with the selected order code.

Line discount is a percentage.

GETconfirmorder· order completed
https://www.domain.com/confirm?docid=#docid&shipcomp=#shipcomp&voucherno=#voucherno&orderid=

Note: With this call EMDI changes data in the e-shop using a GET request with parameters in the URL.

Called when you save the document.
EMDI replaces #docid, #shipcomp, #voucherno and appends the e-shop order number (from Related, without the related prefix; default in settings ^).

Query Description
orderid E-shop order number
shipcomp Shipping method (title)
voucherno Voucher number
docid Document-type row ID in EMDI (Aa)

PHP example (same logic in any language):


The Receive button in the orders window also calls this link (without voucher and shipping method). The normal flow is saving the document.

GETcancelorder· cancel order
https://www.domain.com/cancel?orderid=

Note: With this call EMDI changes data in the e-shop using a GET request with parameters in the URL.

EMDI appends the order number to the link. The Cancel line button appears only when the link is filled in settings.

GETmodifiedcustomers· customer list · text/csv
https://www.domain.com/customers

EMDI updates by code or creates a new customer. With «Uppercase» selected in settings, the code becomes uppercase without special characters.


Country is an alpha-2 code (GR, CY, DE, …). In custom fields put Field_name:Value and separate several fields with the two characters \n. Spaces in the name become _. The last field is P.O. Box.

GETmodifiedproducts· item list · text/csv
https://www.domain.com/products

The item code must be the same in the e-shop and in EMDI.


Second code (MPN): CODE|CODE2. Extra price-list prices: 1,80|2:2,00|4:3,50 (up to 4 extra). «VAT included» controls whether prices include VAT.

Price lists in e-shop connection

Several categories are comma-separated; the first is the main one. Keep the category-order field (even empty) so weight/active stay aligned. In description 2: text without : goes to notes; lines Name:Value fill custom fields (separator \n).

GETproductavailability· stock to the e-shop
https://www.domain.com/stock?productid={id}&stock={qty}

Note: With this call EMDI changes data in the e-shop using a GET request with parameters in the URL.

After you save a purchase/sale that moves stock, for each item with the internet flag:


that is productavailability + code + quantityvariable + availability. Also save purchases in EMDI. If you do not want stock updates, leave these links empty.

GETdeletetmp· reset confirmations
https://www.domain.com/reset

Note: With this call EMDI changes data in the e-shop using a GET request with parameters in the URL.

With productsconfirm/customersconfirm the e-shop stores that EMDI received the data. The Delete confirmations button calls this link so those receipt confirmation dates are cleared.
Then the next modifiedproducts/modifiedcustomers call returns the full list.

POSTuploadproduct· send item data · multipart/form-data
https://www.domain.com/uploadproduct

«Create/edit product» (senditem) must be filled in. EMDI sends POST multipart/form-data.

In Warehouse, only for items with the internet flag:

  • Save the item — data and photos.
  • Menu Send selected products/services to e-shop — Yes to all = with photos, Yes = fields only.

If database sync has a separate «upload products», the automatic send on save is skipped. Photos are compressed (max side/quality from settings).

Field Description
productid Item code
productmpn Supplier code
title Description
descr Notes (line breaks → <br>)
price/sprice Sales/purchase price (with/without VAT per «VAT included»)
tax VAT rate
cat/cattitle Category (Aa and title)
subcat/subcattitle Subcategory (Aa and title)
weight Weight
field_Name Custom fields (spaces → _)
cprice_Name Price-list prices, e.g. cprice_Retail
file, file2, … JPEG photos

The menu Update availabilities in e-shop in the warehouse calls only productavailability, not uploadproduct.

GETredirect· custom button to the e-shop
https://www.domain.com/redirect?customerid=#CID

Settings can show an extra button on customers, warehouse and sales. EMDI opens the link after replacing:

  • customer: customerid=#CID
  • item: productid=#SID
  • document: orderid=#DID

Note

Keep the same codes on both sides. If nothing downloads, open the link in the browser: you should see plain CSV with the header on the first line.