Inspiration
Small freelancers and sellers lose time (and money) to invoicing: open a dashboard, fill a form, copy a link, chase the payment. We asked: what if sending an invoice was as easy as sending a chat message?
What it does
PayPilot is an AI chat agent that turns a plain-language request — in Indonesian or English — into a real PayPal invoice with a shareable payment link. Type "Invoice Sarah [email protected] $120 for consulting, due Friday" and PayPilot: (1) uses Google Gemini to parse the message into structured invoice data (recipient, items, amount, currency, due date — relative dates like "next week" resolved correctly); (2) creates and sends the invoice through the PayPal Invoicing API v2 (sandbox); (3) returns the PayPal payment link and shows the invoice status (SENT) in a live list. The demo video shows this live sandbox flow end to end. A one-click "Simulasikan Pembayaran" (mock mode) demonstrates the full payment lifecycle, including the simulated PAID step.
How we built it
Node.js + Express backend, vanilla HTML/CSS/JS frontend (no build step). Gemini is called via the REST API (gemini-3.6-flash, JSON mode, temperature 0.2) with a prompt that encodes Indonesian amount rules ("500 ribu" = 500000 IDR, "1,5 juta" = 1500000) and relative-date resolution. PayPal is integrated via OAuth2 client-credentials + Invoicing API v2 (create draft → send → get status + payer-view link). The app ships a clearly-labeled mock mode so the whole flow works end-to-end with zero credentials, and switches to the real sandbox automatically when credentials are configured.
Challenges we ran into
The PayPal sandbox app's credentials validated fine for OAuth, but invoice calls returned 403 NOT_AUTHORIZED — the app's token carried payments scopes but no invoicing scope, so the Invoicing permission had to be enabled on the app in the Developer Dashboard, and the change took time to propagate to API tokens. We made the app surface that exact error in the chat instead of crashing, and kept mock mode as a fully working fallback. We also learned the Gemini free tier rate-limits bursts, so the demo paces its AI calls. Note: PayPal Invoicing does not accept IDR, so the live demo uses USD.
What's next
Live PayPal sandbox end-to-end is verified (Invoicing permission enabled, real invoice sent); payment reminders; multi-item and recurring invoices; WhatsApp/Telegram front-ends for the same agent.
Built With
- express.js
- google-gemini-api
- html
- javascript
- node.js
- paypal-invoicing-api-v2