PayFlow AI helps B2B sales teams check prices, discounts, and stock before they send a quote. In the demo, a $1,282.50 order crosses the $1,000 approval threshold. After the operator approves it and the buyer completes PayPal Sandbox checkout, PayFlow verifies the capture and updates physical stock from 40 to 37 cases.

Inspiration

B2B sales teams spend time translating informal buyer requests into quotes, checking inventory and discounts, and following up on payments. I built PayFlow AI to combine natural-language assistance with explicit business controls and verifiable settlement.

What it does

PayFlow AI uses Gemini to identify catalogue products and quantities in a buyer request. A deterministic n8n and PostgreSQL engine calculates prices, discounts and margins, then reserves available inventory. Quotes above the approval threshold require an explicit operator decision.

Approved quotes can generate a PayPal Sandbox Orders v2 checkout. Buyer approval and operator capture are separate steps. PayFlow verifies the order reference, amount, currency, merchant and completed capture before recording payment and deducting inventory.

The AG Studio workspace combines orders, order lines, inventory and payment operations into charts and grids with cross-filtering. It includes a custom Understanding receipts widget, a PayFlow theme and a Gemini adapter for the Studio Agent Framework. Operators can filter by confirmed PayPal capture and explore customer and product views.

How I built it

The cockpit uses Next.js, React and TypeScript. n8n orchestrates Gemini calls and PayPal Sandbox operations. PostgreSQL performs the transactional checks. The operator gateway uses sessions, origin and CSRF checks, and signed assertions. Provider credentials live in private server configuration or encrypted n8n credentials.

Challenges I ran into

Catalogue pricing, reservations, operator approval and settlement have to stay consistent across repeated requests and provider failures. PayFlow checks the capture against the persisted quote and records settlement once. When Gemini cannot produce usable output, the cockpit shows an explicit error.

Accomplishments

A fresh clone was installed on October 15 and exercised through the cockpit, n8n, PostgreSQL and PayPal Sandbox. Gemini 3.8 prepared a USD 1,282.50 quote for three cases at a 5% discount. Internal approval, buyer checkout and operator capture produced a verified COMPLETED Sandbox capture. Physical stock fell from 40 to 37 cases. A read-only replay returned the same capture without a second payment or inventory deduction.

The video shows a separate complete Sandbox run recorded on October 23 with Gemini 3 Flash Preview. The workflow calls Gemini 3.8 Flash first and falls back to Gemini 3.6 Flash. On November 11, a fresh installation verified the quote and Studio through the fallback using the dedicated evaluator key. The demonstration uses test funds.

What I learned

A commerce assistant needs explicit boundaries between a proposal, an internal decision, buyer approval and external financial evidence. Making those stages visible helps operators track each order and understand what has been verified.

What's next

Improve provider availability and simplify evaluator setup. Extend analytics while keeping confirmed PayPal receipts separately identifiable.

Existing project disclosure

PayFlow builds on a pre-existing private n8n and PostgreSQL integration workspace. Work during the hackathon included operator authentication, quote expiry and stock release, settlement safeguards, the guided English cockpit, AG Studio and Gemini integration, standalone installation and the demo video. The standalone repository contains the PayFlow source. This is a solo entry.

Built With

Share this project:

Updates

Submission history