Inspiration

Freelancers and small agencies lose hours every week on money admin: setting up projects, splitting work into payment milestones, creating invoices, chasing late payers and paying collaborators. The tools exist, but they're clicks spread across dashboards. We wanted to just say what we need, and still stay fully in control of every dollar.

What it does

PayPal Autopilot is an AI finance copilot built on the PayPal Sandbox.

  • Plain-English planning: type "Create a $3,000 project called Website Redesign with three payment milestones for Acme" and the AI drafts a step-by-step plan (project + 3 × $1,000 milestones).
  • Nothing runs until you confirm: every plan is validated server-side and shown as a preview first. Money and messages always wait for approval.
  • Real PayPal sandbox calls: invoices are created through PayPal Invoicing v2 and return real sandbox invoice IDs (INV2-…).
  • Payout approvals: payouts are prepared and routed to an approval queue. Real payout execution is off by default as a deliberate safety gate.
  • Audit log: every action is recorded with its PayPal reference.
  • PayPal diagnostics: Settings shows sandbox environment, credentials, auth and invoicing health.

How we built it

  • Frontend: Next.js + TypeScript, deployed on Netlify.
  • Backend: FastAPI (Python 3.13), PostgreSQL, Redis and Celery workers, deployed on Render.
  • PayPal: a custom REST client for OAuth2, Invoicing v2, Orders v2, Payouts v1 and Webhooks (sandbox).
  • AI: a provider cascade (Groq → Gemini → OpenAI) with a rule-based fallback, so planning never hard-fails.
  • Safety layer: the LLM only proposes; the server owns identities, amounts, currency and policy. Plans are sanitized against an allowlist, checked for prompt injection, and money steps must match the user's instruction.
  • Tests: 178 automated tests with PayPal mocked.

Challenges we ran into

  • Different LLMs return different plan shapes. Some nested milestones, some left out currency or the project amount. We built a normalization + validation layer so every provider produces the same strict, safe plan.
  • Multi-step plans: linking milestones to the project created in the same run without trusting IDs from the model.
  • Balancing autonomy with safety: making the agent useful while guaranteeing it can't move money without a human.

Accomplishments that we're proud of

  • End-to-end: one sentence → confirmed plan → project + milestones → real PayPal sandbox invoice.
  • A safety-first design where the AI can never skip approval or invent identities.
  • A provider-agnostic AI layer with graceful fallback.

What we learned

  • LLM output must be treated as untrusted input. Validation matters more than prompting.
  • Human-in-the-loop UX (preview → confirm) builds trust for financial actions.
  • The PayPal Invoicing, Orders and Payouts APIs in depth.

What's next for PayPal Autopilot

  • One-click draft invoice from a milestone.
  • Automatic reminders for overdue invoices (with approval).
  • Webhook-driven status sync (paid → milestone complete → payout ready).
  • Multi-currency support and team roles.

Built With

Share this project:

Updates

Submission history