Inspiration
Creating invoices manually is repetitive and easy to get wrong. I wanted to test whether a natural-language interface could make PayPal invoicing simpler: describe the work once, review the details, and create a Sandbox invoice without filling in every field manually.
What it does
PayFlow Copilot turns a plain-English request into a PayPal Sandbox invoice. A user can write something like: “Create a 25 USD invoice for Test Customer at [email protected] for website testing, due in 7 days.” The app extracts the customer name, email, amount, currency, description, and due date. The user reviews and confirms the details before PayPal is contacted. After confirmation, it creates and sends the invoice through the PayPal Agent Toolkit, returns the invoice ID and status, and records the attempt in SQLite. The user can then verify the recipient, amount, currency, and due date in PayPal Sandbox.
How we built it
I built the interface with Streamlit and used Groq as the primary AI model for extracting invoice details from natural language, with Gemini as a fallback. The PayPal Agent Toolkit handles PayPal Sandbox invoice creation and sending. The app stores invoice activity in SQLite, including the action, result, invoice ID, and original request. I also added persistent Streamlit session state so the confirmation flow and chat history remain stable across reruns.
Challenges we ran into
One challenge was Streamlit reruns resetting the interface and losing the pending invoice details. I solved this by persisting the chat and pending invoice in st.session_state. Another challenge was handling PayPal’s nested API response correctly. I also had to prevent duplicate sends after the toolkit began creating and sending invoices in one action, which previously caused an INVOICE_ALREADY_SENT error.
Accomplishments that we're proud of
I’m proud that the complete workflow works end to end: a plain-English request becomes a confirmed PayPal Sandbox invoice, with the invoice ID, status, and due date visible in PayPal Sandbox. The app also keeps a useful activity history without exposing credentials or private data.
What we learned
I learned that AI output should always be reviewed before taking an external action. I also learned that Streamlit reruns can affect application state, PayPal responses can be nested, and a “sent” status does not necessarily prove that an email was delivered or paid.
What's next for PAYFLOW COPILOT
Next, I want to add invoice templates, recurring invoices, better multi-currency support, downloadable activity reports, and clearer error messages when AI extraction is incomplete. I would also explore a hosted demo so judges can try the app without setting it up locally.