Inspiration

Small-business owners often lose leads because they cannot instantly see a price for a website project. I wanted a lightweight chat that could ask a few qualifying questions, build an itemized quote, and let the visitor start the work with a 30% deposit — without me running my own servers.

I started building QuotePal on November 3, 2026, as a solo project for the PayPal AI Hackathon.

What it does

QuotePal is a chat widget for a small-business site. A visitor describes the website they need. The assistant returns an itemized quote from a fixed price list, then offers a 30% PayPal deposit in the same thread. The remaining 70% is invoiced through PayPal at delivery.

The live sandbox demo is https://quotepal.pages.dev. The page is a pretend shop called Demo Studio. The top banner reads: “QuotePal demo: AI quotes → PayPal deposits → balance invoices · Sandbox only, no real money.” The chat header is “Demo Studio · Get an instant quote,” with the tag “Powered by QuotePal.”

The public price list includes Landing page $150, Business website $350, and Website redesign $120, plus add-ons such as Basic SEO setup $60. The canonical demo quote is Business website $350 + Basic SEO setup $60 = $410. Due now: 30% deposit $123. Remaining 70%, invoiced at delivery: $287. The quote card is tagged “Sandbox demo · no real money.” The button reads “Pay 30% deposit · $123.00 with PayPal.” Under it: “What happens next: pay $123.00 now to start. The remaining $287.00 (70%) is invoiced via PayPal at delivery.”

After the buyer returns from PayPal, the chat shows “Deposit received ✓.” A balance invoice for the remaining 70% is created through the PayPal Invoicing API. In the filmed sandbox run, quote Q-84F09E87 took a $123.00 deposit and invoice INV2-7S85-BTQ3-A97V-5G6U for $287.00 was created automatically.

The LLM never computes money. It only chooses which tool to call. build_quote reads a deterministic TypeScript price table. create_deposit_order creates a PayPal Orders v2 sandbox order and returns an approve link.

A merchant dashboard, a PAYMENT.CAPTURE.COMPLETED webhook, and the PayPal Agent Toolkit are stretch goals. They are not built.

How we built it

  • Front end: plain HTML, CSS, and widget.js on Cloudflare Pages. No framework.
  • Back end: one Cloudflare Worker in TypeScript. Routes: POST /api/chat, /api/deposit, /api/capture, /api/invoice, and GET /api/health.
  • LLM: GLM glm-4-flash by default; an OpenRouter free model can be swapped in via config (LLM_PROVIDER=openrouter). There is no automatic model fallback. Switching providers is a config change.
  • Pricing lives in pricing.ts, so the model cannot invent numbers.
  • Payments: direct REST calls to the PayPal sandbox — Orders v2 for the deposit, Invoicing v2 for the 70% balance invoice. No PayPal SDK and no @paypal/agent-toolkit in the repo.
  • State: a Cloudflare Workers KV namespace, QUOTES, stores quote_id → { details, order_id, status, … }. After capture, payment status is confirmed against PayPal, not only against KV.
  • Secrets stay in .dev.vars locally and in Wrangler secrets in the preview deploy. They are not in the repo.
  • Tests: Vitest unit tests for pricing, capture, invoice, and intent, plus Playwright end-to-end scripts for the widget.
  • License: MIT. Source: https://github.com/hjlangcore/quotepal.

Challenges we ran into

Free function-calling models can return messy tool calls, so the Worker uses strict tool schemas and defensive parsing. If the model skips build_quote, a small intent parser can still assemble a quote from the visitor's words. That is not an automatic switch to another LLM. Changing the model provider is a config change only.

It is not verified whether the PayPal Agent Toolkit runs in the Workers runtime, so the app uses direct REST.

Deposit order creation needs to be idempotent, so a visitor cannot accidentally open two deposits for the same quote. The Worker already rejects a second attempt after the deposit is captured. Reusing an unpaid order is still on the harden list.

The build window was about nine days. A merchant dashboard and webhook signature verification stayed stretch goals.

Accomplishments that we're proud of

  • A clean split that is actually in the code: the LLM only orchestrates, and pricing.ts computes every dollar amount.
  • A live sandbox preview of the path from chat to an itemized quote to a PayPal deposit button.
  • A 70% balance invoice created automatically after the deposit, filmed end to end in sandbox (quote Q-84F09E87, invoice INV2-7S85-BTQ3-A97V-5G6U).
  • A serverless stack — Pages, Workers, and KV — that stays small enough for a solo prototype.
  • Automated tests covering pricing, capture, invoicing, and intent.

What we learned

Function calling on these models needs strict tool schemas and defensive parsing. Do not assume the model will call the right tool every time.

The PayPal sandbox lets me build and test the deposit and invoice path without moving real money.

Cloudflare KV is fine for quote state in a prototype. Payment status should still be confirmed against PayPal itself.

A small, framework-free widget is easier to embed on a small-business site.

What's next

  1. Harden the build_quote / create_deposit_order contract with more automated tests.
  2. Pilot the same deposit → auto-invoice flow with a live PayPal account for one real small business.
  3. Build a read-only merchant dashboard on a second Worker route, protected by a simple API key. (Stretch.)
  4. Add the optional PAYMENT.CAPTURE.COMPLETED webhook, verified with PayPal's signature verification API. (Stretch.)
  5. Evaluate @paypal/agent-toolkit. If it is incompatible with Workers, keep the direct REST calls.
  6. Collect feedback on the open repo (https://github.com/hjlangcore/quotepal) and the demo video before any production rollout.

Built With

Share this project:

Updates

Submission history