How to import a supplier FTP or XML feed into Shopify
Some suppliers publish stock on an FTP or SFTP server, or as an XML or JSON feed. What to ask them for, how to map the fields, and how to sync it on a schedule.
Larger distributors often don't email spreadsheets. They put a stock file on an FTP or SFTP server, or publish an XML or JSON feed at a web address, refreshed on their own schedule. Shopify can't read these directly, so you need something in between that fetches the file, understands it and updates your variants.
What to ask the supplier for
- How to connect: FTP or SFTP, the server name, port, username and password, or the web address of the feed and any login it needs.
- The exact file path, for example /export/stock.xml. A name that stays the same each day is much easier to automate than one with the date in it.
- When the file is updated, so you can sync shortly after.
- Which field holds the SKU or barcode, and whether it matches the codes on your products.
- Which field is the quantity, and whether it's free stock or includes items already reserved.
- Whether prices are trade prices or retail, and in which currency.
If the supplier offers both FTP and SFTP, choose SFTP: plain FTP sends the password unencrypted. If they only offer FTPS (FTP over TLS), ask whether SFTP or an HTTPS link is available instead.
How XML and JSON map to columns
An XML or JSON feed is a list of items, each with named fields. To map it, you pick which field is the identifier and which is the quantity, just like columns in a spreadsheet. A typical XML feed looks like this:
<products>
<product sku="TSHIRT-BLK-M">
<ean>5012345678900</ean>
<stock>
<available>24</available>
</stock>
<price>8.50</price>
</product>
</products>Here each product element is one row. Feedguard detects the repeating element for you and turns its contents into columns: attributes appear with an @ in front (@sku), and nested elements are joined with a dot, such as stock.available. For JSON it finds the list of items, or you can name the path, such as data.items.
Scheduling
Sync after the supplier's update, not before. If their file is refreshed at 5:00, a daily sync at 6:00 picks up the new numbers. If it changes through the day, choose hourly or every 15 minutes, depending on your plan.
Doing it with Feedguard
- Add a feed and choose FTP, SFTP or web address. Enter the server details and file path. Passwords are stored encrypted.
- Click Read file to see the detected columns and a sample of rows.
- Pick SKU or barcode matching, the quantity column, and any price, compare-at or cost columns, plus the location to update.
- If the feed has trade prices, set your markup and rounding, for example ×1.4 rounded to .99.
- Review the first sync's preview, then set the schedule.
If the server can't be reached or the file comes back empty or much shorter than usual, the sync stops and your store keeps its current stock. Feedguard updates existing products only; supplier items that aren't in your store are listed as unmatched rather than created.