This is a simple tool to automate some of the hassle of matching YNAB (the popular budgeting app) transactions to Amazon purchases, by adding a memo to each matched transaction in YNAB.
I've used this tool myself, and it works, but I plan to tidy it up and add some creature-comforts.
-
Install Python 3.
-
Clone this repository.
git clone https://github.com/joelheaps/amazon-to-ynab
-
Create a Python environment (probably).
python -m venv ./venv source venv/bin/activate
Or on Windows:
python -m venv ./venv .\venv\scripts\activate.bat
-
Install the prereqs for running this tool.
pip install -r requirements.txt
-
Get a YNAB personal access token from https://app.ynab.com/settings/developer.
Save it to
config.toml
on the lineynab.api_token = "your_token_in_quotes_here"
. -
If you have multiple budgets, browse to the one you want to match transactions from and copy the budget ID from the URL.
It's pretty obvious in the URL; grab the "random" text between
https://app.ynab.com/
and/budget
. Save it toconfig.toml
on the lineynab.budget_id = "budget_id_in_quotes_here"
.💡 If you only have one budget, you can also just leave this blank; this tool will attempt to find the default budget on your account.
-
Save orders from https://www.amazon.com/gp/your-account/order-history to the
orders-html
folder.Use multiple files if you want to include more orders (just make sure they have unique names).
-
Save transactions from https://www.amazon.com/cpe/yourpayments/transactions to the
payments-html
folder.Again, use multiple files if you'd like.
-
Run
amazon.py
and thenynab.py
.If everything on the screen checks out, set
dry_run = false
inconfig.toml
and runynab.py
again.