Introduction
Once the tags, segments, and coupons are set up on the Shopify side, the website (the headless side) takes over. Its job is to recognise who the logged-in user is from their tags, show them their member price, and make sure the discount is handed over intact at checkout. This article stays out of the code and walks through the flow instead — which pieces move, and in what order.
There are five things to do: fetch the tags at login, work out the discount rate from those tags, display the member price, auto-apply the coupon at checkout, and support payment by invoice. We'll take them in turn.
Reading the Logged-In User's Tags
Fetching Tags Through the Storefront API
When a user logs in, the site queries the Storefront API (the doorway a website uses to read Shopify's data) and receives the list of tags attached to that user. If standard-35 and premium-25 come back, that tells the site "this account gets 35% off the standard category and 25% off the premium category."
The tags come back exactly as they were set in the Shopify admin, so the website never has to hold its own per-account configuration. Everything it needs to decide is already in the tags.
Reading the Discount Rate Out of the Tag Name
Tags follow a fixed shape — category name, hyphen, number — so the number on the end is read as the discount rate. standard-35 means 35% off. As long as that naming rule holds, new tags can be added without touching the website at all.
The only thing the website keeps on its side is the mapping between categories and collections, such as "the standard tag corresponds to the standard-category collection." Adding a new category means adding one line to that mapping. This part was assembled by settling the design in plain words first, then directing an AI agent (AI-assisted development) to build it.
Calculating and Displaying the Member Price
How the Calculation Thinks
On product pages and in the cart, two things are checked: is this product inside a discounted collection, and does the user hold the matching tag? If both are true, the member price is the regular price minus the discount rate. If either is false, the regular price stands. That's the entire decision.
How It Looks in the Cart
In the cart, the regular price and the member price sit side by side so it's immediately clear how much has come off.
The two tables show that even with products from different categories mixed in one cart, each line gets its own correct rate. Spelling out the discount amount also serves as confirmation for the account holder that they're buying on the terms they agreed to.
Auto-Applying the Coupon at Checkout
The Tag Name Doubles as the Coupon Name
When "Proceed to checkout" is pressed, the website compares the user's tags with the cart contents, works out which coupons should apply, attaches them to the cart, and only then hands over to Shopify's checkout.
Check what's in the cart and which collections those products belong to
Identify which tags apply
Tag name = coupon name, applied to the cart
Arrives with the discount already applied
The diagram shows the hand-off that happens behind that button: find the coupon whose name matches the tag, and attach it.
Keeping the Displayed Price and the Charged Price the Same
Showing a member price on the website alone isn't enough — the moment the user reaches checkout, the price would snap back to normal. The number only holds if the way the site displays prices and the way Shopify applies discounts run on the same rule. Making the tag name and the coupon name identical is what guarantees that match, using nothing more than a naming convention. From the user's point of view, there's no code to know and nothing to type: being logged in is what brings the discount.
Supporting Payment by Invoice
Taking Orders as Draft Orders
B2B buyers frequently ask to pay on invoice rather than by credit card. So alongside the normal route into checkout, there's a second option: "Order with invoice payment."
When the second option is chosen, the site uses the Admin API (the doorway for operating Shopify's back office) to create a draft order. The draft order records the products at their member prices, the discount rate and amount, and the user's details — so it works as a copy of the order exactly as it stands.
The Sales Team Is Notified Automatically
The moment a draft order is created, an email notification goes to the sales team. Someone checks the contents, and if all is well, issues the invoice. Taking the order is automatic; confirming the amount and billing stays with a person. Stopping short of full automation is deliberate — it keeps the credit judgement that invoice terms require in human hands.
Priority Between Rules, and a Summary of the Parts
When more than one discount rule could apply to the same product, the rules carry a priority order. The highest-priority rule that matches is applied, and the process stops there. Controls like "if there's a VIP discount, it beats the standard one" come down to nothing more than the order in the list.
To close, here's what the website side is responsible for.
Adding a new account or a new category is finished entirely in Shopify's settings, and users get their member price simply by logging in. The whole thing delivers this much B2B capability on a standard plan, with no Shopify Plus contract required.