# Can you combine Shopify Functions with B2B on Shopify? Rules, timing and conflicts

Source: https://returnsift.com/blog/2026-12-04-can-you-combine-shopify-functions-with-b2b-on-shopify-rules-timing-and-conflicts.html

Pairing · 2026-12-04


Short answer: yes, Shopify Functions and B2B on Shopify can run on the same store, and most stores in this niche run both. The work is in the overlap: catalog pricing and discount functions both set what a b2b buyer pays, and they were designed in different rooms.

## How Shopify Functions works

Functions are Shopify's server-side logic layer: code an app ships that Shopify runs when a cart or checkout is evaluated, covering discounts, bundle building through cart transforms, payment and delivery customisation, and validation rules that can block a checkout outright.

## How B2B on Shopify works

B2B on Shopify runs wholesale inside the retail store's walls: companies with locations and contacts, catalogs carrying contract prices, quantity rules, and payment terms that turn checkout into an invoice rather than a card charge.

## Where Shopify Functions goes wrong on its own

The other failure is subtler: writing a function that is technically correct and commercially wrong, because it applies a discount the marketing calendar retired, at a scale the old Script never reached. Functions run on every cart. Errors do too.

## Where B2B on Shopify goes wrong on its own

The other failure is pricing leakage: retail discount codes and promotions that fire on company orders, quietly repricing negotiated contracts. The wholesale buyer who notices says nothing and pockets it; the one who mentions it is doing the store a favour.

## What the evidence says about Shopify Functions

Shopify Scripts stopped running on June 30, 2026, so discount and shipping logic that lived in a store's Ruby scripts had to be re-expressed as functions, usually one function per app rather than one file per store.

Discount functions follow the combination rules set in the admin: whether two discounts can combine is a store setting, not something the function decides on its own.

A function takes a GraphQL input query describing the cart and returns JSON instructions. It never touches the page, which is why it is upgrade-safe where script tags were not.

## And about B2B on Shopify

Payment terms are set per company location, and orders placed on terms generate an invoice with a due date rather than a card charge at checkout.

Shopify limits active B2B catalogs by plan, with Plus stores getting far more headroom than the three active catalogs on lower plans, which decides how granular a wholesale pricing structure can get.

Shopify B2B catalogs set per-company pricing through price lists, percentage adjustments and fixed prices on specific variants, and a company location sees its catalog prices when its contact signs in, not before.

## Where they collide

Catalog pricing and discount functions both set what a B2B buyer pays, and they were designed in different rooms. A retail discount function that fires on a company order can undercut a negotiated catalog price, which is the kind of surprise a wholesale buyer mentions to their rep.

## The order practitioners run them in

Scope retail functions to exclude company orders, or deliberately include them and tell the sales team. The unforgivable version is the accidental one.

## A check you can run this week

Test functions the way they will fail: on the largest cart, the stacked-discount cart and the B2B cart, not the tidy three-item test cart every demo uses.

Related reading: [Does Shopify Functions help with reverse logistics cost? What the evidence and practitioners say](https://returnsift.com/blog/2026-12-02-does-shopify-functions-help-with-reverse-logistics-cost-what-the-evidence-and.md) and [Does B2B on Shopify help with reverse logistics cost? What the evidence and practitioners say](https://returnsift.com/blog/2026-12-03-does-b2b-on-shopify-help-with-reverse-logistics-cost-what-the-evidence-and-practitioners.md).

## Frequently asked questions

### Can you combine Shopify Functions with B2B on Shopify?

Yes, with the overlap managed. Catalog pricing and discount functions both set what a B2B buyer pays, and they were designed in different rooms. A retail discount function that fires on a company order can undercut a negotiated catalog price, which is the kind of surprise a wholesale buyer mentions to their rep.

### What breaks first when Shopify Functions and B2B on Shopify run together?

Catalog pricing and discount functions both set what a B2B buyer pays, and they were designed in different rooms. Scope retail functions to exclude company orders, or deliberately include them and tell the sales team. The unforgivable version is the accidental one.

### Which do you set up first, Shopify Functions or B2B on Shopify?

Scope retail functions to exclude company orders, or deliberately include them and tell the sales team. The unforgivable version is the accidental one.

### What is the most common mistake with Shopify Functions in this pairing?

The other failure is subtler: writing a function that is technically correct and commercially wrong, because it applies a discount the marketing calendar retired, at a scale the old Script never reached. Functions run on every cart. Errors do too.
