Exporting Financial Transactions for import into an accounting platform

Pieter Gheysens
Sep 2, 2018 · 4 min read

Not really a typical TFS/VSTS blog post but at least this time I used VSTS for my own benefit and to end up with a fully automated process without any manual intervention.

The beginning

About a year ago I discovered Revolut, a #fintech digital banking alternative that started in 2015 and since my early experiences I have become a big fan of their platform and how they run their business. It’s all BUT the traditional and painful banking experience we have somehow become familiar with. Finally a bank with a true “customer first” digital culture, without filling and signing a zillion of paper documents from all different parties to get started. First I used Revolut for personal banking and a few months ago I opened a business account for the private company running Techorama.

Only the unboxing makes it worthwile to order a Revolut card.

Older people sit down and ask, ‘What is it?’ but the boy asks, ‘What can I do with it?’. — Steve Jobs

Opportunities

One of the (many) interesting features of Revolut for Business is the Open API to integrate Revolut into your existing business processes. A very frustrating process in the old world (before Revolut) has been to process our credit card transactions (VISA) into our accounting system. Once a month these transactions were sent by post to my home address after which I scanned the documents to pdf files to finally send these to our accountant. Staff members of the accounting firm had to manually input every transaction into the system and validate the various currency transactions with cryptic payment messages. Not quite a smooth process to perform the full matching with the actual invoices and there was always too much delay in getting this done.

The Plan

My plan was to try the Revolut API and dump all transactions (wire transfer, top-up, credit card payments) for a specific account into a CSV file which can be automatically processed by our accounting platform Yuki.

The Solution

When doing similar proof of concepts, I like to take the challenge and use some new tools/technology. I haven’t been using Visual Studio Code a lot in the past and wanted to explore a bit more the possibilities with developing/debugging PowerShell scripts inside Visual Studio Code. PowerShell Core 6 was also on my list for exploration and after some tweaking, Visual Studio Code was configured to be my development environment for this exercise.

Visual Studio Code as editor for PowerShell Core 6 development

The API documentation is self-explanatory and it didn’t take me a lot of time to grab all transactions in PowerShell, do some account filtering and export the required details to a CSV file.

API call to fetch all accounts and transactions:

$urlAccounts = "https://b2b.revolut.com/api/1.0/accounts"
$urlTransactions = "https://b2b.revolut.com/api/1.0/transactions"
Invoke-RestMethod $urlAccounts -Method Get -Authentication Bearer -Token $secureKey
Invoke-RestMethod $urlTransactions -Method Get -Authentication Bearer -Token $secureKey

The $secureKey variable contains the Revolut Api key which can be generated from the settings in your business account.

The debugging experience for PowerShell 6 in Visual Studio Code is all what you expect.

For dumping the transaction details to a CSV file I’m using the simple Add-Content method. In the end of the script I’m sending the file as attachment to an email address with Send-MailMessage. This result file must of course map with the expected format of your accounting software to be processed automatically without any manual intervention.

Send-MailMessage -To $toEmail -From "pieter@techorama.be" -Subject "Export Revolut Transactions BE" -SmtpServer "smtp.gmail.com" -Credential $mycreds -Port 587 -UseSsl -Attachments $exportFileBE

Schedule Export with VSTS

Once the script was working fine, I created a build pipeline in VSTS to call my PowerShell script with a weekly trigger

Because I’m using PowerShell Core 6 which is cross-platform (Windows, macOS and Linux), I can now also choose to run my build in a Hosted Linux Preview agent pool.

Using the Linux Hosted Build Agent Pool to run PowerShell Core 6

Conclusion

This simple automation to export our financial transactions will pay off in the future and lots of manual processing will now be avoided by different parties. It’s a clear win for everyone and we won’t be playing the traditional catch-up game anymore. More time for us to focus on our core business.

Using the right tools offer so many opportunities to integrate and automate boring and repetitive manual tasks. Time is so precious for us at Techorama that we invest a lot in tasks and actions that can be automated. We have become a software company ourselves, relying on a number of critical tools to run our business. Revolut, due to its Open API, has become an important asset in our portfolio of software tools.

Into ALM

Blogging About Application Lifecycle Management with TFS/VSTS

Pieter Gheysens

Written by

Visual Studio ALM MVP — Managing Director Xpirit Belgium (2018) — Founder of Techorama (2014) — www.techorama.be — www.xpirit.com

Into ALM

Into ALM

Blogging About Application Lifecycle Management with TFS/VSTS

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade