Importing PayPal CSV into Wave Accounting

If you ever find yourself importing historical PayPal transactions into Wave Accounting, you’ll likely discover that PayPal’s exports aren’t very digestible.

The key issues with PayPal CSV files are:

  • PayPal’s fees show up in a “Fee” column on the same row as the originating transaction. In Wave, you’ll want these inputted as separate transactions so that they can be properly categorized as “Merchant Gateway Fees”.
  • The column names are incorrect, they have to be (Date, Amount, and Description).
  • All the transactions, regardless of currency, show up in the same CSV file. To import into Wave you’ll need separate CSV for every PayPal currency account.

There’s some discussion in Wave forums about how to resolve this problem by making new rows, but this takes time.

So, I’ve made a little script in Ruby to help with the task. Here’s a link for the self-sufficient.

Update 2019-02-11: Someone requested that I make a web page to allow non-tech people to perform this task. Feel free to go there instead of reading all the technical stuff below.

What Does the Script Do?

This script performs the following tasks:

  • Creates out CSVs that have the column headers needed for Wave Accounting.
  • Breaks the transactions up into separate files, one for every 100 transactions of each currency encountered. This small size is required as per instructions from Wave (see import notes below).
  • Splits any transactions that involve a PayPal fee into two, naming the second “PayPal Fee” with its own dedicated Amount.
  • Sets the description of each transaction as “Name – Type”, where Name is the recipient, and Type is the type of transaction, e.g., “MostlyDev.com Donation – PayPal Express Checkout”.

If you’re on MacOS you’ve already got Ruby installed — I make a point of not depending on any third-party libraries — so you can run the script as-is.

Running on MacOS

So, to get started:

  • Save your PayPal CSV into a folder, let’s say you called it: “PayPal.CSV”
  • Download make_wave.rb from Terminal.
$ curl https://mostlydev.com/wp-content/uploads/2019/01/make_wave.rb > make_wave.rb
  • Then, run the script on your CSV file:
$ ruby make_wave.rb PayPal.CSV

You’ll see some output like this:

PayPal to Wave-importable CSV converter
Copyright (c) 2019 Wojtek Grabski (mostlydev.com)
------

... created PayPal.usd.wave.csv
... created PayPal.cad.wave.csv
... outputted 2202 rows

That’s it.

You should import each of the resulting csv files into its own currency-specific PayPal account in Wave.

Need to OCR and Import Bank Statements?

If you’re importing paper/pdf bank statements, then check out https://docparser.com. I spent a few days twiddling with OCR before I discovered that these guys have it pretty much figured out. If you need help with importing their CSV exports into Wave, or need some advice on how to best configure, then hit me up

Notes on Importing

Through a lot of trial and error I’ve discovered that Wave is *very* picky about imports, and whatever process performs this task can very easily fail.

To reduce the chances of failure, make sure that after you have commenced the import, and despite what Wave happily tells you, DO NOT LEAVE THE TRANSACTION PAGE, and do not refresh, while the import is progressing. If you stay on the page, and refrain from doing other things, then not only will the import be more likely to succeed, but you’ll also get a visual update when it’s done.

Trust me. Stay on that page, and keep the tab open.

Moreover, even if it looks like Wave has done nothing – there’s no status box on the page after you confirm the import – you should still wait a few minutes and refresh the date range to see if your transactions have imported. I’ve had several occasions where I thought I was re-attempting an import, only to find multiple copies of transactions.

Check your ledger a little after, and between every attempted import. Yes, it’s tedious, but it’s much less tedious than having to sift through and delete 300 triplicate transactions.

Running on Windows

On Windows, check out Chocolatey to most easily get your hands on Ruby. Choco will change your life, I promise.

Install Chocolatey & Ruby on Windows

  1. Go here and copy the cmd.exe Chocolatey install command under the heading Install with cmd.exe.
  2. Drop into an Administrative (Run as Administrator) command shell and run the command you copied above.
  3. Follow instructions.
  4. Quit your Command Shell and re-open it as administrator.
  5. Run choco install ruby -y. Follow instructions.
  6. Run choco install curl -y. Ditto.
  7. Quit your shell again, re-open (don’t need to be admin this time), and follow the Mac instructions above.

Note: I recommend importing your home currency first. If you don’t do this then Wave will erroneously flag transfers between the non-home currency and your home currency as having come from your native bank account. This creates a bit of work to un-link and re-link to the correct PayPal account.

12 thoughts on “Importing PayPal CSV into Wave Accounting”

  1. This is awesome! Can’t believe how bad Wave is at handling different Paypal currencies. I wonder how hard it’d be to turn this into a simple, more user-friendly program?

    1. The only big complaint I have is about how transfers are pre-linked. I’d rather none of them were pre-linked than have to unlink and fix 20-25% of my imported transactions.

    2. Did you mean turning the script into a program? Yeah, I’ve been wondering whether I should’ve just turned this into a web app. It wouldn’t take more than a couple of days. I suppose if one or two people ask then I’ll probably do it.

        1. Great, let me know if it works for you. You might well be the first person to actually try it who isn’t me.

  2. Thank you for working on this huge gap in Wave 🙂 I’m going to attempt to process my .csv file as described above, although I understood about 1/3 of the instructions, lol. I’m 60 years old and pretty tech savvy for my age, but the struggle is real . . .

    First let me say if you made this into a web app, I’d totally buy it. I’d send you a $50 donation or what ever you feel is fair within reason.

    Secondly, when you download the .csv from paypal, (I do it in the Reports Tab) do you select “Completed Payments”, “All Transactions” or “Balance Affecting” My instinct is completed payments

    1. Hi! Sorry about the delay in response. Apparently I need to check my comments more often.

      You want to download “Balance Affecting” transactions. Thanks for your interest in a web app that does this.. I’ll see if i can whip one up in the coming week or so.

  3. Can you give me more instructions on how to run on MacOS? I don’t know what “Run the script on your CSV file” means?

    1. > “Run the script on your CSV file”

      This means quite literally running the command that appears right below it.

      $ ruby make_wave.rb PayPal.CSV

      Without the dollar sign — that’s just a convention for expressing terminal commands.

      To run the command you have to open the Terminal application, navigate to the folder where you downloaded the script and your csv, usually by typing:

      $ cd ~/Downloads

      And then running the aforementioned command.

Leave a Reply