Tagline: From stockout signals to a reviewed restock cart and PayPal sandbox checkout.
Inspiration
Small shops balance two competing problems: running out of popular products and tying up limited cash in slow-moving stock. We wanted to connect an understandable purchasing recommendation to an actual payment flow while keeping the shop owner in control.
What it does
RestockPilot uses a café’s inventory, fourteen daily sales counts, supplier lead times, a demand scenario, and a restocking budget. It shows which products may run out before a delivery arrives, asks ChatGPT to rank the known products and explain tradeoffs, and calculates a bounded purchase plan. The owner edits quantities and reviews the exact total before creating a PayPal sandbox order.
Buyer approval takes place on PayPal. RestockPilot then refreshes the authenticated order status and exposes an explicit capture action. An order is marked paid only after PayPal reports a completed capture with the expected order reference, USD currency, and amount. A timestamped activity trail makes the sequence visible.
How we built it
The application runs locally on Node.js with a dependency-free HTML, CSS, and JavaScript interface. A small domain module handles weighted sales averages, stock coverage, top-up targets, and budget allocation. ChatGPT supplies structured priorities and explanations through its documented plan-sharing integration. Known-SKU validation and server-calculated prices keep the model out of payment authority.
PayPal’s Orders v2 API provides order creation, buyer approval, authenticated lookup, and capture. Each plan has at most one saved order. Stable request identifiers, serialized mutations, and persisted uncertain states protect against accidental duplicate operations when a request is repeated or interrupted.
Challenges
Forecasts are uncertain, and an attractive recommendation can still exceed a real budget. We separated AI ranking from deterministic spending limits and make the preview’s lack of AI explicit. We also distinguish buyer approval from confirmed payment: returning from checkout is insufficient evidence that a payment completed.
What we learned
A useful AI purchasing assistant needs explainable assumptions, editable quantities, and a clear approval boundary. A payment integration needs durable state and reconciliation, especially when a network response does not arrive.
What’s next
Connect real sales data and supplier catalogs, evaluate forecasts against historical stockouts, introduce delivery and tax calculations, and add authenticated multi-user operation with transactional storage and verified PayPal webhooks.
Accurate demo disclosure
This prototype uses six synthetic café products and sandbox payments; no physical goods are shipped. Its allocation method is a transparent round-robin heuristic, not an optimal procurement solver. Authentication and streaming utilities are adapted from ScopePay; the retail workflow, forecasting, purchasing interface, and PayPal Orders integration are new. Production deployment, real suppliers, and automated replenishment are future work.
Verified results
21 automated tests pass. A real ChatGPT plan prioritized a $200 budget against $771 in full replenishment targets. A reviewed $2.50 sandbox order was approved and captured, then independently verified against the expected reference, USD currency and amount.



Reproducible comparison and evaluation
We compared a recorded real AI plan with a deterministic stock-cover-minus-lead-time ranking using identical inventory, budget and allocation logic. Three of six quantities differed; both plans spent $200. This single synthetic scenario does not establish better outcomes or savings. Run npm run evaluate to reproduce the comparison and limitations.
The revised narrated video captures a fresh AI request, quantity editing and an over-budget checkout block. The final section refreshes the earlier verified $2.50 sandbox purchase; it does not show a new approval or capture.
Setup is now npm ci, npm run setup, then npm start. A café operator test protocol is ready. No user trials or commercial savings are claimed.
Built With
- chatgpt
- css3
- html5
- javascript
- node.js
- openai
- paypal
Log in or sign up for Devpost to join the conversation.