Inspiration

Freelancers and small shops in emerging markets run their business on chat, but billing still means logging into dashboards and filling in forms. Invoices go out late, reminders never go out, and cash flow suffers. We wanted billing to be as fast as sending a message, in Arabic or English.

What it does

ENSIDEX Invoice Agent is a bilingual chat assistant on top of the PayPal developer platform (demoed in the PayPal sandbox; no real customer payments):

  • "Bill Ahmed Ali $300 for logo design due Friday" creates a PayPal invoice (Invoicing API v2) and resolves "Friday" to a real due date. If the client's email is provided, PayPal sends the invoice; otherwise the agent returns a shareable payer link.
  • Arabic works the same way: "سو فاتورة لسارة 500 ريال عن تصميم موقع تستحق الخميس" creates an invoice due Thursday. In the demo, SAR 500 is converted to USD 133.33 at the fixed 3.75 peg rather than issued natively in SAR.
  • "Payment link $49 for a consultation call" returns a PayPal checkout link (Orders API v2).
  • "Remind INV2-…" sends a PayPal reminder when the invoice has a recipient email. "Status of …" returns its current status.
  • "Summarize my unpaid invoices" groups outstanding invoices, totals them, flags overdue ones and suggests who to nudge.

How we built it

  • Backend: Hono on Node 22 (TypeScript), running an LLM tool-calling loop through OpenRouter with six PayPal tools.
  • PayPal: OAuth2 client credentials, Invoicing v2 (generate-next-invoice-number, create, send, remind, get, list) and Orders v2, in sandbox.
  • Frontend: React 19 + Vite, an RTL-aware chat UI with invoice and payment-link cards.
  • Resilience: a deterministic bilingual parser and an in-memory PayPal mock, so the app runs and tests pass with no credentials. The hosted preview uses this offline mock.
  • Deployment: a single Docker image, MIT-licensed.

Challenges

  • Turning relative dates in two languages ("Friday", "الخميس", "بكرة") into exact due dates. We give the model a 7-day calendar table and keep a rule-based fallback.
  • Keeping the agent decisive: it acts when the client, amount and purpose are present, and asks one short question when something essential is missing.

Accomplishments

A bilingual flow from one sentence to a PayPal sandbox invoice or payer link, plus reminders, summaries and payment links, with tests covering both the LLM path and the offline path.

What we learned

Tool calling plus a narrow, well-typed API like PayPal Invoicing makes agents reliable. Most of the remaining difficulty is in language: dates, currencies and names.

What's next

A real WhatsApp Business API channel, native multi-currency invoices, recurring invoices, webhook-driven "paid" notifications, and tax lines.

Built With

Share this project:

Updates

Submission history