Project Story
Inspiration
Freelancers often finish the work before they find the time to turn project notes into a clear invoice. PayPal Invoice Copilot is designed to make that step easier: describe the work, get a polished invoice draft, review it, and collect payment through PayPal Sandbox.
What It Does
The app turns a project summary into editable invoice wording, including a title, service description, payment terms, and a note to the client. The user controls the amount and can edit line items before saving. Invoices are saved in the browser, and the app is designed to mark one as paid only after PayPal confirms a completed capture for the matching amount and currency.
How It Was Built
The interface uses React, TypeScript, and Vite. An Express API handles invoice drafting through OpenAI and creates and captures orders through the PayPal Sandbox API. OpenAPI defines the API contract, with generated TypeScript hooks and validation schemas connecting the frontend and backend.
API credentials are kept on the server in environment secrets, rather than exposed in browser code. Invoice drafts are stored in browser local storage so the demo doesn’t require an account or shared database.
What We Learned
AI is more useful when it assists with wording while leaving financial decisions to the user. The invoice amount stays user-controlled, and generated text remains editable. We also treated payment status as a trust-sensitive feature: approving checkout is not enough to mark an invoice paid; the server must confirm the capture.
Challenges
The main challenge was connecting several parts of the flow without making payment state ambiguous: the browser loads PayPal’s checkout, the API creates the order, and the server captures it after approval. Keeping secrets server-side and showing clear setup states when integrations are unavailable were also important.
The live AI and PayPal Sandbox flows require OpenAI and PayPal Sandbox credentials. Add those credentials and verify a test payment before presenting the app as a live demo.## Inspiration
What it does
How we built it
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for PayPal Invoice Copilot
Built With
- ai
- express.js
- localstorage
- node.js
- openai-api
- openapi
- paypal
- paypal-checkout
- paypal-sandbox
- pnpm
- react
- replit
- rest-api
- tanstack-query
- typescript
- vite
- zod