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-fba70f77036b. 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.

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

  1. Require typed inputs invoice, po, goods_receipt, and policy.
  2. Extract invoice number, vendor, PO number, total, currency, and line items from explicit invoice fields.
  3. Extract PO number, vendor, currency, and ordered line items from the purchase order.
  4. Extract receipt number, PO number, and received line quantities from the goods receipt.
  5. Compare invoice PO number, receipt PO number, vendor, currency, line quantity, unit price, and received quantity.
  6. Compare invoice total with policy.auto_approve_under.
  7. Code invoice lines into GL buckets using explicit category or description signals.
  8. Emit match.status: matched and payment_proposal only when every comparison passes.
  9. Emit match.status: exception, named discrepancies, and exceptions[] 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 for settle-invoice when matched.
  • exceptions: explicit reasons that block payment approval.

Example

bash
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}' \
  --json

Inputs

  • 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 with auto_approve_under, expressed in the same units and currency as invoice.total.

Published execution profile

The execution profile published with sha-fba70f77036b, shown as its exact bytes.

Runner
  • decide
Profile digestsha256:46b5d1a5147b8d723118ccf9a5741b439f2b4216bb4980643de553ba0aae4c5a
skill: invoice-three-way-match
version: 0.1.0
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.

The latest recorded test covers an earlier version, sha-690241fbf4af. It does not establish a result for this version.

Test result

Harness resultAn earlier version was tested
Tested versionsha-690241fbf4afNot this page’s version, sha-fba70f77036b
Recorded result2 checks passed · 0 failed
Result sourceReported by the publisher (runx_registry_publish)
Suiterunx-harness
Test recorded
Declared cases2

Package identity

Published revisionsha-fba70f77036b
Content digestsha256:fba70f77036b181fea81483bca890cf2863bf609bff2cb4cd946d8c22efd9cdb
SKILL.md digestsha256:fa34e16c07527cd2900091c409c8d79cb42c6c2d5e47904351ae35428cb4c5f3
Execution profile digestsha256:46b5d1a5147b8d723118ccf9a5741b439f2b4216bb4980643de553ba0aae4c5a
Publisher identityUnverified publisher · zdfgu113
Trust tierCommunityPublished through the registry without publisher verification. This tier is not a code assessment.
Attestations
  • Publisher · Declaredzdfgu113 · 13 Oct 2026
Source provenanceNot published with this version

Version history

  1. sha-690241fbf4afContent digest sha256:690241fbf4afb2cbc9327ccc62af4592da3281de3157236085a60a94fa93fe2c
  2. sha-ebe75d97006cContent digest sha256:ebe75d97006cdedba0c80842f940d8717fa89408ce1525adbb83ccd210ccf1bb
  3. sha-b10cb3bd30e7Content digest sha256:b10cb3bd30e77421a73f8d305411d24174db99dda04c5120af9e4753cf32a363
  4. sha-fba70f77036bViewingContent digest sha256:fba70f77036b181fea81483bca890cf2863bf609bff2cb4cd946d8c22efd9cdb