I’ve been spending some time researching how inventory sync actually works across platforms like Shopify, Square, Etsy, and others.
At first it sounds pretty simple. Something sells on Shopify, reduce the quantity on Square. Done.
Except it’s not.
Say Shopify and Square both show 10 in stock. Someone buys one on Shopify at almost the same time someone buys one through Square. Both platforms now report 9, but you actually have 8.
Then there are delayed webhooks, duplicate events, retries, refunds, manual inventory changes, and updates arriving in a different order than they happened. Your own sync update can even trigger another webhook coming back.
I was looking at how Trunk handles this, and their approach makes a lot more sense now. They maintain their own inventory in the middle and reconcile timestamped changes from each platform. Basically, Trunk becomes the inventory master.
That was the interesting part of this research for me.
Connecting a bunch of APIs isn’t really the difficult part. Knowing what the inventory should actually be when several systems are changing it at the same time is.
Still digging into this. The deeper I go, the more edge cases I find.