B2B Auto-Discount & Invoice Payment System

Code-change-free B2B pricing using customer tags and coupon integration

B2BMember PricingAuto DiscountInvoice PaymentShopify
3 min read

About This Project

At some point in running an EC site, this request tends to come up: "Regular users should see the standard price, but our business partners should see member pricing." That is B2B (business/dealer) support. Shopify does offer an official B2B feature, but it requires the Shopify Plus plan, which moves the monthly cost into a different bracket entirely. For a store with only a handful of business partners, that contract is honestly hard to justify.

So we built something different: a B2B auto-discount and invoice payment system that runs on the standard Shopify plan, implemented on a Shopify + headless EC site (one where the storefront pages are custom-built with Next.js).

The building blocks are two features Shopify already has: customer tags and coupons (discount codes). Users simply log in and member pricing appears automatically, and at checkout the discount is applied without anyone typing a coupon code. Invoice payment (net terms) is supported as well.

Adding a new business partner takes one tag in the admin screen. No program changes are ever needed, so non-engineering staff can handle the day-to-day operation on their own.

Learn More

We've written three articles explaining this system in detail, ordered so you can read from design thinking, to Shopify configuration, to the website-side implementation.

How It Works

Shopify Admin Configuration
Customer Tag → Segment → Coupon

standard-35 → B2B Standard 35 → standard-35 (35% OFF)

Key Point

Tag name = Coupon name (exact match)

On the Shopify side, three things are set up together: attach a tag, build a group from that tag, and create a coupon only that group can use. The key is keeping the tag name and the coupon name exactly identical.

Processing on the Headless (Next.js) Side
Login
Authenticate the user
Fetch tags
Retrieved via Storefront API
Derive discount rate
Read from the number in the tag name
Show member pricing
Displayed automatically

The website reads the logged-in user's tags, works out the discount rate from them, and displays member pricing — that is the whole flow.

Checkout Flow
Proceed to checkout
Cart confirmed
Auto-apply coupon
Coupon with the same name as the tag
Shopify checkout
Discount already applied

The moment a user heads to checkout, the coupon sharing the tag's name is applied behind the scenes, so they pay the discounted amount without entering any code.

Key Results

  • Operational efficiency: Adding a new B2B customer takes only a tag
  • User experience: Member pricing applies automatically on login
  • Flexibility: Supports different discount rates across multiple categories
  • Cost savings: Full B2B functionality without Shopify Plus

Tech Stack

  • Shopify Storefront API (customer tag retrieval)
  • Shopify Admin API (draft order creation)
  • Next.js (App Router)
  • Customer tag / segment / coupon integration