Inspiration
AI agents are starting to shop for us, but nobody wants to hand an agent an open wallet. Parents want kids to buy school supplies without buying candy; team leads want assistants to order within a budget. We wanted the guardrails to live where the money moves: at PayPal checkout.
What it does
Allowance gives an AI shopping agent a PayPal-backed budget. A parent or team lead sets an allowance, a per-purchase limit and blocked categories. You describe what you need in plain language ("art supplies for school under $25"); the agent builds a cart from the catalog and explains each choice. A rules engine checks the cart against the allowance: if it fits, it is auto-approved and checked out with PayPal Orders v2 (sandbox); if it breaks a rule (over the limit, over budget, blocked category) it lists the violations and waits for human approval. A ledger tracks spend vs. allowance.
How we built it
- Node.js server (no framework) with a small HTML/CSS/JS front end.
- AI: an OpenAI-compatible chat model (default gpt-4o-mini, JSON mode) turns the request into a cart of catalog SKUs plus an explanation. Without an API key it falls back to a deterministic keyword planner, so the live demo always works.
- PayPal: OAuth2 client-credentials token, then Orders v2 POST /v2/checkout/orders with intent CAPTURE and an itemized breakdown, against api-m.sandbox.paypal.com. Credentials come only from env vars.
- Rules engine (src/rules.js) enforces per-purchase limit, total budget and blocked categories before any order is created.
- Tests with Node's built-in test runner; deployed free on Render. ## Challenges we ran into
Keeping the agent useful while making sure it can never spend outside the policy: the LLM only proposes, the rules engine decides, and PayPal only sees approved carts.
Accomplishments that we're proud of
A clear human-in-the-loop flow: the agent explains itself, violations are spelled out, and money only moves through PayPal when the policy allows it.
What we learned
Agentic commerce needs boring, deterministic guardrails around a creative model, and PayPal Orders v2 is a clean place to enforce them.
What's next for Allowance
Real merchant catalogs, PayPal Vault for saved approvals, per-child or per-employee sub-allowances, and notifications for approval requests.
Try it
- Live demo: https://allowance-bfgj.onrender.com (demo mode, may take ~30s to wake on Render free tier)
- Code (MIT): https://github.com/meerpasha59-bit/allowance
- Run locally: PAYPAL_CLIENT_ID=... PAYPAL_SECRET=... [LLM_API_KEY=...] node src/server.js ; tests: npm test. PayPal sandbox only; no real money.
Built With
- css
- html
- javascript
- node.js
- openai
- paypal
- render