B2B Auto-Discount System Overview

Implementing automatic B2B discounts and invoice payment in headless e-commerce

B2BMember PricingAuto DiscountShopifyHeadless
3 min read

The Need for B2B Account Discounts

In typical online stores, all customers purchase at the same price. However, B2B (business/dealer) customers often require special treatment:

  • Volume-based discount pricing
  • Different discount rates by brand or product category
  • Invoice payment (net terms) instead of credit card

This article introduces a system that automates all of these in a Shopify + Headless e-commerce setup.

What We Want to Achieve

Customer Experience

  1. Log in with a B2B account
  2. Member pricing automatically displayed on product pages
  3. Discounts auto-applied when adding to cart
  4. No coupon code entry required at checkout (applied behind the scenes)
  5. Option to choose invoice payment if desired

Operations Benefits

  • Easy to add new B2B accounts
  • Discount rate changes completed in Shopify admin only
  • Flexible operations without code changes

System Overview

Let's look at the overall architecture.

B2B Auto-Discount System Overview
Shopify Admin

①Tag customers (standard-35 etc.) ②Create segments ③Create collections ④Create coupons

Storefront API / Admin API
Website (Headless)

⑤Fetch tags on login ⑥Display member pricing ⑦Auto-apply coupons ⑧Invoice payment support

Key Design: Tag Name = Coupon Name

The biggest point of this system is matching customer tag names with coupon names.

Tag Naming Convention

Embed the discount rate in the tag name.

standard-35
MeaningStandard category 35% OFF
premium-25
MeaningPremium category 25% OFF
special-40
MeaningSpecial category 40% OFF

Coupon Naming Convention

Create coupons with exactly the same name as the tags.

standard-35
Discount35%
TargetStandard category products
premium-25
Discount25%
TargetPremium category products
special-40
Discount40%
TargetSpecial category products

Why This Design?

This approach provides:

  1. No code changes: Adding new coupons doesn't require frontend code changes
  2. Easy operations: Add new B2B customers through Shopify admin only
  3. Simple rate changes: Just update both tag and coupon

Headless-Specific Challenges

Why Custom Implementation Was Needed

With traditional Shopify themes, you can easily add B2B functionality through apps. However, in headless setups, the frontend exists outside Shopify (e.g., Next.js), so app features can't be used directly.

What About Shopify B2B?

Shopify has official B2B features, but they require Shopify Plus (~$2,000/month). For small to medium e-commerce sites, this cost is a significant burden.

This design achieves B2B functionality on standard Shopify plans.

What This System Enables

1. Automatic Discounts

From the moment a customer logs in, member pricing is automatically reflected. No coupon code entry required.

2. Multi-Brand/Category Support

Even with different category products mixed in the cart, appropriate discounts are auto-applied to each.

Example:

  • Standard category product → 35% OFF
  • Premium category product → 25% OFF
  • Both in cart → each correctly discounted

3. Invoice Payment (Net Terms)

Accept orders with invoice payment instead of credit cards. Uses draft orders to support post-payment invoice flow.

4. Flexible Priority Management

When multiple discount rules could apply to the same product, control with priority settings.

Next Steps

Implementing this system requires setup on both Shopify and headless sides.

The next article details the Shopify admin configuration.

Related Topics