
I considered integrating this with Starling Bank, as I’ve previously used them as my main current account, but unfortunately, they don’t offer a developer-facing receipts API. Then it’s time to compare them to look for matches, if one is found that falls within the acceptable sent time (Wetherspoons 1.5 hours, Trainline 3 hours) a PUT request gets sent to Monzo with the details they’ll need to generate a receipt. Next up it was the Monzo integration, and after getting a list of transactions and narrowing them down by the merchant’s names we get a list of all the possible matches. Then comes the scraping, which was bit inconvenient as mail layouts change over time - but both now work for all the layouts of the Trainline and Wetherspoons I’ve found, all the receipt items are then stored and passed back to be compared later on. This is where eazye came in as a nice way to get emails from IMAP, it didn’t support custom commands, however, so I added the ability to add custom IMAP commands to it, which means you can do custom mail searches such as FROM " ".

To design the project I started considering the best way to harvest the data and initially planned to use Gmail’s APIs to harvest mail from my own inbox, but decided in the end that IMAP would be a better option as it works across pretty much every mail provider used in the last 20 years. Also, being a student at University I use Trainline to buy my tickets, as the ticket operator with the nicest UX by a mile. Living pretty close to a Wetherspoons, it’s a pub I frequent pretty often.

I wanted to learn the fundamentals of Go over a weekend and thought what better way to do it than to find a cool project to work on. Receiptify is a project designed to convert your email receipts from HTML filled emails into enriched receipts in the Monzo app, allowing you to better understand your spending and get breakdowns at some merchants that Flux doesn't yet support - currently, it supports JD Wetherspoons and Trainline.
