E-commerce and rules 5 min read Updated
Automating an online shop without losing control
In short
Automate what follows from a recorded fact, keep refunds and exceptions with people, and switch each flow on in steps with a record of what it did.
Online shops automate quickly because most events repeat: an order arrives, a payment succeeds, a parcel leaves the warehouse. Trouble starts with the exceptions. A webhook arrives twice, a feed contains a price the page does not show, or a refund is triggered by a script that should have waited for a person. Start by separating the work software can handle from the decisions that belong to a person.
Automate only steps with one clear trigger
Automate actions that follow from a recorded fact and have one clear trigger:
- order confirmations and payment receipts, sent once the payment system confirms the payment;
- shipment and status messages, taken from the carrier or warehouse record;
- reminders for an unpaid order, with a fixed number of attempts and a clear end;
- invoices or receipts generated from settled data, checked against the tax rules that apply to the shop;
- stock and order status updates passed between the shop, the warehouse and the accounting system;
- product feeds for marketplaces and advertising channels.
Each of these has one source of truth. If a flow needs two sources to agree, first decide which one wins.
What to keep with people
Some work should stay with a person, even when a rule seems to cover it:
- exceptions, such as an unusual delivery address or a bundle that does not match the catalogue;
- complaints and claims that depend on judging the condition of a product;
- refunds, partial refunds and goodwill credits, because they move money and an automated error repeats for every occurrence;
- decisions with legal effect, such as closing an account, cancelling a contract or deciding how a dispute is classified.
The aim is not to avoid automation but to make the boundary explicit. A rule can prepare the case, attach the order history and route it to a queue. The decision stays with the person who can read the context.
Automating safely
Webhooks are the usual trigger, and their delivery rules shape the design. Stripe states that webhook endpoints might receive the same event more than once, and that it does not guarantee delivery in the order events were generated. Its guidance is to log processed event IDs, skip events already logged, and return a successful response quickly, before complex work runs. Shopify retries failed deliveries for four hours and expects a response within five seconds; its documentation recommends queueing the work and deduplicating with the webhook identifier.
Stripe’s idempotency keys address the same problem on the outgoing side. A retried request carrying the same key returns the saved result instead of creating a second object, and the keys are pruned only after at least 24 hours. The practical lesson is to give every automated action a stable business identifier, such as the order number and the action name, and to record that identifier before the action runs.
- Idempotence: the same event or request must produce the same result when it arrives again.
- Records: log each received event, the decision taken and the outcome, and keep enough payload to replay the case.
- Manual brake: give each automation a switch that stops it and sends its work to a queue for a person.
- Staged rollout: enable one message or one channel first, compare the results with the old process, then widen the scope.
- Reconciliation: run a periodic job that compares your records with the platform data, because webhook delivery can fail for reasons outside your control. Shopify’s documentation recommends the same kind of job.
Product feeds need the same discipline
A feed is automation with a public face. Google’s product data specification requires a unique, stable identifier for each product, and it expects the title, description, price and availability to match the landing page, the checkout and the structured data on the site. A feed that drifts from the page can cause listings to be rejected or mislead customers. Compare a sample of feed rows with the live pages every day, and treat any mismatch in price or availability as an incident.
How to measure the benefit
Measure the process before and after automation, using the same definitions. Useful measures are not the number of automated messages, which says little, but the outcomes:
| Measure | What it shows |
|---|---|
| Staff minutes per order handled by hand | Effort that automation actually removed |
| Status enquiries per hundred orders | Whether customers can find out what happened without writing |
| Events sent to the manual queue, per day | How often the rules do not cover a case |
| Duplicate messages or duplicate refunds | Whether idempotence works; this should be zero |
| Feed mismatches found by sampling | Whether the feed still represents the shop |
A rollout that can be stopped
A workable sequence is short. Pick one message or flow with a clear trigger. Run it in shadow mode first, logging what it would have done without sending anything. Enable it for a small share of orders, watch the measures above, and set in advance the thresholds at which it switches off. Name an owner who can read the logs and decide. Only then widen the scope.
Shadow mode, reconciliation and staged rollout are general engineering methods. The platform statements in this article come from the cited Stripe, Shopify and Google documentation, read on 24 November 2026.
Before automating a flow, check that the underlying need is real; see Validate before you build: what to check first. Checkout pages must also stay fast while the integrations run behind them, which is covered in speed as part of design.
If your shop repeats the same daily task and you are unsure where automation should stop, describe that task through the enquiry form.
Common questions
- Which e-commerce tasks should remain with a person?
- Keep unusual order exceptions, complaints requiring judgment on product condition, refunds or goodwill credits that move money, and decisions with legal effect such as closing an account or cancelling a contract with people.
- Why must webhook handlers be idempotent and fast?
- Stripe notes that events can arrive more than once and out of order, while Shopify retries failed deliveries for four hours and expects a response within five seconds. Queue the work, deduplicate by event ID, and use stable idempotency keys.
- How should a shop roll out a new automated flow?
- Run it in shadow mode first to log what it would do, enable it for a small share of orders with pre-set shutoff thresholds and a named owner, and widen scope only after verifying the metrics and reconciliation checks.
Sources
- Idempotent requests, Stripe. Accessed 14 November 2026
- Receive Stripe events in your webhook endpoint, Stripe. Accessed 14 November 2026
- Verify webhook deliveries, Shopify. Accessed 14 November 2026
- Product data specification, Google Merchant Center Help. Accessed 14 November 2026
Further reading
-
A checkout that keeps shoppers to the end
Ask one thing per page, show errors where people can fix them, and let shoppers check their answers before they confirm the order.
-
Strong Customer Authentication for online shops
Strong Customer Authentication requires two independent checks on most card payments from EEA customers, with exemptions that depend on risk and amount.
-
Getting order emails delivered to the inbox
Order emails reach the inbox when receivers can check that your domain authorised the sender, which SPF, DKIM and DMARC records make possible.
Have an idea that should exist? Or a working product that needs more customers, a new website or a complete rework? Bring us anything. Apply with your idea