
A trade customer rarely behaves like one person sitting at one laptop from start to finish.
One person notices the brake pads are low. Somebody else adds chains and sprockets. The manager checks the order later. Then purchasing actually places it.
A normal ecommerce basket is not built for that.
The idea
I wanted the basket to belong to the company, not the browser session.
If one person starts an order, another authorised person from the same company should be able to pick it up later. No emailing screenshots. No “what did you put in the basket?”. No rebuilding the whole order because Dave closed Chrome.
The bit that sounded easy
“Save the basket and load it again.”
That sentence hides nearly all of the difficult bits.
- Which company does the basket belong to?
- What happens if two people change it?
- How do you avoid an old basket overwriting a newer one?
- When should it expire?
- What happens when the checkout becomes an order?
- What happens when Shopify’s dev environment cannot perfectly reproduce live B2B company locations?
What we built
The result became a proper Shopify app backed by Postgres and deployed on Railway. It stores company basket state, reloads it for the right people and includes recovery logic so stale data does not trample a newer order.
The same app later became useful for abandoned-checkout handling and review automation too, because once you have a reliable company/order data layer, more jobs become possible.
What worked
The biggest win was not the code. It was changing the mental model from “a customer has a cart” to “a company is assembling an order”.
That matches how our customers actually work.
The lesson
Some of the best ecommerce features are invisible. Nobody gets excited about database persistence. They do notice when they do not have to build a £600 parts order twice.
Steal the idea, not the secrets
Want to build your own version?
This is the public build brief: enough architecture to get moving, without the production-specific wiring that took the painful bit to discover.
Build a shared B2B shopping basket for a Shopify company account.
Requirements:
- Save basket state server-side against the company rather than one browser session.
- Let authorised users from the same company resume the same basket.
- Store product variant IDs, quantities and timestamps.
- Prevent an older basket from overwriting a newer one.
- Decide how simultaneous edits should be handled.
- Expire genuinely abandoned baskets after a sensible period.
- Mark or close the saved basket when checkout becomes an order.
- Add idempotency and retry handling for sync jobs.
- Log basket changes so awkward edge cases can be diagnosed.
- Test the behaviour with multiple users acting as the same company.
Keep the exact production schema, recovery rules and company-resolution logic behind your own service boundary.