Metafield-Based Product Targeting: Let Your ERP Drive Shopify Discounts
Designing a wholesale architecture where one ERP-synced metafield rule replaces collections, tags, and manual product lists.
Enterprise Shopify merchants can target discount campaigns by ERP-synced metafields instead of collections or tags. A Wholesale / B2B Pricing campaign that targets pricing_group = dealer prices the exact catalog the ERP defines, so new or reclassified products qualify automatically after each sync. Business rules stay in the ERP, campaign maintenance drops to near zero, and complexity no longer scales with catalog size.
At a glance
- Challenge
- A 92,000-product distributor rebuilt ERP eligibility rules inside Shopify by hand, losing days of work every time thousands of products changed pricing groups.
- Approach
- Wholesale / B2B Pricing campaigns target an ERP-synced pricing_group metafield, with Bulk Price Update for clearance and conflict detection as the guardrail.
- Discount Prime campaign types used
- Wholesale / B2B PricingMetafield TargetingBulk Price Update
Scenario-based case study: the merchant profile is modeled on patterns across real Discount Prime stores, not a single named customer.
Introduction
Every growing Shopify catalog eventually collides with the same operational wall: the products are governed by one system, while the promotions are governed by another. For enterprise wholesalers, product truth lives in the ERP. Costs, suppliers, categories, contract eligibility, pricing groups: all of it is already classified, already maintained, already correct. Yet most discount tooling asks merchants to rebuild that intelligence by hand, one collection or product tag at a time.
Instead of asking:
"Which products should receive this discount?"
a solutions architect asks:
"What business rule should define this campaign?"
That shift is the entire architecture. This case study designs a wholesale pricing system in which the ERP keeps making the decisions and Discount Prime simply executes them, using metafield-based product targeting.
Merchant Scenario
Consider Atlas Industrial Group, an enterprise wholesale distributor supplying industrial equipment across North America.
| Attribute | Detail |
|---|---|
| Industry | Enterprise Wholesale Distribution |
| Annual Revenue | $84 Million |
| Products | 92,000+ |
| Warehouses | 11 |
| Suppliers | 230 |
| ERP | Microsoft Dynamics 365 |
| Storefront | Shopify Plus |
Every product in Shopify originates in the ERP: names, inventory, cost, supplier, category, availability, and above all the pricing group that decides how each product may be sold. Only one thing does not live there: promotional rules. Those were rebuilt inside Shopify, by hand, every week.
The Synchronization Problem
The marketing team launches new wholesale campaigns every month, and eligibility changes constantly. Some products qualify for distributor pricing. Others belong to government contracts and can never be promoted. To keep campaigns accurate, employees manually mirror the ERP: collections rebuilt, tags added, products imported, campaigns edited. Hours of work reproduce answers the ERP already holds.
The breaking point arrives during a quarterly promotion, when more than 7,000 products change pricing eligibility at once. The ERP updates every record automatically. Shopify does not. The team spends nearly two full days rebuilding collections, and by the time they finish, the ERP has already changed hundreds of products again.
The business is not struggling with pricing. It is struggling with synchronization.
Business Objectives
| Priority | Objective |
|---|---|
| 1 | Eliminate manual product selection from campaign management |
| 2 | Keep the ERP as the single source of truth for eligibility |
| 3 | Support several wholesale pricing models in parallel |
| 4 | Make campaign complexity independent of catalog size |
| 5 | Guarantee contract and government products are never promoted |
Option 1: Manual Collections
Build a Shopify collection per campaign and rebuild it whenever eligibility changes.
Advantages
- Familiar to every Shopify team.
- No integration work required.
Disadvantages
- Rebuilt by hand after every ERP change.
- Duplicates business logic outside the ERP.
- Collections created purely for pricing pollute merchandising.
- Collapses entirely at 92,000 products.
| Factor | Assessment |
|---|---|
| Architecture Score | ★☆☆☆☆ |
Option 2: Tag-Based Targeting
Push a promotional tag from the ERP and target campaigns at that tag.
Advantages
- Tags can be written automatically during sync.
- Better than rebuilding collections.
Disadvantages
- Tags are flat labels with no key-value meaning.
- Tag sprawl: one tag per state, per season, per program.
- Stale tags must be removed as carefully as they were added.
- Tags leak into storefront filters and search.
| Factor | Assessment |
|---|---|
| Architecture Score | ★★★☆☆ |
Option 3: Metafield-Based Targeting
The ERP synchronizes one structured field, pricing_group, with every product. Inside Discount Prime, the wholesale campaign targets products where pricing_group = dealer. That is the entire rule.
Advantages
- Business rules stay inside the ERP.
- Key-value structure carries real meaning.
- Invisible to storefront navigation and search.
- One rule covers 92,000 products or 500,000.
Disadvantages
- Requires one field added to the sync mapping.
| Factor | Assessment |
|---|---|
| Architecture Score | ★★★★★ |
Comparison Matrix
| Approach | Source of Truth | Automation | Catalog Scale | Storefront Side Effects |
|---|---|---|---|---|
| Manual Collections | Shopify | None | Poor | High |
| Tag-Based Targeting | Split | Partial | Fair | Medium |
| Metafield Targeting | ERP | Full | Excellent | None |
The Discount Prime Architecture
The final design keeps one metafield as the bridge and lets each pricing_group value drive its own campaign.
| Campaign | Mechanism | Purpose |
|---|---|---|
| Dealer Wholesale Pricing | Wholesale / B2B Pricing targeting pricing_group = dealer, gated to customers tagged as dealers | Margin-based dealer tiers applied automatically to the exact catalog the ERP defines. |
| Government Contract Pricing | Wholesale / B2B Pricing targeting pricing_group = government, gated by Shopify segment | Contract pricing isolated from every promotional campaign. |
| Clearance Repricing | Bulk Price Update on pricing_group = clearance | Permanent markdowns for inventory reduction, applied in bulk without touching other groups. |
| Guardrails | Real-time conflict detection with auto-exclude, plus campaign priorities | If a product ever carries two eligible campaigns, the overlap is caught before activation and the correct campaign wins. |
One Metafield, Six Pricing Models
The same field supports every commercial program the ERP already tracks.
| pricing_group value | Pricing behavior |
|---|---|
| dealer | Dealer wholesale tiers |
| industrial | Margin-based wholesale pricing |
| government | Contract pricing only, never promoted |
| contract | Excluded from all campaigns |
| clearance | Bulk Price Update markdowns |
| standard | Retail price |
Marketing no longer manages products. It manages business logic.
Customer Journey
Walk through a dealer purchase after the redesign.
- A purchasing manager logs in. Her account carries the dealer customer tag, so the Dealer Wholesale Pricing campaign activates.
- She opens an industrial fastener kit: list price $148.00, Shopify cost price $96.20,
pricing_group = dealer. - The campaign applies the dealer tier automatically. No code, no request, no sales rep.
- She orders 40 units and checks out.
| Line | Detail |
|---|---|
| List price (40 units) | $5,920.00 |
| Dealer price at $122.84/unit | $4,913.60 |
| Discount given | $1,006.40 |
| Estimated Profit (from real cost prices) | $1,065.60 |
| Margin health | Healthy |
Three weeks later a supplier introduces a new product line. The ERP assigns pricing_group = dealer, the nightly sync completes, and every new product is priced correctly the moment it appears. No campaign edits. No forgotten products.
Measuring Success
Track operational metrics alongside financial ones:
- Hours spent per month on campaign maintenance
- Time from ERP change to storefront eligibility
- Pricing eligibility errors per quarter
- Estimated Profit per campaign in profit analytics
- Margin health distribution (Healthy / Thin Margin / Loss)
- Dealer reorder frequency
The first three should trend toward zero effort. The last three prove the pricing itself stays sound.
Common Mistakes
- ❌ Building collections that exist only to feed discounts.
- ❌ Duplicating ERP business rules inside Shopify.
- ❌ Maintaining promotional eligibility in spreadsheets.
- ❌ Editing product tags by hand after every ERP update.
- ❌ Letting campaign complexity grow with catalog size.
Key Lessons
Atlas did not automate discounts. It automated decision making. The ERP already knew every answer; Discount Prime did not need to replace that intelligence, only to read it. When a campaign is defined by a metafield rule instead of a product list, growth stops creating operational work: the rule for 92,000 products is the same rule for 500,000.
Metafields bridge two worlds that should never merge. Business logic stays inside enterprise systems. Customer pricing stays inside Shopify.
Conclusion
Enterprise commerce is not about managing more products. It is about managing fewer decisions. When promotional logic already exists inside an ERP, rebuilding it inside Shopify creates cost, delay, and error. Metafield-based product targeting lets the ERP remain the single source of truth while Wholesale / B2B Pricing, Bulk Price Update, and conflict detection execute the strategy automatically.
Once the campaign is defined by a business rule rather than a product list, everything else becomes automation.
Frequently asked questions
How do I target Shopify discounts by metafield instead of collections?
Use a discount app that supports metafield-based product targeting, such as Discount Prime. Sync a structured field like pricing_group from your ERP or PIM to every product, then set the campaign to include products where that metafield matches a value, for example pricing_group = dealer. The campaign re-evaluates eligibility from the metafield, so you never rebuild collections or edit product lists when eligibility changes.
Why are product tags a bad way to manage B2B discount eligibility?
Tags are flat labels with no key-value structure, so each eligibility state needs its own tag and stale tags must be cleaned up manually. Tag sprawl grows with every season, program, and campaign, and tags leak into storefront filters and search. Metafields solve both problems: they carry structured values like pricing_group = government, stay invisible to shoppers, and can be written automatically by your ERP during nightly sync.
Can my ERP control which Shopify products get wholesale pricing?
Yes. Map one ERP classification field, such as a pricing group or margin class, to a Shopify product metafield in your integration. A wholesale campaign then targets that metafield value, so the ERP remains the single source of truth for eligibility. When the ERP reclassifies a product or adds a new line, the next sync updates the metafield and the product's pricing changes automatically, with no campaign edits in Shopify.
What happens when thousands of products change discount eligibility at once?
With collection or tag-based targeting, someone must rebuild lists by hand, which can take days and immediately goes stale. With metafield-based targeting, a bulk ERP update flows through the normal product sync and every affected product gains or loses campaign eligibility automatically. One distributor scenario saw 7,000 products change eligibility in a quarter; the metafield rule absorbed the change with zero manual campaign work.
How do I keep contract or government-priced products out of promotions on Shopify?
Give those products an exclusive classification, such as pricing_group = government or contract, synced from your ERP as a metafield. Promotional campaigns target other values only, so restricted products can never qualify. Add real-time conflict detection with auto-exclude and campaign priorities as a second guardrail: if a product ever matches two campaigns, the overlap is flagged before activation and the correct campaign wins.
Go deeper
Run this architecture in your store
Every campaign type in this case study is included in Discount Prime, with profit analytics to verify the margin impact.