Your Shopify store runs well, until one day the business asks for a rule that no standard app handles. For example: “Any order above $5,000 must be approved by a manager before it ships.”
Now you have a decision to make. Do you extend Shopify, or build this rule into your own backend?
This post explains both options in plain language. It is useful even if you never leave Shopify.
The problem: approval for large orders
Many B2B businesses have a rule like this: big orders need a human to approve them first.
To make that work, you need three things:
- A rule check (is the order big enough to need approval?)
- A saved status (pending, approved, or rejected)
- Safe handling of failures (if something breaks halfway, nothing should be left in a broken state)
How Shopify handles this
Shopify gives developers several tools:
- Shopify Functions for custom logic such as discounts, delivery options, and checkout validation
- Checkout UI extensions for changing the checkout screens (some checkout customization needs Shopify Plus)
- Shopify Flow for no-code automation
- Admin GraphQL API and webhooks for connecting orders to outside systems such as an ERP
A common approach is: Shopify sends a webhook when an order is created, your own service decides what to do, and then it updates the order through the API.
This works well for many stores. The things to watch are:
- Some features depend on your plan level
- The API has rate limits, so syncs must be designed carefully
- Your logic can end up spread across several tools (a Function, a Flow, an app, and a separate service)
Plan details change often, so always check the current rules at shopify.dev/docs.
When a custom backend makes sense
A custom backend is worth considering when:
- The rule is core to your business, not a small add-on
- The same rule must work across your store, ERP, and other systems
- You need processes that run in steps and can undo themselves if one step fails
- You have a team that can maintain a backend
If none of these apply, Shopify is usually the faster and simpler choice.
How Medusa.js approaches the problem
Medusa is an open-source commerce backend built with TypeScript and Node.js. In Medusa v2, three building blocks matter for our example:
- Module: a self-contained piece of your own data and logic. For us, this would be “approval requests.”
- Workflow: a series of steps that run in order. If a later step fails, earlier steps can be reversed. Medusa calls this reversal compensation.
- API route: the web address that receives a request and starts the workflow.
Here is the flow for our approval example:
Request → API route (checks the input) → Workflow → Step 1: check the rule → Step 2: save the approval request → Response
If the order is below the limit, Step 1 stops the process and nothing is saved. If a later step fails, the workflow undoes what was already saved.
How you would build it in Medusa v2
You would follow these steps:
- Create a Medusa project. Medusa needs Node.js and PostgreSQL. Check the Medusa docs for the current versions.
- Create an “approval” module. It stores the order ID, the amount, an optional reason, and a status of pending, approved, or rejected.
- Create a workflow with two steps. The first checks whether the amount is above your limit. The second saves the approval request.
- Add a recovery step. If something fails after saving, the saved request is removed, so you never end up with half-finished data.
- Create admin API routes. One route creates an approval request. Another lets a manager approve or reject it.
- Validate every request. Wrong or missing data is rejected before the workflow starts.
Medusa’s admin routes require a logged-in admin user by default, which suits an internal approval process.
What happens when something fails?
There are three kinds of failure, and each is handled in a different place:
- Bad input, such as a missing field, is rejected before any work starts.
- A broken business rule, such as an order that is too small, stops the workflow at the first step, so nothing is saved.
- A failure in a later step triggers compensation, which undoes the earlier saved work.
In a small example with two steps, compensation is simple. It becomes much more valuable when your workflow also calls an ERP, sends emails, or reserves stock.
Shopify vs Medusa: the trade-offs
Neither is better in every case. They solve different problems.
When not to use Medusa
Medusa is probably the wrong choice if:
- Your store has standard needs
- You have no developers to maintain it
- You need to launch quickly
- You don’t want to manage hosting, upgrades, and security
Medusa is not automatically cheaper or better. It trades vendor limits for engineering responsibility.
Final thoughts
Choose based on two questions: how central is this rule to your business, and who will maintain the code?
Start with Shopify’s extension tools. If your rules outgrow them and your team can own a backend, Medusa becomes a strong option. If you need an experienced team to build it, Gyan Solutions offers Medusa.js development services.
What would you choose for a custom commerce workflow: Shopify extensions or a modular backend like Medusa?

