B2B PO Guard — Require PO · Validation Function
You can require a B2B PO number with a Validation Function, or with a no-code app
Shopify's B2B PO number field stays optional unless a Cart and Checkout Validation Function or an app requires it; if you don't want to write and deploy that Function yourself, B2B PO Guard — Require PO (App Store handle b2b-terms-guard, not the separate listing titled only "B2B PO Guard") checks PO numbers on B2B orders and flags missing, malformed, or duplicate values before they reach invoicing, with each rule previewed live against a sample number before you publish. Checkout enforcement runs on Shopify Plus B2B; PO rules work on every plan.
Last updated: 2026-11-24 (Asia/Tokyo). shopify.dev changelog and Function API checked the same day.
What changed in API version 2026-04
The 1 April 2026 changelog, Cart and checkout validation adds billing address and PO number error targets, says that as of API version 2026-04 you can validate billing addresses and purchase order numbers in Cart and Checkout Validation Functions. The input graph adds poNumber, and the supported checkout field target for a PO error is $.cart.poNumber. The same change is in the 2026-04 Function API, which lists “Validate purchase order numbers for B2B customers” as a use case. Existing functions keep running; these targets are optional.
The PO number on the cart is the buyer’s purchase-order reference, often used on B2B checkouts. It is not Shopify’s retail “purchase order” document for replenishing inventory. That distinction is on Shopify purchase orders vs the B2B checkout PO number.
Write a Function, or use a no-code app
| Custom Validation Function | No-code app (for example B2B PO Guard — Require PO) | |
|---|---|---|
| What you do | Create a custom app, generate a Cart and Checkout Validation extension, query poNumber, and return a validationAdd operation when the value is missing or invalid, targeting $.cart.poNumber. | Install the app, create a PO rule, preview it against a sample number, then publish. |
| Who maintains it | Your developers. You also stay inside Shopify’s limit of 25 active validation functions per store. | The app. Merchant steps are on How to require a PO number on Shopify B2B. |
| What it can check | Whatever you write: empty value, format, prefix, or other logic you add to the Function. | The listing describes format, prefix, regex, length, and uniqueness checks, with live preview before publish. |
| Where it runs | Server-side, on checkout surfaces the Function API supports, including express checkouts listed in that API. | On B2B company checkout, as described on the how-to page. D2C and no-company checkouts stay untouched. |
There is no Shopify admin toggle that, on its own, makes the B2B PO field required. Native B2B payment terms set when payment is due; they do not validate the PO number. See B2B checkout can skip a PO unless a rule requires it.
If you do write the Function
Follow the live Cart and Checkout Validation Function API. In outline:
- Create a custom app and add a cart-and-checkout-validation Function extension, targeting API version 2026-04 or later.
- Include
poNumberin the Function input query. Shopify’s changelog says that field is available on Function input graphs and returns null outside Cart and Checkout Validation. - When the value is missing or invalid, return a validation error whose target is
$.cart.poNumber, with a short message the buyer can act on. - Activate the validation in the Shopify admin. Shopify allows a maximum of 25 validation functions on each store. If a run fails, checkout continues without the validation by default unless you set
blockOnFailurewhen you create the validation.
This outline is not a substitute for the developer tutorial. Menu labels can move between admin releases.
If you want a no-code rule instead
B2B PO Guard — Require PO requires a PO number on B2B company checkout and can check format, prefix, regex, length, and duplicates. Each rule can be previewed live against a sample number before you publish. Native payment terms stay where they are. Step-by-step install and publish instructions are on the require a PO number how-to. The App Store handle is b2b-terms-guard — not the separate listing titled only “B2B PO Guard.”
Open B2B PO Guard — Require PO on the Shopify App Store
Free check first: the PO number format tester runs in your browser and sends nothing.
What this page is not
- Not a complete Function tutorial, and not sample source code.
- Not a Net Terms or deposit setup guide. Payment terms stay in Shopify. See alongside native Net Terms.
- Not a listing of plan prices. Those, when you need them, are on the live App Store listing and the how-to page above.
Related pages
- How to require a PO number on Shopify B2B
- B2B checkout can skip a PO unless a rule requires it
- Validate B2B PO format, prefix, regex, and length
- Preview a PO rule live before publish
- B2B PO Guard — Require PO vs PO Validator
- Age verification: popup vs checkout
- Shopify changelog: billing address and PO number error targets
Not legal or accounting advice. Function and changelog facts are from shopify.dev as read on 24 November 2026 (Asia/Tokyo). Confirm the live API version in your app before you ship a rule.