Skip to main content

Shopify B2B

This page is for engineering teams running Shopify Plus or Shopify Enterprise storefronts who need per-company pricing beyond what Shopify's native B2B tools provide. It covers the integration architecture, prerequisites, account mapping, and current limitations.


Who this is for

Shopify's built-in B2B features let you assign price lists and payment terms per company, but they have hard limits: pricing logic lives inside Shopify, there is no external engine to call, and the same prices cannot simultaneously power non-Shopify channels.

The Quantaprice Shopify integration is designed for merchants who:

  • Need pricing rules that exceed Shopify's native capabilities (multi-tier quantity breaks, metadata-driven segment pricing, cross-channel consistency, historical auditability).
  • Operate Shopify as one channel alongside direct checkout, EDI, or other integrations — and need a single source of pricing truth across all of them.
  • Require deterministic, reproducible prices for audit and dispute resolution.

How it works

The integration connects Shopify to the Quantaprice engine through three distinct integration points. The engine itself has no Shopify-specific code; all Shopify-specific logic lives in an adapter layer that translates between the two systems.

App Proxy — storefront price display

The Quantaprice Shopify app registers an App Proxy at /apps/quantaprice. When your theme JavaScript requests prices for a product page or collection listing, Shopify routes those requests through the proxy to the Quantaprice engine's POST /price/query endpoint. The proxy resolves the logged-in company account to a pricelist code, injects it into the filter, and returns prices back to the theme.

This path is available to all merchants who install the app, regardless of Shopify plan. It handles real-time price display on the storefront but does not enforce prices at checkout — that requires Cart Transform.

Cart Transform — checkout price enforcement

Shopify Plus exposes the Cart Transform API, which allows external services to override line item prices before the order is placed. When a customer reaches checkout, Shopify calls the Quantaprice Cart Transform function. The adapter looks up the correct price from the engine, validates it against what is in the cart, and applies any necessary corrections.

This is the enforcement layer. Without it, a sufficiently motivated user could manipulate prices between the storefront and checkout. Cart Transform is Shopify Plus only.

Order webhook — post-purchase verification

After an order is created, Shopify fires an orders/create webhook to the Quantaprice adapter. The adapter re-queries the engine for the ordered SKUs (using the same pricelist and, optionally, as_of set to the order timestamp) and compares the order prices against the expected engine output. Discrepancies are logged and surfaced in the Quantaprice dashboard.

This step handles edge cases: Shopify-native discount codes, automatic discounts, and promotional pricing that Shopify applies outside the Quantaprice flow. The verification record forms a durable audit trail for each order.


What the engine doesn't know

The Quantaprice engine has no concept of Shopify companies, sessions, storefronts, or checkout flows. It answers price queries — SKUs, pricelist codes, currency, tax area, quantity. That is all.

All Shopify-specific concerns — resolving a logged-in customer to a pricelist code, parsing a Cart Transform payload, verifying a webhook signature — are handled entirely by the adapter layer. This separation is an intentional architectural choice with a concrete benefit: the same pricing engine serves your Shopify storefront and your other channels (direct API integrations, EDI, internal tooling) simultaneously, with no duplication of pricing logic and no risk of the channels diverging.

If you are building a custom integration or debugging pricing behaviour, query the engine directly using POST /price/query with the appropriate pricelist filter. You do not need Shopify involved to reproduce an engine result.


Prerequisites

Before enabling the Shopify B2B integration, confirm the following:

RequirementNotes
Shopify Plus or EnterpriseRequired for Cart Transform (checkout price enforcement). The App Proxy (storefront display only) works on lower plans.
B2B Companies feature enabledMust be active on your Shopify store. Enable it in Shopify Admin under Settings → B2B.
Quantaprice Shopify app installedInstall from the Shopify App Store. The app provisions the App Proxy, Cart Transform function, and webhook subscriptions.
Pricelist codes configured in the appCompany-to-pricelist mapping is managed in the app settings, not in the engine. See Account mapping.

Account mapping

Quantaprice does not have a concept of Shopify companies. The mapping from a Shopify company account to a Quantaprice pricelist code is configured in the Quantaprice Shopify app settings, under B2B → Company Mappings.

Mapping options:

  • Direct mapping: Assign a specific pricelist code to a specific Shopify company ID. Appropriate when each company has a bespoke negotiated price.
  • Metafield mapping: Set a quantaprice.pricelist_code metafield on the Shopify company object. The adapter reads this metafield at query time. Useful for managing mappings programmatically via the Shopify Admin API without touching the Quantaprice app settings.
  • Fallback pricelist: Configure a default pricelist code for companies with no explicit mapping. Typically this is your standard retail or B2B base pricelist.

When the adapter cannot resolve a pricelist code for a company — no direct mapping, no metafield, and no fallback configured — it returns a 422 and the storefront will display the default Shopify price (or no price, depending on your theme's error handling). Set a fallback pricelist to prevent this.

Company mapping is not synced in real time by default. If you add a new company in Shopify, either add a direct mapping in the app or set the metafield on the company object before the company's first session.


Limitations

Cart Transform is Shopify Plus only

Merchants on Basic or Advanced Shopify plans can install the app and use the App Proxy for real-time price display on the storefront, but checkout price enforcement requires Cart Transform, which Shopify restricts to Plus and above. On non-Plus plans, prices shown on the storefront are informational only and are not enforced at checkout.

No nested bundle pricing in Phase 1

The current integration does not support bundle SKUs where component prices must be resolved and summed at checkout. If your catalogue includes bundles, price them as a single SKU in Quantaprice and ensure the bundle SKU is the unit that appears in the Shopify cart.

Shopify discount stacking

Shopify-native discount codes and automatic discounts are applied by Shopify after the Cart Transform step. The order verification webhook handles this by comparing the final order total (post-discount) against expected values and logging any variance. The engine does not receive or evaluate Shopify discount codes directly.

FX rates in Cart Transform

Cart Transform calls are synchronous and latency-sensitive. If the requested currency requires FX conversion, the adapter uses the engine's daily-updated rates. Prices shown at checkout reflect the rate active at the time of the Cart Transform call, which may differ slightly from the rate active when the customer first viewed the product page. For high-value B2B transactions where FX variance is a concern, configure pricelists denominated in the customer's billing currency to avoid runtime conversion.