PO number format examples
Purchase-order number format: no universal pattern, buyers set their own
Direct answer. There is no universal purchase-order number format. Buyers set their own. Common patterns include a year-and-sequence string such as PO-2026-00123, a numeric-only string, and a fixed-length alphanumeric code. The regexes below are examples of those patterns, with what each accepts and rejects — not a standard anyone must use.
B2B PO Guard — Require PO (Shopify App Store · Write a review) validates PO numbers by format, prefix, regex, length, and uniqueness, and previews any PO rule live against a sample number before you publish. This page is example formats and regexes — not the require-PO job and not uniqueness. General information only.
Related: PO Box Blocker — AddressFence — Free blocks PO Boxes and parcel lockers on the shipping address at checkout, plus a small set of ZIP rules. Street-number checks and billing-address rules are on a paid plan.
Free check first: PO number format tester runs in your browser and sends nothing. Test prefix, length, characters, regex and duplicates on sample PO numbers.
Common patterns buyers actually send
A purchase-order number is the buyer’s reference, so the shape follows their system, not yours. You will see strings like PO-2026-00123, a run of digits such as 4500012345, or a fixed-length mix of letters and digits such as AB12CD34. Hyphens, prefixes, year segments, and length are conventions, not a shared specification.
Requiring the field to be filled is a different job from checking that the string matches a pattern. Walk required vs empty on why a B2B checkout can skip a PO number unless a rule requires it, and walk prefix, regex, and length as checkout rules on format, prefix, regex, and length.
Example regexes: what each accepts and rejects
These patterns use JavaScript syntax with start and end anchors, the same whole-string match the PO number format tester applies. They are case-sensitive unless you turn ignore-case on. Copy only the pattern that matches the convention you actually need; do not treat the set as a catalogue of every valid PO.
| Pattern | Regex | Accepts | Rejects |
|---|---|---|---|
| Prefix, four-digit year, five-digit sequence | ^PO-\d{4}-\d{5}$ |
PO-2026-00123 |
PO-26-00123, po-2026-00123, PO2026-00123, PO-2026-123 |
| Numeric-only, ten digits | ^\d{10}$ |
4500012345 |
450001234, 45000123456, PO-4500012345, 4500-012345 |
| Fixed-length alphanumeric, eight characters | ^[A-Z0-9]{8}$ |
AB12CD34 |
ab12cd34, AB12-CD34, AB12CD3, AB12CD345 |
| Prefix plus six digits | ^PO-\d{6}$ |
PO-123456 |
PO123456, PO-12345, PO-1234567, po-123456 |
| Three letters plus seven digits | ^[A-Z]{3}\d{7}$ |
ACM1234567 |
AC1234567, ACM-1234567, acm1234567, ACM123456 |
Spaces inside a number fail these patterns. A uniqueness check (the same number used twice) is not a regex; that job is a separate rule against previously used numbers.
From an example pattern to a checkout rule
Write the pattern you intend to enforce, then run matching and non-matching samples through the tester. Requiring a PO number at all is its own rule. Format, prefix, regex, and length are the slice on prefix, regex, and length. Preview the live rule against those samples in B2B PO Guard — Require PO before you publish.
What this page is not
- Not a universal PO format, and not a list of every pattern a buyer might send.
- Not a check of whether a PO number is real, approved, or paid.
- Not the require-PO, uniqueness, or live-preview siblings.
- Not a postal PO Box block. That job is block PO Box on billing.
Related pages
- PO number format tester
- Validate B2B PO format, prefix, regex, and length
- require a PO number
- Require a B2B purchase-order number
- Stop reused PO numbers
- Preview a PO rule before publish
- B2B PO Guard — Require PO
General information only. Not legal, credit, or accounting advice. Confirm the format your buyer uses before you treat a sample as valid.