Karol Leszczyński Build & Develop PL

Online stores updated 15 August 2026

Syncing Allegro with your own store: one stock level across two sales channels

How I built two-way stock synchronization between an electric-motor store and Allegro, what broke along the way, and what an integration like this costs in a custom store.

Karol Leszczyński · Toruń, Poland

Diagram of data flow between a custom store and Allegro

Silniki-elektryczne.com.pl sells the same goods in two places: its own store and Allegro, Poland’s largest marketplace. The catalog runs past 2,300 items, but physically only a few units of any given motor sit in the warehouse. As long as there were two or three orders a day, the owner corrected the stock in the other channel by hand after every sale. When orders picked up, the inevitable happened. Someone bought the last unit on Allegro; three minutes later someone else bought the same unit in the store. A refund, an apology, and a customer who won’t come back.

Off-the-shelf tools for this exist. Baselinker charges a subscription and matches products by its own rules, and WooCommerce plugins didn’t apply at all, because the store runs on its own custom backend. So I built the synchronization from scratch, for this specific catalog. It has been running since 2021, and this post is about it: what it does, what broke, and what something like this costs if you want one of your own.

What exactly gets synchronized

The integration consists of five parts that together close the loop between the store and Allegro.

PartWhat it doesHow often
Authorizationholds the Allegro access token and refreshes it on its own before it expiresevery 12 h, 5 minutes before the deadline
Store → Allegroafter every order, cancellation or stock change in the admin panel, pushes the new stock level to Allegroimmediately
Allegro → storepulls sale events from Allegro and lowers the stock in the storeevery 3 minutes
Listing publicationcreates a new Allegro listing from the store panel, with the motor’s parameters (power, RPM, manufacturer, weight)on click
Mapping panelshows which product is which listing, where the stock levels have drifted apart, and allows manual linkingcontinuously

Prices flow in one direction only, from the store to Allegro. A promotion set on Allegro doesn’t change the store price, because the price list is managed in one place.

Three things that had to break before it all worked

The access token expires every 12 hours. The first version of the sync stalled at three in the morning because the token expired between one check and the next. Now, before every request to Allegro, the program checks whether the token will survive the next five minutes; if not, it refreshes and stores a new one. If the refresh fails (say, someone revoked the permissions in the Allegro panel), the rest of the store keeps working and the owner sees a notice in the panel.

Allegro goes down sometimes. The service returns a “temporarily unavailable” error more often than you’d expect. Without retries, the sync would lose a few events a week. So every request is retried up to three times, with a growing backoff (one second, two, four).

Zero stock requires ending the listing. When stock hits zero, writing “0” isn’t enough — Allegro only stops displaying an offer with zero availability after the listing is ended. When stock comes back above zero (after a cancelled order), the listing has to be resumed first, then you wait a second and a half for Allegro to process it, and only then set the stock. Half a second worked four times out of five. A second and a half works every time. None of this is in the documentation; it emerges after a few days of watching.

Product matching: same motor, two names

The store and Allegro describe the same item differently. In the store: “electric motor 11kW 2950rpm 3-phase INDUKTA”. On Allegro: “electric motor 11kW 2950rpm INDUKTA MS”. The first import from Allegro matched 60% of the listings; the rest hung as “unlinked”, even though the same motors sat in the warehouse.

The fix is normalizing names before comparison: lowercase everything, drop the word “3-phase” (redundant information for these motors), strip series codes from the end of the name, swap commas for dots in power ratings. After that cleanup, the two names come out identical. A dozen or so percent of products still need manual linking in the panel, because Allegro caps names at 75 characters and sellers abbreviate them each in their own way.

Publishing listings from the store panel

The owner adds a new product in the store panel, ticks “also list on Allegro”, and the listing creates itself, with the parameters translated into Allegro’s dictionary. That dictionary is a world of its own: power, RPM, voltage and weight have their own identifiers that depend on the category, and the manufacturer list runs past 30,000 entries. The delivery price list is picked by weight, because a 3 kg motor ships under a different Allegro Smart tariff than a 90 kg one.

If Allegro rejects a listing (a missing parameter, a name too long), the product is withdrawn from the store as well, and the owner sees a message with the reason. That way the store never shows goods that never made it to Allegro, and the error gets fixed right away.

What one order looks like

A customer buys an 11 kW motor in the store and pays by BLIK. The store reserves the unit, sends email confirmations, and in the same moment pushes the new stock level to Allegro. If it was the last unit, the Allegro listing is ended. In parallel, the store’s two satellite sites (silnik-elektryczny.pl and silniki-trojfazowe.pl) rebuild to show current availability. If someone bought the same motor on Allegro at the same time, the store finds out within three minutes and lowers its own stock. That three-minute window is the only place where overselling is theoretically possible; with a few orders a day on niche goods, it hasn’t happened once since 2021.

What it costs and when it makes sense

The whole integration is a few thousand lines of code plus a separate panel. It makes sense when you sell in your own store and on Allegro at the same time, and your products have parameters customers search by (power, dimensions, series). For a simple product range on a WooCommerce store, Baselinker will be cheaper.

In a custom-built online store I quote Allegro synchronization as a separate module, after a conversation about your catalog. The store itself starts at 4 999 zł net; the calculator on the service page shows what moves the price. If you run a store where stock drifts apart between channels, describe how you sell, and I’ll tell you how long an integration like this would take and what it would cost.

More from the blog

Other things I've built.

Contact

Have a product that should reach further than your own website?

I handle the whole thing end to end: application, infrastructure, store and directory releases, maintenance. I usually reply the same day — ideally to something concrete, even if it's one paragraph and the question “can this be done cheaper?”.