Skip to content

danthareja/splitwise_for_ynab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Splitwise for YNAB

Works with YNAB

Background

My partner and I use separate YNAB plans but we use Splitwise as the source of truth for shared expenses

When I pay

If I pay $50 for gas with my debit card, here's the manual process to categorize this expense:

  1. In YNAB, I categorize the $50 outflow in my Gas/Parking category.
  2. In Splitwise, I add a $50 split evenly expense to our shared group.
  3. In YNAB, I add a new $25 inflow transaction into a Splitwise cash account, and categorize it back into Gas/Parking

After this, YNAB shows I've only spent $25 on my half of gas, and my Splitwise account shows a positive balance of $25 (what I'm owed in the Splitwise app)

Screenshot 2025-05-19 at 10 27 31 PM

When she pays

If she pays $100 for our electricity bill, here's the manual process to categorize this expense:

  1. In Splitwise, she adds a $100 split evenly expense to our shared group.
  2. In YNAB, I add a new $50 outflow transaction into a Splitwise cash account, and categorize it into Utilities

After this, YNAB shows I've spent $50 on my half of the electricity bill, and my Splitwise account would show a negative balance of $50 (what I owe in the Splitwise app).

Screenshot 2025-05-22 at 10 11 49 AM

Settling up

When we settle up on Splitwise, the transaction is categorized as a transfer between my Splitwise account and my Checking account.

Warning

With this workflow, the dollars in your fake Splitwise cash account are not spendable. When the balance is positive (you are owed money), you can assign those dollars in your plan, but they are not in your Checking account yet. You must keep an eye on this and settle up as needed.

Concept

This project automates steps (2) and (3) above. Here's how:

First, I mark a transaction as shared in YNAB:

  1. Flag the transaction with a color (I use blue, this is configurable)

When triggered, this app will search for flagged transactions. For each flagged transaction, it will:

  1. Add a split equally expense into a Splitwise group
  2. Add the corresponding transaction into the Splitwise account in YNAB for both partners

This lets me use Splitwise for shared expenses without ever leaving YNAB.

FAQs

What if my partner doesn't use YNAB?

This still works as long as your partner enters an expense into the configured shared group in their Splitwise app.

What if an expense isn't split evenly?

Enter it directly in the Splitwise app as such.

A common scenario is when you front a full purchase for your partner. In your Splitwise app, add an expense where you're owed the full amount. Both transactions will cancel out in YNAB, and would be a good candidate for a Reimbursements category.

Development

This is a Next.js project bootstrapped with create-next-app.

Prerequisites

  • Node >= v22
  • A Postgres database (Prisma, Neon, or local installation)

Setup

Set up your environment variables

cp .env.example .env
vim .env # fill these out

Install dependencies

npm install

Run the development server

npm run dev

Open http://localhost:3000 with your browser to see the main page.

User-specific Sync API

Send a GET request to /api/sync with an Authorization: Bearer <USER_API_KEY> header to trigger a sync for a single user.

Rate limiting

By default each user can trigger two syncs every hour. Configure via the following env vars:

USER_SYNC_MAX_REQUESTS=2          # number of allowed requests per window
USER_SYNC_WINDOW_SECONDS=3600      # window size in seconds (default 30m)

About

Broadcast shared YNAB transactions into Splitwise and back

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages