WhatsApp

Integrating WooCommerce with Subiekt GT: five things that only show up in practice

A car parts shop, 1,800 products, 40 orders a day and invoices issued by hand. The integration was meant to take eight days and took eleven. Here are the five surprises: a one-grosz difference, a race for the last unit, statuses, an address changed after ordering and an emoji in the order notes.

Cover: WooCommerce and Subiekt, 5 things that only show up in practice

An online shop selling oils, filters and consumable parts: 1,800 products on WooCommerce, around 40 orders a day, stock and invoicing in Subiekt GT. Before the integration it worked like this: every morning Ewa printed the orders from the shop and issued invoices for them in Subiekt, one after another. Forty invoices is about two hours. She updated stock levels in the shop once a day from an export, so for the rest of the day the shop was sometimes selling things that were already gone.

The plan was eight days. It took eleven, and those three days are the subject of this post, because every shop-to-ERP integration I've done has had its own versions of the same five problems.

WHAT FLOWS WHICH WAYWooCommerceshop, cart, paymentsPrzelewy24, couriersSubiekt GTstock, invoices, pricesvia the Sfera add-onIntegratorn8n + Sfera script, every 2 minorders + paymentstock levelsprices, new itemsstatus, invoice numberFour streams, each on its own schedule: orders and stock every 2 minutes, prices once an hour,invoices right after a status change.
Four data streams, each going its own way on its own schedule.

How it's wired up

Subiekt GT has no API of its own; you need the Sfera add-on from InsERT, which lets a script talk to the program. On the shop side there's the standard WooCommerce REST API. In between sits n8n with a few scripts on the client's server. Every two minutes it pulls new orders into Subiekt and pushes stock levels to the shop, once an hour it syncs prices and new products, and on a status change it issues the invoice and sends its number back to the order in the shop.

Sounds simple. For the first four days it was simple.

Surprise 1: one grosz

Day five, the first invoices from the automation. The accountant rings: invoice for PLN 123.46, transfer for PLN 123.45, order marked "unpaid" in Subiekt. A one-grosz difference (a grosz is a hundredth of a złoty) in 7% of orders.

SURPRISE NO. 1: ONE GROSZWooCommerce (customer paid)3 × oil filter 41.15 gross123.45VAT on the total23.08Total grossPLN 123.45what the cart computed and what was paidSubiekt (invoice from net)3 × 33.46 net100.38VAT 23% per line23.09Total grossPLN 123.46one grosz over the payment: invoice “unpaid”Fix: the integrator passes gross prices line by line and forces Subiekt to calculate “from gross”, the same way the shop does.
The same basket calculated by the shop and by Subiekt. The grosz comes from VAT rounding.

WooCommerce calculates prices from gross and rounds the total. Subiekt by default calculates from net, line by line, and rounds each line separately. With three units at 41.15 the result differs. The solution is to pass gross prices to Subiekt with "calculate from gross" set on the document, exactly the way the shop does it. One field in Sfera and half a day of finding out why.

Surprise 2: the last unit sold twice

Day six. Two customers bought the same filter two seconds apart, and there was one unit in stock. The shop accepted both orders, because the last stock sync had been two minutes earlier. Both paid.

SURPRISE NO. 2: THE LAST UNIT SOLD TWICE10:00:01Order #5121: the last PF-20 filter in stockshop shows “1 in stock”, accepts10:00:03Order #5122: the same filtershop still shows “1 in stock”, last sync was at 9:5810:02:00Stock sync: Subiekt → shopstock 1 − 2 = −1. Two customers paid, there is one item.fixReservation in Subiekt right after the orderplus stock for 60 “hot” products every 30 s instead of 2 min
Two seconds apart, two paid orders, one filter.

You can't get a full guarantee here without rebuilding the shop, but you can get the risk down to almost zero. An order creates a reservation in Subiekt the moment it's placed, and for the 60 best-selling products stock goes to the shop every 30 seconds instead of every two minutes. In the two months since that change there hasn't been a double sale. There was one case where the item turned out to be damaged on the shelf, but no integration will catch that.

Surprise 3: statuses

The shop has five order statuses; Subiekt has documents: ZK (a customer order), FS (a sales invoice), WZ (a goods issue note), corrections. We agreed the mapping on day four and it seemed obvious.

STATUS MAP (AGREED ON DAY 4, CHANGED ON DAY 9)Pending paymentZK (customer order)ProcessingZK + stock reservationCompletedFS (invoice) + WZ, number sent back to shopRefundedFS correction, goods back in stockCancelledZK cancelled, reservation releasedDay 9 change: a customer who changed the address after ordering got a WZ with the old address.Now the address goes to Subiekt only at the “Completed” status.
The status map. Obvious right up until a customer changes their address.

On day nine a customer placed an order and an hour later changed the delivery address through their account in the shop. The order was already in Subiekt with the first address, so the WZ and the courier label went to the old one. The parcel came back. Now the address goes to Subiekt only when the status changes to "Completed", that is, when someone is actually packing, and the integrator checks whether the address in the shop has changed since the ZK was created.

Surprise 4: an emoji in the notes

The "order notes" field. A customer wrote "please leave it with the neighbour 🙏". Sfera accepted it, Subiekt saved it, and when printing the WZ an error popped up, because that version can't handle such characters. Three orders sat in the queue before anyone noticed. Now the integrator strips the notes of characters outside the Polish alphabet, and the original stays in the shop. A small thing, but exactly the kind of thing that's in no documentation and only shows up on real orders.

Surprise 5: returns

A return in the shop is the "Refunded" status; in Subiekt it's an invoice correction plus receiving the goods back into stock. For the first two weeks Ewa did the corrections by hand, because we wanted to see what real returns look like first: partial, with an exchange, "return, but the customer wants a different oil". The automation now handles full returns. Partial ones still get a draft correction to click through, and that's deliberate, because there are six a month and each one is different.

After two months

AFTER TWO MONTHS0invoices issued by handwas: about 40 a day30 sstock delaywas: once a day, morning11 daysto deliverplan: 85surprises along the wayall of them in this post
The numbers after two months. Eleven days instead of eight.

Efekt: Zero invoices issued by hand (it was around 40 a day). Shop stock lags by 30 seconds for the hot products and two minutes for the rest. Ewa now writes the product descriptions the shop had been missing for two years. I can't honestly count the sales, because the shop started running ads at the same time, but returns due to "it wasn't in stock" dropped from a dozen or so a month to zero.

Before you order an integration

Check whether you have Sfera (or Subiekt nexo, which has an API as standard). See how the shop calculates VAT and set the same in Subiekt. Plan two or three days for surprises, because there will be some. I've had them every time, and this was my sixth integration of this kind.

Got a similar process? Let's talk, I will work out how much of it the robots can take.

Tomasz Stachowiak

I automate boring work in companies: I connect systems, add AI and build tools that give people their hours back. I write about what really works for clients.

30 processes you can automate in a week

Free PDF: concrete processes from six areas of a company, with the time to build and the effect.

Send me the PDF

Got a process that drives you mad?

Write two sentences about what eats the most time. I will reply with what can be automated and where to start.

Let's talk

New posts by email, once a week

One email with what I wrote this week. No "special offers", with an unsubscribe link in every message.