Inspiration

If you've ever run a small online shop, you know the feeling: a return request lands in your inbox and your heart sinks a little. You have to read the message, dig up the order, check the dates against your policy, wonder if something's off, and then go issue the refund by hand. For a small seller, that time adds up fast.

I wanted to give that time back. ReturnPilot AI does the slow thinking for you, so you can spend your energy on your customers and your business instead.

What it does

ReturnPilot AI is a returns copilot that makes every refund decision faster, fairer, and easier to trust.

  1. A customer pays for an order with PayPal (sandbox).
  2. When something goes wrong, they describe the problem in their own words, like "the left earcup stopped working."
  3. Gemini reads the request alongside your return policy and the order details, then recommends what to do: approve in full, approve partially, deny, or take a closer look. You get a clear refund amount, a short plain-language explanation that points to your policy, and a quick risk check for anything that seems off.
  4. You read the reasoning and approve with one click.
  5. The refund goes back to the customer through the PayPal Payments API, tied to their original payment, and a receipt appears right away.

The AI does the legwork, and you always make the final call. Customers get quick, consistent answers, and sellers stay in control.

How I built it

  • Backend: Java 17 and Spring Boot
  • Frontend: simple, clean HTML, CSS, and JavaScript
  • AI: Google Gemini, returning a structured decision. If Gemini is busy or slow, the app retries, switches to a lighter backup model, and finally falls back to built-in rules, so a return request never gets stuck.
  • PayPal: Orders to create and capture the payment, then Payments to refund that exact capture, all in the PayPal sandbox
  • Hosting: Render, using Docker

Challenges along the way

This project taught me a lot, mostly through things not working the first time.

  • Gemini models changed and got busy, so I hit 404s, 503s, and timeouts. That pushed me to build retries, a backup model, and a safety net, and the app is much stronger for it.
  • PayPal's sandbox needed matching country and currency settings before a payment would go through. Getting that right showed me how carefully money flows have to be set up.
  • A refund can only happen against a real payment, so I built the whole journey from purchase to return to refund, because it felt wrong to fake the most important step.

What I learned

I learned how a PayPal order, capture, and refund fit together. I also learned that good AI products don't replace people. They give people better information at the right moment, with a human decision at the end.

Built With

Share this project:

Updates

Submission history