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 "Tagih Budi [email protected] Rp500.000 untuk desain logo, jatuh tempo minggu depan" and PayPilot: (1) uses Google Gemini to parse the message into structured invoice data (recipient, items, amount, currency, due date — relative dates like "minggu depan" resolved correctly); (2) creates and sends the invoice through the PayPal Invoicing API v2 (sandbox); (3) returns the PayPal payment link and tracks the invoice status (SENT → PAID) in a live list. A one-click "Simulasikan Pembayaran" (mock mode) demonstrates the full payment lifecycle.

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. 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.

What's next

Live PayPal sandbox end-to-end (Invoicing permission enabled and verified); payment reminders; multi-item and recurring invoices; WhatsApp/Telegram front-ends for the same agent.

Built With

Share this project:

Updates

Submission history