Inspiration

Small businesses don’t struggle to click “Pay.” They struggle to know whether the invoice, the supplier, the payment details and the money all match.

A supplier says an invoice is still unpaid. Another changes their payment email. The same invoice arrives twice from different inboxes. Durin helps a merchant review those records before money moves.

The name comes from the Doors of Durin, which open only for the right word. In Durin, an email or a confident AI answer can’t authorize a payment. A payment is proposed only when the evidence supports it and the merchant’s rules allow it. A person must approve it.

What it does

Durin turns a folder of invoices and emails into a reviewable payment batch:

  1. Records the evidence. Each source is hashed and listed so the merchant can see what entered the process.
  2. Extracts invoice details. OpenAI fills a strict schema and provides an exact source excerpt for every field. Unsupported values are flagged for review.
  3. Surfaces conflicts. If sources disagree, Durin shows the competing values side by side for a person to resolve.
  4. Checks the merchant’s rules. A deterministic engine checks for duplicate invoice numbers, approved recipients, payment and batch limits, supplier identity across sources, and price history.
  5. Seals the proposal. Eligible items and their total are serialized and sealed with a SHA-256 digest.
  6. Requires human approval. The merchant signs that digest with a keyed signature and an expiry. Any change, even one cent, invalidates the signature.
  7. Sends and reconciles through PayPal. Durin creates a PayPal Payouts batch only after approval, then reconciles each item against PayPal’s response. The digest also makes the payout idempotent.

Each invoice receives a clear status: Ready (evidence-backed and within policy, awaiting approval), Excluded (such as a duplicate, unapproved recipient, limit breach, or contradiction), or Needs review (for example, an uncited value or unreadable source).

Durin also helps answer “Did we already pay them?” through a chat over the merchant’s PayPal transaction history. The model interprets the question; PayPal’s Transaction Search API provides the results; the model explains only what those results show.

How we built it

  • PayPal Developer Platform: Payouts API for approved supplier payments and Transaction Search API for payment history. Search requests are split into PayPal’s 31-day windows. We exercised the flow end to end with sandbox merchant and personal accounts, including a sandbox payout reconciled item by item in the demo.
  • OpenAI: Structured extraction with source excerpts, plus query interpretation and explanations for transaction search. The model proposes and explains; it does not authorize or decide.
  • Python deterministic core: Canonical serialization, SHA-256 proposal seals, HMAC authorization with expiry, durable authorization and extraction ledgers, bounded MCP read and compare tools, and tests for each module.
  • Merchant interface: A Next.js frontend that holds no credentials and communicates only with the Python API. It provides a batch journey, a decision summary with one next step, dashboard counts linked to their underlying filters, CSV and PDF export, and English and Spanish.

The design rule is simple: AI reads and explains; deterministic checks and human approval govern payment. Changing the model can change the wording, but not the verdict, seal, or evidence trail.

Accomplishments we’re proud of

We completed a sandbox payout journey using a real invoice: the model extracted and cited its fields, the engine checked it against policy, a person signed the proposal, and Durin reconciled PayPal’s response item by item.

We’re also proud that exceptions stay visible and understandable throughout the interface, and that the boundary between AI assistance and payment authority is enforced by the architecture.

Additional note for the judges

One feature I didn't manage to demonstrate in the video is Durin's integrated LLM-powered chat interface.

The application includes an interactive AI chat experience alongside its evidence-driven payment workflow. I encourage you to explore this feature when reviewing the project.

The LLM assists users, but it does not replace deterministic validation, merchant-defined rules, or human authorization.

What we learned

A language model can be useful throughout a payment workflow without controlling it. Keeping the model responsible for reading and explaining—and leaving decisions to verifiable rules and human approval—took architectural work, but made the system easier to inspect and test.

What’s next for Durin

We plan to extend the same review flow to receivables; let contract terms such as discounts, penalties, and partial payments inform merchant policies; and generate period reports that connect each figure to its source and PayPal operation.


Links for the form

Built With

Share this project:

Updates

Submission history