## TL;DR

PO numbers hide in headers, footers, line descriptions, and reference fields, and extractors miss them when they sit outside the expected zones. Search the full OCR text with PO patterns (labels like PO, P.O., order no. plus alphanumeric codes), validate candidates against open POs, and confirm with the vendor master. A found PO number unlocks the whole matching flow.

## Error

```text
No PO reference extracted; invoice header shows 'PO: 4500012345'
```

## Steps

1. Search the full OCR text for PO label patterns and nearby codes.
   Expected: Candidate PO numbers with context.
2. Validate each candidate against the open PO list.
   Expected: A real PO or a rejected candidate.
3. Check line-level descriptions for embedded PO references.
   Expected: POs quoted per line, common in services.
4. If a valid PO is found, attach it and proceed to matching.
   Expected: The invoice enters the matched flow.
5. If none validates, route as no-PO per policy.
   Expected: Explicit handling instead of a stuck invoice.

## When to use

- Invoice references a PO that extraction missed
- PO field is empty after extraction
- Matching cannot start for lack of a PO number

## When not to use

- PO matching discrepancies (have the number, values differ)
- No-PO policy invoices
- Vendor master issues

## Compatibility

Extractor-agnostic; needs open-PO data from ERP/procurement.

## Variant phrasings

### PO number not extracted

### find PO reference on invoice

### OCR missed purchase order number

## Root cause

PO numbers appear in inconsistent locations and formats across vendors. Field-targeted extractors look in the header zone; the number is often in a footer, a line description, or an unlabeled reference field.

## Edge cases

- Customers' PO vs internal PO numbering can collide; scope validation to the vendor
- blanket POs have one number for many releases; validate the release too
- Handwritten PO additions need the handwriting path first

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_l_90z37GkkNNzePsigzCHQ
