Inspiration

I work as a freelancer, and every month I lose hours writing invoices and chasing clients who forget to pay. Like most freelancers, I run my business from my phone and a chat app, not from accounting software. I wanted getting paid to be as easy as sending a voice note.

What it does

Cobra is a Telegram assistant that bills and collects for you with PayPal. You send it a voice note or a text such as "Bill Laura Smith 350 euros for the logo design, due in 15 days". Cobra shows you the invoice, and after one tap it creates and sends a real PayPal invoice to your client. From then on it works on its own. It tells you the moment you are paid, lists who still owes you, writes a polite reminder that you approve before PayPal sends it, and makes a PayPal QR code for getting paid in person. Every hour it checks for overdue invoices and for payments whose notification never arrived. All your invoices live in a dashboard inside Telegram, built with AG Grid, where you can filter, search and send yourself a CSV for your accountant. It answers in English or Spanish, whichever you speak. Nothing reaches a client without your tap.

How I built it

Cobra runs on Cloudflare Workers with a D1 database. Workers AI does the listening and understanding: Whisper turns the voice note into text and Llama 3.3 turns that text into invoice data, applies corrections and writes the reminders. I validate everything the AI returns, so amounts become exact cents, emails are checked, and spoken addresses like "laura at example dot com" become real ones. On the PayPal side it uses OAuth, the Invoicing API to create, send, remind, record payments and generate QR codes, and webhooks whose signatures are verified with PayPal before anything is trusted. The dashboard is a Telegram Mini App that only shows your own invoices, because every request is checked against Telegram's signed login data. There are 21 automated tests that run against a fake PayPal and a fake Telegram.

Challenges

The hardest part was letting an AI near money safely. The AI only prepares drafts and reminder texts, and every action that touches a client needs a human tap. Reliability mattered just as much. Invoice creation is idempotent, so a retry can never bill twice. Webhooks are verified and deduplicated, and if one arrives late or never arrives, the hourly check and the "who owes me" list ask PayPal for the real status. I also kept it free to run, with a daily limit on AI usage.

What I am proud of

The whole loop works end to end on the PayPal sandbox, from a voice note to a paid invoice, inside an app people already open every day.

What I learned

How much of PayPal's invoicing can be driven from a simple conversation, and how important it is to design the moments where a person decides before designing the moments where the AI acts.

What's next

Letting each freelancer connect their own PayPal account, recurring invoices, and more languages.

Built With

  • ag-grid
  • cloudflare-d1
  • cloudflare-workers
  • llama
  • paypal
  • telegram
  • telegram-mini-apps
  • whisper
  • workers-ai
Share this project:

Updates

Submission history