My partner and I use separate YNAB plans but we use Splitwise as the source of truth for shared expenses
If I pay $50 for gas with my debit card, here's the manual process to categorize this expense:
- In YNAB, I categorize the $50 outflow in my Gas/Parking category.
- In Splitwise, I add a $50 split evenly expense to our shared group.
- 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)
If she pays $100 for our electricity bill, here's the manual process to categorize this expense:
- In Splitwise, she adds a $100 split evenly expense to our shared group.
- 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).
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.
This project automates steps (2) and (3) above. Here's how:
First, I mark a transaction as shared in YNAB:
- 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:
- Add a split equally expense into a Splitwise group
- 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.
This still works as long as your partner enters an expense into the configured shared group in their Splitwise app.
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.
You can deploy your own instance of this app to run automatically without manual intervention.
- Fork this repository to your GitHub account
- Connect your GitHub account to Vercel and deploy the fork
- Note your deployment URL (e.g.,
https://your-app.vercel.app)
- Create a new Redis database at Upstash
- Copy the
UPSTASH_REDIS_REST_URLandUPSTASH_REDIS_REST_TOKENfrom your database details - Add these as environment variables in your Vercel deployment
In your Vercel project settings, add these environment variables:
API_SECRET_KEY=your-secret-key-here
UPSTASH_REDIS_REST_URL=your-upstash-url
UPSTASH_REDIS_REST_TOKEN=your-upstash-token
In your forked repository, go to Settings โ Secrets and variables โ Actions, and add these secrets:
API_SECRET_KEY- Same value as your Vercel environment variableAPI_BASE_URL- Your Vercel url (e.g.https://your-app.vercel.app)
YNAB_API_KEY_MINE- Your YNAB personal access tokenYNAB_BUDGET_ID_MINE- Your YNAB budget IDYNAB_SPLITWISE_ACCOUNT_ID_MINE- Your Splitwise cash account ID in YNABSPLITWISE_API_KEY_MINE- Your Splitwise API keySPLITWISE_USER_ID_MINE- Your Splitwise user ID (numeric)
YNAB_API_KEY_PARTNER- Partner's YNAB personal access token- Can me same as "mine" if both budgets are on the same YNAB account
YNAB_BUDGET_ID_PARTNER- Partner's YNAB budget IDYNAB_SPLITWISE_ACCOUNT_ID_PARTNER- Partner's Splitwise cash account ID in YNABSPLITWISE_API_KEY_PARTNER- Partner's Splitwise API key (if applicable)SPLITWISE_USER_ID_PARTNER- Partner's Splitwise user ID (numeric, if applicable)
SPLITWISE_GROUP_ID_SHARED- Your shared Splitwise group ID
If you want to change flag colors, emojis, or currenct, you can edit ./github/workflows/cron.yml
The GitHub Actions workflow can be triggered manually and calls your deployed API endpoints with all the necessary configuration. This bypasses the need for manual OAuth flows and web interface interactions.
The sync uses Upstash Redis to store sync state, ensuring transactions aren't processed multiple times and maintaining consistency across runs.
Note
The automatic 6-hour schedule is currently disabled. You can manually trigger the workflow from the Actions tab in your GitHub repository, or re-enable the schedule by uncommenting the schedule section in .github/workflows/cron.yml.
This is a Next.js project bootstrapped with create-next-app.
Set up your environment variables
cp .env.example .env
vim .env # fill these outInstall dependencies
npm installnpm run devOpen http://localhost:3000 with your browser to see the main page.