Product XML feeds: connecting supplier files, your online store and marketplaces without manual work

A supplier XML file can weigh 100 MB, EANs are not unique and image links die. What we learned connecting supplier feeds, online stores and marketplaces into one flow.

6 min read

In this article
  1. The structure: sources → one internal model → exports
  2. Large files and a reliable key
  3. How often to sync
  4. Cleaning up supplier data
  5. When a product disappears or the file is empty
  6. Two sources for one product: which field wins
  7. What drives the price
  8. What to do tomorrow
  9. Frequently asked questions

With thousands of products and several suppliers, keeping a catalogue up to date by hand becomes a job in itself: download the file, compare prices, switch off sold-out items, fix the images, then repeat it all for the marketplaces. A program can do all of this — provided it knows about the traps, and supplier files hold more of them than you would expect. This article is about those traps: what we learned connecting supplier XML files to online stores and marketplaces.

The structure: sources → one internal model → exports

Most trouble starts when every supplier file is wired directly to every store or marketplace. Three suppliers and three destinations make nine connections, each failing in its own way. It is cleaner to work in three layers:

  1. Import. Each supplier's file is converted into a single product model of your own: name, price, stock, images, category, description.
  2. Rules. Category mapping, data cleaning and decisions about what to publish — all in one place.
  3. Exports. To your online store, Google Merchant Center and marketplaces. Each has its own format and required fields, but all are fed from the same internal model.

A new supplier is just a new import; a new marketplace is just a new export. The rest of the system stays the same.

Every run ends with a report: how many products are new, updated, disabled and skipped — with a reason for each skip. Without it, the import becomes a black box you only start checking once someone spots a mistake in the store.

Large files and a reliable key

File size. A supplier's XML file can weigh around 100 MB. Load the whole thing into memory and the server starts to choke — and the store with it, if it runs on the same server. Files like this are read as a stream: product by product, keeping only the one being processed in memory. It is also worth setting an upper limit on file size: a file that suddenly grows several times over is most likely an error, not a new product range.

The key. It is tempting to identify products by EAN, the barcode number. In practice the EAN is not unique: product variants (colours, sizes) often share the same EAN in a supplier's file. If the EAN is your key, variants overwrite each other and only one survives in the store. A more reliable key is the supplier's product ID — and with several suppliers, the supplier plus their product ID together.

How often to sync

"Every hour" sounds safe, but every run puts load on both your server and the supplier's system. Before deciding, compare several days' files with each other. The simplest way is to pull the product ID, price and stock from each file into a spreadsheet and count how many rows changed in each column. Our experience: most of the time only stock levels change, and everything else changes rarely. In that case, syncing once a night was enough.

The same principle applies to images: check only new and changed ones, not all of them every night.

Cleaning up supplier data

Images. Image links in the file are often dead — the server returns 404 or 410 — or have no domain at all, just 1.jpg. We check these links: a broken image is moved to the end or skipped, so a product page never opens with an empty frame.

Language. Supplier descriptions sometimes contain leftovers in another language — for example, Polish sentences in a Lithuanian text. We enrich such descriptions from another source or flag them for a person to review.

Categories. Supplier categories are "noisy": the same product can land in the wrong category, and the supplier's category tree does not necessarily match yours. So we map categories to our own tree using rules. Whatever the rules do not map is not published and shows up in the report, instead of being dumped into "Other". An "Other" category with a few hundred products is an error nobody notices until a customer cannot find a product.

When a product disappears or the file is empty

If a product is no longer in the supplier's file, switching it off seems logical. But not immediately: a product is treated as stale only once it has been missing from the file for a set number of hours. One broken or incomplete file must not switch off the entire catalogue. We disable products rather than delete them — if one comes back, it simply gets switched on again.

The extreme case is an empty file. It does not mean "everything is sold out": it is an error on the supplier's side or during the download. In that case the import stops, changes nothing and notifies a person. It is worth doing the same when a file is suddenly much smaller than yesterday's.

Two sources for one product: which field wins

Often one source is not enough: the supplier's file has an exact price and stock level but a thin description, while another source has a good description and a product link. The sources are joined on a key, such as the EAN. The crucial part is deciding in advance, and in writing, which field "wins" from which source:

Field Taken from
Price supplier file
Stock supplier file
Description second source if available; otherwise the supplier file
Product page link second source

Without a table like this, the two sources take turns overwriting each other and nobody knows where a wrong price came from. Remember the EAN caveat too: when joining on it, the same description may end up on several variants. That is fine for a description, but not for price and stock — which is why those come from the supplier file, matched by the supplier's product ID.

What drives the price

We do not publish a fixed price list. The price depends mostly on the number of suppliers and exports and on how complex the rules are; we give an exact figure once we have seen the files. We wrote about when an off-the-shelf tool is enough and when you need custom code in n8n vs Make vs custom code, and about the service itself on the automation page.

What to do tomorrow

  1. Download your supplier's file three days in a row and compare them — you will see what actually changes.
  2. Check whether the EAN in your file is unique: count how many products share the same code.
  3. Write a "field → source" table for every field you show in your store.

Frequently asked questions

Isn't a store plugin enough to import the supplier's file?

For simple cases, yes. Once you need rules — category mapping, image checks, protection against empty files, merging several sources — a plugin often runs out of road, and custom code takes over.

What happens if the supplier changes the file structure?

The import should notice and stop rather than write empty fields. Only that supplier's import needs fixing — the rules and exports stay the same.

Does the same system work for several suppliers?

Yes, that is the whole point of a single internal model: each supplier gets its own import, while rules and exports are shared.

More posts

All posts