Match PO lines to the catalog
distru_match_po_to_catalogMatch purchase-order lines to catalog products, returning unambiguous matches and flagging ambiguous or unresolvable lines for human review.
Instructions
Match free-form purchase-order lines against the product catalog and report what could NOT be resolved. Read-only; writes nothing. Returns two buckets: matched (one product, unambiguously) and needs_review (why it stopped, plus every candidate considered). It deliberately does not guess when the catalog is ambiguous - duplicate rows for one product, reissued SKUs, colliding category slugs, and conflicting MSRPs all stop the line and are returned with evidence. Treat needs_review as the point of the tool, not as an error: those lines need a human, and presenting a confident answer for them would be wrong.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | Yes | The PO lines to resolve. | |
| flag_price_mismatch | No | Stop a line when its price differs from the catalog price. Default true. | |
| include_catalog_warnings | No | Include structural problems found in the catalog itself. Default true. | |
| flag_insufficient_inventory | No | Stop a line when on-hand quantity cannot cover it. Default true. |