It can be a hassle to manually upload your supplier’s inventory files into Ordoro. If you’d like to automate this process, many suppliers offer File Transfer Protoco (FTP) servers to help route new inventory files to third party systems like Ordoro. Here’s how our team would recommend getting that information and sending it to Ordoro.

How to build your custom supplier feed

1. Connect to your supplier’s feed location and fetch the latest stock levels. Here is a example python code snippet to fetch an FTP file from your supplier’s server. Keep in mind, not every server is the same, and you may need to customize this to retrieve the files you need. Ordoro support cannot help in customizing this request for you.

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. If you’re having issues with this request, our support team is happy to help. The Client ID and Secret are the API keys created in Ordoro. The location_id is the warehouse ID associated with the warehouse you’d like to update. See Ordoro’s API docs here for more information.

import requests
def update_ordoro_on_hand(self, Client ID, Client Secret, sku, location_id, on_hand):
auth = (Client ID, Client Secret)
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’s product SKU is different from the SKU the supplier uses for that product, then you need build this integration to retrieve the corresponding SKU from Ordoro using the Supplier SKU offered from the FTP server.

You can search Ordoro’s products catalog for the Supplier SKU (filtered by the Supplier) to return the associating Ordoro SKU. Then you can use that Ordoro SKU to update inventory for your product in Ordoro.


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. Ordoro has to sync every product that has an inventory change, and large inventory updates can slow your syncs. Instead, retrieve the stock levels of every SKU in Ordoro using the Ordoro API, and compare it with that same SKU in the supplier feed. If the stock level has not changed, then no need to update that in Ordoro.