We can integrate your supplier feeds into your Ordoro account (additional fees may be involved). But if you want to build your custom supplier feed integration, here is our recommended recipe.
How to build your custom supplier feed
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) res.raise_for_status()
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.
What to do if your supplier SKU is different
If the Ordoro internal SKU is different from the SKU 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, you can retrieve the supplier_sku value for each SKU using this API endpoint https://api.ordoro.com/product/sku/supplier/supplier_id/.
Optimization tips
If you are running this feed integration regularly (hourly or daily), only some of the skus in your account may have changed their stock level. If so, you could retrieve the stock levels of every SKU in Ordoro using the Ordoro API, compare it with that same SKU in the supplier feed, and decide whether the stock level has changed. 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 and some additional internal optimization techniques to make 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 our Developer Forums.