E-commerce

Commerce Automation and System Integrations

Checkout is the easy half. The expensive half is everything the order touches afterwards, and most of it is still carried by one experienced person and a set of habits nobody has written down.

The shop is the easy half

Most commerce projects treat checkout as the finish line. In practice it is the point where the expensive work starts, and that work is rarely visible in any system diagram.

The ERP finds out about the order because somebody tells it. The accounting system is fed by an export that happens once a month, in a hurry. The warehouse works from a printed list. The courier labels are typed a second time from a screen that already has the address. The marketplace gets reconciled against the shop on a Friday, by the one person who knows how the two disagree.

None of it is complicated. All of it is repetitive, which is why it is where the errors come from, and most of it is carried informally by someone whose absence you notice more than you would like.

Where it actually goes wrong

Three places account for most of the pain, and they are worth naming separately because they fail in different ways.

Stock and price agreement. Several systems hold the same number and nobody has decided which one is right. The failure is overselling and mispricing, and both reach the customer before they reach you.

Documents. Invoices, corrections and accounting records that have to match what was actually sold, in a market where the requirements are not optional. Assembling them by hand scales exactly as far as the person doing it.

Returns and refunds. The path everyone builds last: stock going back onto the shelf, money going back to the customer, and a document that has to agree with both. Handled by memory, one of the three quietly does not happen.

Retries are where integrations are won or lost

The systems you are connecting will be unavailable sometimes. A request will time out after the other side has already done the work. A payload will arrive with a field that has never been empty before, and it will be empty.

An integration that assumes the happy path deals with this by losing data quietly, which is the worst available outcome because you learn about it weeks later from a customer. Medusa v2 gives us useful ground here: workflows with durable steps, so a process that fails halfway resumes from where it stopped, and subscribers reacting to order events, so behaviour hangs off what actually happened. That makes it possible for a retry to be safe rather than to produce a second invoice.

Possible, not automatic. Which steps are safe to repeat is a decision made per flow, and it is most of the real thinking in this kind of work. The Medusa plugins we publish are built on the same ground, and every one of them ships with its writers off by default, so a store decides when something starts changing its data.

Code or n8n, decided per flow

We build these flows in TypeScript against Medusa, and in n8n where a simple flow genuinely suits it. That is a choice we make case by case rather than a preference we apply everywhere.

A low-volume exchange between two well-supported services is often better off in a visual tool, and proposing something larger would be self-serving. The moment the logic grows branches, the volume climbs, or a failure needs a specific recovery rather than a generic retry, code is the cheaper answer over the life of the flow.

An automation nobody watches is deferring the work

The specific risk with commerce automation is that it fails without telling anyone. A manual process fails loudly, because a person is standing in front of it. An automated one just stops, and everything downstream looks like an ordinary quiet day until the month-end numbers do not add up.

So monitoring is part of what we build, not an option on top. Each flow reports what it processed and what it could not, failures raise an alert to a person rather than to a log nobody reads, and cases that genuinely need judgement arrive with enough context to make it.

There is a side effect worth having as well. Automating a process forces its rules to be written down, and those rules usually live in one experienced person's head. Getting them out of there is worth something on its own, and you notice it during the week that person is on holiday.

What you get

Order handoff to the systems behind the shop

A paid order arriving in the ERP, the accounting system and the warehouse on its own, in the shape each of them expects, rather than being announced by a person who remembered to check.

Stock and price agreement across channels

One agreed source for what is in stock and what it costs, with an explicit rule for which system wins when two of them disagree. This is what stops you selling something you no longer have.

Documents produced from the order itself

Invoices and accounting records generated from what was actually sold, instead of assembled by hand from a template at the end of the day.

Shipping and courier handoff

Labels, tracking numbers and delivery statuses moving between the shop and the carrier without anybody typing the same address for a second time.

Returns, refunds and corrections

The unglamorous path handled explicitly: stock going back, money going back, and the accounting document that has to agree with both, as one flow rather than three things to remember.

Monitoring and safe retries

Every flow reports what it processed and what it could not. A retry resumes from where the work stopped instead of repeating what already succeeded, and whatever cannot be resolved reaches a person with the context to act.

How we work

  1. 01

    Follow one order to the end, including a return

    Payment, invoice, picking, dispatch, and then the same order coming back. Every place where somebody exports, retypes or reconciles is an automation candidate, and there are usually more of them than anyone expects.

  2. 02

    Establish which system owns which number

    Stock, price, delivery address, order status. Two systems holding the same field is normal. Two systems each believing they are right is what produces the Friday reconciliation.

  3. 03

    Check what the other side can actually do

    APIs, webhooks, rate limits, permissions, and the awkward cases where the exchange on offer is a file drop or an FTP account. This step decides feasibility and cost, and skipping it is how an estimate falls apart three weeks in.

  4. 04

    Build with failure as the normal case

    Steps are durable and retryable from the first line, because the interesting question is never the happy path. It is what the flow does when the ERP is unavailable for twenty minutes halfway through an order.

  5. 05

    Run it beside the manual process, then watch it

    The automation runs alongside the existing way of working long enough for the results to be compared, and it goes live with alerting on the flows that matter rather than with hope.

Tools and technology

Where a solid open-source tool exists, we choose it over a closed one. No lock-in to a single vendor, and costs you can actually predict.

  • Medusa v2
  • Node.js
  • TypeScript
  • PostgreSQL
  • Redis
  • n8n
  • Stripe
  • inFakt
  • Allegro
  • Grafana

Frequently asked questions

More services in this category

Read testimonials from companies that trusted us

They're always a few steps ahead.

Mikołaj

CEO & Founder, GBS®

View on Clutch
GBS® logo

Delivered well ahead of the deadline.

Yasniel

CEO, IMEGA Sp z o.o.

View on Clutch

ZanReal's individual approach is impressive.

Adam

Executive, w-studio.pl

View on Clutch

Knowledge and business intuition make them a valuable partner.

Magda

Designer, DIGITALUNI

View on Clutch

Quick solutions that reduced costs by 99%.

Andrei Kapytau

Team Lead, busel.uk

View on Clutch

+20% deliverability for our email campaigns.

Joan Calabria

Sales Director, 36NORTH

View on Clutch
36NORTH logo

Latest

Technical guides, security insights, and what we've learned building with AI.

What actually happens to an order once the payment clears?

Message us

Walk us through one order and one return, from payment to invoice to the warehouse. We will point out which of those steps your systems could be handling between themselves.

Zanek

Can't keep up with changes in AI world?

Let us do the heavy lifting. Every week we distill the most important AI developments into a focused 5-minute briefing - so you stay ahead without the noise.

Find out more
Weekly AIonline