Inspiration

Every group trip ends the same way: a pile of receipts, one tired friend with a spreadsheet, and awkward "who owes whom?" messages. Some receipts are in a foreign currency, and not everyone had everything ("Sara didn't drink"). We wanted settling up to take one tap.

What it does

  1. Create a trip and add friends.
  2. Upload or snap a receipt photo (on a phone you can use the camera). Google Gemini reads the merchant, items, tax, tip, total and currency.
  3. Say who had what in plain words, like "Sara didn't have cocktails. Water was only for Ravi." Gemini assigns each item and explains why.
  4. The app calculates exact shares, converts foreign currency, and works out the fewest payments to settle everyone.
  5. Each friend pays back with a PayPal button. The balance updates when the payment is captured.

Real example from our demo: Sunset Cafe receipt, $82.08 → Ali $31.14, Ravi $34.38, Sara $16.56 (exactly $82.08). Ravi paid Ali $34.38 through the PayPal sandbox, and the capture was COMPLETED.

How we built it

  • Backend: Python + FastAPI
  • AI: Google Gemini (vision + structured JSON output) reads receipts and interprets the plain-English sharing rules
  • Payments: PayPal Orders v2 API + PayPal JavaScript SDK (sandbox). The server creates the order for the exact amount owed, with the friend who is owed as the payee, and captures it after approval.
  • Frontend: plain HTML, CSS and JavaScript
  • Tests: 16 automated tests with pytest

Safe by design

  • AI reads, code counts. The AI never decides money amounts. All math runs in plain code in whole cents, so the shares always add up exactly to the receipt total.
  • Each balance is \( \text{paid} - \text{share} \). The biggest debtor pays the biggest creditor, repeated until everyone is at 0.
  • Blurry photo check: an image-sharpness check asks for a clearer photo. If the AI's confidence is too low, the receipt is rejected instead of guessed.
  • Check & fix: the user can compare the AI's result with the photo and correct any item, tax or total. The code recalculates the shares and marks the receipt "Checked by you".
  • Warnings for totals that don't match and for unknown names.
  • Receipt text is treated as untrusted data, so prompt injection is ignored.
  • The server checks that a debt really exists before creating any PayPal order.
  • Demo mode works without any keys.

Challenges

  • Rounding: $70.20 split 3 ways with tax first gave 23.41 / 23.40 / 23.39. We fixed it by summing exact fractions first and rounding once, so it's 23.40 each.
  • Blurry photos: the AI would sometimes guess. We added a sharpness check, confidence limits and a manual review step.
  • Foreign receipts (a Thai baht taxi) needed conversion into the trip currency.
  • PayPal sandbox setup: country and account types matter for which payments are allowed.

What we learned

Let AI do what only AI can do (read messy photos and understand human language), and keep money in deterministic code with checks around it.

What's next

Live exchange rates, splitting by percentage, PayPal payment requests by email, and a mobile app.

AI tools used

Google Gemini powers the receipt reading and split understanding inside the app. An AI coding assistant (Devin) helped write the code.

Built With

Share this project:

Updates

Submission history