Invoice three-way match
Extract an invoice, match it against a purchase order and goods receipt, code GL expense lines, and emit a gated payment proposal only when the evidence matches policy.
You’re reading version sha-690241fbf4af. Go to the current version
Overview
Extract an invoice, compare it with the purchase order and goods receipt, assign
general-ledger coding, and emit a bounded payment_proposal only when the three
documents agree and the invoice is below the approval threshold.
The proposal is a gated Effect for the settle-invoice catalog skill. This
skill does not move money, sign payment instructions, call a rail, or mutate
external state.
In the manual
Runner
decide
Declared by its execution profile. Read the profile
SKILL.md
Invoice Three-Way Match
Extract an invoice, compare it with the purchase order and goods receipt, assign
general-ledger coding, and emit a bounded payment_proposal only when the three
documents agree and the invoice is below the approval threshold.
The proposal is a gated Effect for the settle-invoice catalog skill. This
skill does not move money, sign payment instructions, call a rail, or mutate
external state.
When to use this skill
Use it during accounts-payable intake when an operator needs a checkable packet showing whether an invoice can proceed to payment approval. The sealed receipt contains the extracted invoice facts, match status, discrepancies, GL coding, proposal details when eligible, and named exceptions when not eligible.
When not to use this skill
Do not use it to execute payment, override a purchase policy, infer missing line
items, or force a match from incomplete evidence. If the invoice, purchase order,
or goods receipt lacks the facts needed to support a match, the skill refuses and
routes the issue into exceptions[].
Procedure
- Require typed inputs
invoice,po,goods_receipt, andpolicy. - Extract invoice number, vendor, PO number, total, currency, and line items from explicit invoice fields.
- Extract PO number, vendor, currency, and ordered line items from the purchase order.
- Extract receipt number, PO number, and received line quantities from the goods receipt.
- Compare invoice PO number, receipt PO number, vendor, currency, line quantity, unit price, and received quantity.
- Compare invoice total with
policy.auto_approve_under. - Code invoice lines into GL buckets using explicit category or description signals.
- Emit
match.status: matchedandpayment_proposalonly when every comparison passes. - Emit
match.status: exception, nameddiscrepancies, andexceptions[]with no proposal when any required fact is missing or any comparison fails.
Output
The runner emits runx.invoice_three_way_match.v1 with:
summary: short decision summary.extracted: invoice facts used for the decision.match:{ status, discrepancies }.gl_coding: account allocations derived from the invoice lines.payment_proposal: gated proposal forsettle-invoicewhen matched.exceptions: explicit reasons that block payment approval.
Example
runx skill ./skills/invoice-three-way-match \
--input-json invoice='{"invoice_number":"INV-2026-0101","vendor":"Northwind Software","po_number":"PO-2026-044","receipt_number":"GR-2026-044","currency":"USD","total":1800,"line_items":[{"sku":"SAAS-SEATS","description":"Platform seats","category":"software","quantity":3,"unit_price":600,"amount":1800}]}' \
--input-json po='{"po_number":"PO-2026-044","vendor":"Northwind Software","currency":"USD","line_items":[{"sku":"SAAS-SEATS","description":"Platform seats","category":"software","quantity":3,"unit_price":600,"amount":1800}]}' \
--input-json goods_receipt='{"receipt_number":"GR-2026-044","po_number":"PO-2026-044","vendor":"Northwind Software","line_items":[{"sku":"SAAS-SEATS","description":"Platform seats","quantity_received":3}]}' \
--input-json policy='{"auto_approve_under":2500}' \
--jsonInputs
invoice(required): object with invoice reference, vendor, PO number, total, currency, and explicit line items.po(required): object with PO number, vendor, currency, and ordered line items.goods_receipt(required): object with receipt reference, PO number, and received line quantities.policy(required): object withauto_approve_under, expressed in the same units and currency asinvoice.total.
Published execution profile
The execution profile published with sha-690241fbf4af, shown as its exact bytes.
| Runner |
|
|---|---|
| Profile digest | sha256:7e49fb18423622016440694706b77c6275e664530565d31d25315e9436cd47a1 |
skill: invoice-three-way-match
version: 0.1.1
catalog:
kind: skill
audience: public
visibility: public
role: canonical
category: payments
runners:
decide:
default: true
inputs:
invoice:
type: json
required: true
description: Invoice object with invoice number, vendor, PO number, total, currency, and line items.
po:
type: json
required: true
description: Purchase order object with vendor, currency, PO number, and ordered line items.
goods_receipt:
type: json
required: true
description: Goods receipt object with PO number, receipt reference, and received line quantities.
policy:
type: json
required: true
description: Matching policy with auto_approve_under threshold in invoice currency units.
steps:
- id: decide
tool:
command: node
args:
- run.mjs
inputs:
invoice: $input.invoice
po: $input.po
goods_receipt: $input.goods_receipt
policy: $input.policy
artifacts:
wrap_as: invoice_three_way_match_decision
harness:
cases:
- name: matched-invoice-under-threshold-yields-proposal
inputs:
invoice:
invoice_number: INV-2026-0101
vendor: Northwind Software
po_number: PO-2026-044
receipt_number: GR-2026-044
currency: USD
total: 1800
line_items:
- sku: SAAS-SEATS
description: Platform seats
category: software
quantity: 3
unit_price: 600
amount: 1800
po:
po_number: PO-2026-044
vendor: Northwind Software
currency: USD
line_items:
- sku: SAAS-SEATS
description: Platform seats
category: software
quantity: 3
unit_price: 600
amount: 1800
goods_receipt:
receipt_number: GR-2026-044
po_number: PO-2026-044
vendor: Northwind Software
line_items:
- sku: SAAS-SEATS
description: Platform seats
quantity_received: 3
policy:
auto_approve_under: 2500
expect:
status: sealed
receipt:
schema: runx.receipt.v1
operator_journeys:
- mode: standalone
confusors:
- settle-invoice
- purchase-approval
request: Match this invoice against its purchase order and goods receipt.
expected_outcome: Return coded GL lines and a gated payment proposal only when the evidence matches policy.
- mode: composed
request: Continue this invoice-three-way-match work from evidence already gathered upstream.
expected_outcome: Return coded GL lines and a gated payment proposal only when the evidence matches policy.
prior_evidence:
- The invoice, purchase order and goods receipt already supplied.
must_not_repeat:
- Do not pay the invoice.
- name: unmatched-receipt-refuses-with-exceptions
inputs:
invoice:
invoice_number: INV-2026-0102
vendor: Northwind Software
po_number: PO-2026-045
receipt_number: GR-2026-045
currency: USD
total: 3200
line_items:
- sku: SAAS-SEATS
description: Platform seats
category: software
quantity: 4
unit_price: 800
amount: 3200
po:
po_number: PO-2026-045
vendor: Northwind Software
currency: USD
line_items:
- sku: SAAS-SEATS
description: Platform seats
category: software
quantity: 4
unit_price: 800
amount: 3200
goods_receipt:
receipt_number: GR-2026-045
po_number: PO-2026-045
vendor: Northwind Software
line_items:
- sku: SAAS-SEATS
description: Platform seats
quantity_received: 2
policy:
auto_approve_under: 2500
expect:
status: failure
receipt:
schema: runx.receipt.v1
Published package and test evidence.
This exact version passed its recorded harness run: 2 checks passed · 0 failed.
Test result
| Harness result | Passed |
|---|---|
| Tested version | sha-690241fbf4af |
| Recorded result | 2 checks passed · 0 failed |
| Result source | Reported by the publisher (runx_registry_publish) |
| Suite | runx-harness |
| Test recorded | |
| Declared cases | 2 |
| Test record | Open the recorded run |
Inspect receipt references
sha256:983f8e9f4e6844a65724ca752d91ec3e4819b8556d1db22a5666f3575d49f4b7sha256:d083910829c9ecce8ae2395ebde0067cbbf64f38f769f5ab45e595cc86a82ff2Package identity
| Published revision | sha-690241fbf4af |
|---|---|
| Content digest | sha256:690241fbf4afb2cbc9327ccc62af4592da3281de3157236085a60a94fa93fe2c |
| SKILL.md digest | sha256:fa34e16c07527cd2900091c409c8d79cb42c6c2d5e47904351ae35428cb4c5f3 |
| Execution profile digest | sha256:7e49fb18423622016440694706b77c6275e664530565d31d25315e9436cd47a1 |
| Publisher identity | Unverified publisher · zdfgu113 |
| Trust tier | CommunityPublished through the registry without publisher verification. This tier is not a code assessment. |
| Attestations |
|
| Source provenance | Not published with this version |
Version history
sha-690241fbf4afViewingContent digest sha256:690241fbf4afb2cbc9327ccc62af4592da3281de3157236085a60a94fa93fe2csha-ebe75d97006cContent digest sha256:ebe75d97006cdedba0c80842f940d8717fa89408ce1525adbb83ccd210ccf1bbsha-b10cb3bd30e7Content digest sha256:b10cb3bd30e77421a73f8d305411d24174db99dda04c5120af9e4753cf32a363sha-fba70f77036bContent digest sha256:fba70f77036b181fea81483bca890cf2863bf609bff2cb4cd946d8c22efd9cdb