Shopify B2B Discount Configuration

Step-by-step guide for customer tags, segments, collections, and coupons

ShopifyCustomer TagsCouponsCustomer SegmentsB2B Setup
6 min read

Introduction

The foundation of the B2B auto-discount system is built entirely inside the Shopify admin screen. There is not a single step that requires writing code. If you can navigate the admin, following this article in order will get the configuration done.

You will set up four things:

  1. Customer tags — markers that identify B2B users
  2. Customer segments — automatic groups of users who carry a tag
  3. Collections — shelves that gather the discount-eligible products
  4. Coupons (discount codes) — the parts that perform the actual discount

Only when these connect in the order "tag → segment → coupon" does the automatic discount start working. Let's go through them one at a time.

Step 1: Tag Your Customers

Use the "category-rate" Format

B2B users get tags in a fixed format: "category code-discount rate." Embedding the rate in the tag name itself is the point.

With this convention, the website can read a tag and immediately know "this user buys standard-category items at 35% off." As you'll see later, the tag name also becomes the coupon name, so consistent naming directly translates into a reliable system.

Reading the Discount Rate from a Tag
Fetch the tag 'standard-35'
Read the trailing '35' as a number
Calculate as 35% OFF

The number at the end of the tag name is used directly as the discount rate — that's the whole flow.

Multiple Tags per Customer Are Fine

A partner who deals in several categories can carry several tags. A user holding both standard-35 and premium-25 who puts items from both categories in the cart gets each discount applied separately to the matching items. Differences in contract terms across partners are expressed purely through tag combinations.

How to Apply Tags

Open the target user under "Customers" in the admin, type the tag into the tag field following the rule above, and save. For a large partner list, bulk CSV import or automation through the Admin API (the doorway for operating Shopify's back office programmatically) both work.

Step 2: Create Customer Segments

A Segment Is an Automatic, Tag-Based Group

A customer segment is a group that users join automatically when they match a condition. Create a segment with the condition "customer tag contains standard-35," and every user you tag lands in the group with no manual list-keeping. The moment the tag is applied, the grouping is already done.

There is exactly one reason to create these segments: to restrict the coupons you'll create later to "this group only." Even if a coupon name leaks, it has no effect on regular users outside the segment.

One Segment per Tag

From "Customers" → "Segments" in the admin, create one segment for each tag.

Keeping a strict one-to-one match between tags and segments makes the setup easy to audit later.

Step 3: Create Collections for Target Products

Gather Discount-Eligible Products onto Shelves

A collection works like a shelf for products. Gather the products you want discounted for B2B into a collection per category. Create them under "Products" → "Collections"; products can be added manually or automatically by condition.

Automated Collections Reduce Upkeep

Set a condition like "auto-add products whose type is Standard" or "auto-add products from this vendor (brand)," and new products join the discount target the moment they're registered. No re-shelving every time the catalog grows — for long-term operation, automated collections are the way to go.

Step 4: Create Coupons Named After the Tags

The Code Name Must Match the Tag Exactly

Create discount codes under "Discounts" in the admin. The critical rule: make the code name exactly identical to the tag name. For the tag standard-35, the coupon is also standard-35. This name match is the single thread connecting tags to coupons.

The settings look like this:

Restricting "applies to" to the Step 3 collection and "eligibility" to the Step 2 segment completes the control: this product, for these people only, at this rate.

Repeat for the Remaining Tags

Create the other coupons with the same correspondence.

Verification and Common Mistakes

Checklist

Once configured, confirm these six points:

  • Tags are correctly applied to the users
  • The segments contain the expected users
  • The collections contain the target products
  • Coupon names match tag names exactly
  • Each coupon's eligibility is set to its segment
  • Each coupon's target is set to its collection

Name Mismatches Are the Usual Culprit

The most frequent mistake is a subtle mismatch between tag and coupon names. standard-35 and Standard-35 are treated as different things, so watch capitalization and stray spaces. Other patterns: choosing "equals" instead of "contains" in the segment condition, and forgetting the segment restriction on a coupon so that anyone can use it. That last one opens the discount to every user on the site, so double-check it before going live.

Adding a New Partner Takes One Tag

With everything above in place, onboarding a new B2B account means applying one tag to the user — that's it. The moment the tag is saved, the user joins the segment automatically, the matching coupon becomes usable, and the website starts showing member pricing. Day-to-day operation touches nothing but tags.

Shopify-side configuration is now complete. The next article covers the website (headless) side: reading these tags, calculating prices, and auto-applying the coupons.