EMDI connects to any e-shop (or your own backend) with plain HTTP calls. The response is text separated by semicolons (;), i.e. CSV. You do not need a JSON API or a specific 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 in PHP because OpenCart, WooCommerce, Magento and CS-Cart run on PHP. To connect your own e-shop or service, implement the same links in the 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 from the button next to it to test. In the browser you should see CSV, not an HTML error page.

In Sales, on a new document, press Insert. The window “Import 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)
customersconfirm → modifiedproducts → (if rows arrived) productsconfirm → orderlist.
Each time you select an order, selectedorder is called.
On save, confirmorder is called, then for each item marked for internet, productavailability together with quantityvariable.

Sending an item from inventory is POST multipart. The response must be UTF-8. The first line is a header and is ignored. Field order must not change. Leave an empty field between two ;. Do not put a semicolon inside a field value.
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 links like /orders.

orderlist — order list · text/csv

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 maps to the EMDI username. Shipping cost and discount become extra lines on the document. If COD cost is exactly 0.01, a COD line is inserted with value 0. Status is stored in the field you set as “Status 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 you can send only the voucher number, or the number and a PDF URL when the label was already created by another service (not by EMDI):


On import of a single order, if | is present, EMDI downloads the PDF into the company files vouchers folder as courierCode_number.pdf (the courier code comes from the shipping method). Only the number (the part before |) is stored on the document.

Example: 101755210|https://www.domain.com/labels/101755210.pdf

Without |, the field is a plain voucher number and no file is downloaded.

selectedorder — order lines · text/csv

The call works in 2 ways:

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

Line discount is a percentage.

confirmorder — order completed

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

It is 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 is ^).

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 Complete button in the orders window also calls this link (without voucher and shipping method). The normal flow is saving the document.

cancelorder — cancel order

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

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

modifiedcustomers — customer list · text/csv

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 use Field_Name:Value and separate multiple fields with the two characters n. Spaces in the name become _. The last field is the P.O. Box.

modifiedproducts — item list · text/csv

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

Second code (MPN): ΚΩΔΙΚΟΣ|ΚΩΔΙΚΟΣ2. Extra price-list values: 1,80|2:2,00|4:3,50 (up to 4 extra). “With VAT” controls whether prices include VAT.

Price lists in the e-shop connection

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

productavailability — stock to the e-shop

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

After saving a purchase/sale with stock movement, for each item marked for internet:

i.e. productavailability + code + quantityvariable + stock. Also post purchases in EMDI. If you do not want stock updates, leave these links empty.

deletetmp — reset confirmations

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

With productsconfirm/customersconfirm the e-shop stores that EMDI received them. The Reset button calls this link to clear the receive-confirmation dates.
Then the next modifiedproducts/modifiedcustomers call returns the full list.

uploadproduct — send item data · multipart/form-data

“Create/change item” (senditem) must be filled in. EMDI sends POST multipart/form-data.

In Inventory, only for items marked for internet:

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

If database sync has a separate “upload products”, auto-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 “With VAT”)
tax VAT percent
cat/cattitle Category (Aa and title)
subcat/subcattitle Subcategory (Aa and title)
weight Weight
field_Name Custom fields (spaces → _)
cprice_Name Price-list values, e.g. cprice_Retail
file, file2, … JPEG photos

The Update stock in e-shop menu in inventory calls only productavailability, not uploadproduct.

redirect — custom button to the e-shop

From settings an extra button can appear in customers, inventory and sales. EMDI opens the link replacing:

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

Note

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

Try it in the interactive docs

Open the interactive documentation (Swagger) in a new tab.

  1. Click Authorize and enter the key.
  2. Change the Server to your e-shop domain if needed.
  3. Pick an operation → Try it out → Execute.
  4. For a normal test without CORS: open each link from EMDI settings.