Skip to main content
Loading navigation
Back to prompt library

Implementation brief

Linked challenge: Build a Purchase-to-Payment Invoice Reconciliation Agent

Prompt source

Build the complete application80 lines11 sectionsNo variables1 code block
## Who Uses It
An accounts payable team reviewing invoices before payment approval.

## What You Will Build
Build an agent that reads invoices, matches purchase orders and receipts, calculates discrepancies, and creates a finance review queue. Reviewers must see the source records and approve any proposed next step.

## Inputs
- Invoice records
- Purchase orders
- Goods receipts and matching tolerances

## Workflow
1. Extract and normalize invoice lines.
2. Match each line to its purchase order and receipt.
3. Calculate price, quantity, and duplicate exceptions.
4. Prepare matched cases and exception cases for finance review.

## Interface
An invoice inbox with a three-way comparison, highlighted differences, evidence links, and reviewer decisions.

## Working Demo
Show I1 as matched for 50 and I2 as an exception for four unreceived units worth 32. Request finance review.

## Deliverables
- A working local application with the specified review interface.
- Source code, dependency lockfile, and setup commands.
- A recorded end-to-end demo using the supplied starter data.
- Example outputs, action logs, and automated tests.

## Starter Data
These fictional records are a small development fixture, not a production dataset. Implement the mock services described in the brief.

```json
{
  "invoices": [
    {
      "id": "I1",
      "po_id": "P1",
      "item": "Cable",
      "quantity": 10,
      "unit_price": 5
    },
    {
      "id": "I2",
      "po_id": "P2",
      "item": "Adapter",
      "quantity": 10,
      "unit_price": 8
    }
  ],
  "purchase_orders": [
    {
      "id": "P1",
      "item": "Cable",
      "quantity": 10,
      "unit_price": 5
    },
    {
      "id": "P2",
      "item": "Adapter",
      "quantity": 10,
      "unit_price": 8
    }
  ],
  "receipts": [
    {
      "po_id": "P1",
      "quantity": 10
    },
    {
      "po_id": "P2",
      "quantity": 6
    }
  ],
  "policy": {
    "quantity_tolerance": 0
  }
}
```

## Constraints
Use synthetic finance data. Prepare recommendations only and do not execute payments.
Choose an available model that supports your implementation. Record its identifier and version.

## Evaluation
Review the complete application, not only the starter-case answers.
- Each invoice links to the correct order and receipt.
- I2 shows a quantity difference of four and value difference of 32.
- No payment is sent or marked approved automatically.
Add one normal case, one incomplete-input case, and one failure-recovery case.