Inspiration

Business equipment purchasing often starts with a simple request — “set up a workstation for a new engineer†— but quickly turns into a fragmented process. Someone has to translate the request into specifications, search multiple catalogues, compare products, calculate tax and shipping, check departmental budgets, obtain approval, and finally pay. Those steps are easy to get wrong when product prices, quantities, or totals are copied between tools.

I built ProcurePilot AI to bring that workflow into one governed procurement experience. The goal is not to let an AI spend money autonomously. It is to let AI do the research and preparation while keeping prices, constraints, authorization, and payment under explicit server-side control.

What it does

ProcurePilot AI is an AI-assisted B2B equipment procurement prototype.

A requester describes what a team needs in natural language and gives a budget. The assistant searches an authoritative product catalogue, compares specifications, and proposes a package. The user can inspect the products, availability, prices, and comparison details before adding anything to the cart.

The application then reconciles the proposed cart using server-side catalogue data. It calculates the subtotal, commercial tax, shipping, and complete payable amount, and checks the total against the budget. Model-generated product IDs, prices, quantities, or totals are not trusted as payment authority.

Before an order can be created, the requester must pass a two-stage human-authorization gate. The approval ticket is HMAC-SHA256 signed, bound to the session and exact cart, expires, and can only be consumed once. PayPal checkout is initiated only after that explicit sign-off.

After checkout, the application can recover a pending order or completed receipt after a hard browser refresh. It also restores the cart, budget allocation, conversation history, and reasoning trace without issuing another capture.

How I built it

The application is built with Next.js, React, TypeScript, and Tailwind CSS. The server exposes focused API routes for procurement, catalogue access, cart validation, approval challenges, PayPal order creation and capture, session recovery, and health checks.

Google Gemini provides the live natural-language procurement experience. The model can call read-only catalogue tools such as product search, product detail lookup, comparison, and budget validation. A deterministic heuristic fallback is also available and is labelled separately so users can tell when the live model is not connected.

A key design decision is to treat the model as an assistant, not an authority. After model output is parsed, every candidate is looked up again in the server catalogue. The server checks stock and quantity and reconciles the running cart with tax and shipping before an item can appear in the final recommendations. If a proposed item would push the complete total over budget, it is rejected and the user-facing summary is generated from the verified server result rather than copied from the model.

PayPal integration

ProcurePilot AI integrates PayPal Checkout using the Orders v2 API in the PayPal Sandbox. The server creates the order after the approval ticket is consumed, the buyer approves it in the Sandbox, and the server performs the capture. The local order record is synchronized only after the successful capture response. Duplicate capture attempts return the existing receipt rather than creating another charge.

For the acceptance test, a genuine PayPal Sandbox order and capture were independently queried through the Sandbox Orders API. The completed capture was USD $1,401.84. A redacted receipt screenshot is included in the project media; order, capture, and approval identifiers are removed. This was a Sandbox test transaction, not a real-money payment.

Security and human control

The AI tools are read-only: they cannot create orders, capture payments, charge cards, or approve their own recommendations. Authoritative product pricing and cart totals are computed on the server. Approval tickets are session-bound and single-use, and missing or invalid authorization fails closed. Capture is server-side and idempotent.

The approver shown in this hackathon prototype is self-attested demonstration data, not an enterprise identity-provider or SSO integration. PayPal is configured for Sandbox, and no live-money transaction is enabled for this demonstration.

Challenges and what I learned

The hardest part was not generating recommendations; it was making the boundary between AI suggestions and financial authority explicit. A model can return a plausible package while quietly exceeding the requested budget once tax and shipping are added. I added server-side full-cart reconciliation and regression tests that deliberately make the model propose an over-budget item. The server rejects it and reports only the final verified subtotal, tax, shipping, and total.

I also worked through refresh recovery and payment idempotency. A browser reload must not lose the user's work, repeat an approval, or trigger a second capture. That required separating client-session restoration from server-authoritative order and receipt recovery.

This project taught me that agentic commerce needs more than tool calling. It needs strict tool boundaries, deterministic validation, auditable approval, clear fallback states, and payment operations that remain under human control.

What's next

The current submission is a single-tenant hackathon prototype. Its runtime order and approval store is file-backed, the approver identity is self-attested, and it is not production-ready. The next steps are durable PostgreSQL-backed runtime storage, enterprise identity integration, multi-tenant controls, and a broader operational/security review.

Try the hosted demo: https://procurepilot-ai-1mcw.onrender.com/dashboard
Source code: https://github.com/syedsenterprises/ProcurePilot-AI

Built With

Share this project:

Updates

Submission history