We can integrate your supplier feeds into your Ordoro account (additional fees may be involved). But if you would like to build your own custom supplier feed integration, here is our recommended recipe.

1. Connect to your supplier’s feed location and fetch the latest stock levels. Here is a sample python code snippet to fetch an FTP file from your supplier’s server

from ftplib import FTP
def get_ftp_file(self, hostname, username, password, remotefilename, localfilename):
    ftp = FTP(hostname, username, password)
    ftp.retrbinary("RETR " + remotefilename ,open(localfilename, 'wb').write)

2. Post the latest inventory changes into your Ordoro account using the Ordoro API

import requests
def update_ordoro_on_hand(self, user, password, sku, location_id, on_hand):
    auth = (user, password)
    url = 'https://api.ordoro.com/product/{}/warehouse/{}/'.format(sku, location_id)
    payload = {
        'on_hand' : on_hand
    res = requests.put(url, headers=headers, json=payload, auth=auth)

That’s basically it at the high level. That’s all it takes to build the simplest FTP supplier feed integration. Here are some more details to consider as you build this integration.

If the Ordoro internal sku is different from the sku that the supplier uses for that product, then you need to use the supplier_sku_mapping field in Ordoro to match up these skus. Once the supplier_sku is filled out, then you can retrieve the supplier_sku value for each sku using this api end point `https://api.ordoro.com/product/sku/supplier/supplier_id/`.

Optimization tricks – If you are running this feed integration on a regular basis (hourly or daily), only some of the skus in your account may have changed their stock level. If so, then you could retrieve the stock levels of every sku in Ordoro using the Ordoro API, and then compare it with the stock level of that same sku in the supplier feed, and decide whether the stock level has changed at all. If the stock level has not changed, then no need to update that in Ordoro.

Our internal feed integration already accounts for supplier_sku_mapping. Since we run this feed integration on our servers, we use the optimization mentioned above, as well as some additional internal optimization techniques to makes these feeds run faster. But you can build a basic supplier feed integration using the recipe above.

If you have additional questions, please email us at info@ordoro.com or post in http://forums.ordoro.com/.

Leave a Reply

Your email address will not be published. Required fields are marked *