InvoiceGate checks a purchase order, invoice, and delivery record before a person creates a PayPal Sandbox order. A local Qwen3 model running through Ollama extracts line items and charges with exact source quotes. The server treats that output as untrusted: it verifies every quote, recalculates money in integer minor units, and compares currencies, quantities, unit prices, charges, and accepted delivery.
The reviewer sees each invoice line beside its purchase-order and delivery evidence in AG Grid Community. If the model aligned a line incorrectly, the reviewer can correct the mapping. InvoiceGate then issues a new report digest so the later approval remains bound to the evidence that was actually reviewed.
A model decision can never authorize payment. A clear report still requires an exact APPROVE … phrase before the server may create a Sandbox order. Buyer approval happens on PayPal's Sandbox site, and capture requires a separate CAPTURE … phrase. Blocked, expired, fixture, or incomplete analyses cannot reach either payment action. The PayPal client accepts only Sandbox API and checkout origins.
The application uses React and Vite in the browser, with an Express and Zod server boundary for local-model calls, report state, and PayPal credentials. PDF.js reads text-based PDFs. The three source documents stay on the machine and are sent only to a loopback Ollama endpoint. The current prototype supports USD, EUR, GBP, and JPY and keeps short-lived reports in memory.
The automated suite covers exact money arithmetic, grounded and ungrounded model output, higher invoice prices, corrected mappings, Sandbox-only requests, report binding, live-analysis provenance, and both confirmation gates. A separate evaluation command runs the configured local model against matching and price-mismatch samples.
Current limits are deliberate: the prototype does not connect to production PayPal endpoints, does not process scans without a text layer, and does not persist documents or reports. A completed Sandbox capture is test data, not a real payment.
Built With
- ag-grid-community
- express.js
- node.js
- ollama
- paypal
- paypal-orders-api
- pdf.js
- qwen3
- react
- vite
- zod
Log in or sign up for Devpost to join the conversation.