Worked it out.
Looks like you need to publish the app on Google Play before the app will allow in-app purchases. (can't have the app saved as a draft)
As per Google Play Developer docs: Previously, you could publish a "draft" version of your app for testing. This functionality is no longer supported.
https://developer.android.com/google/play/billing/billing_testing.html
In my case I had uploaded a production app, and then released it and then unpublished the app while I was getting my app ready for the in-app billing. I found that I needed to have the app published in order for it to work with the in-app billing.
Since I had uploaded the app as a production app, if I was to publish the app then users would see this app on Google Play even knowing it's not a released version of my app since I am only getting it ready with the in-app purchases.
I had to get Google Play Developer support to delete my app and then I could re-upload the app again and publish the app. However this time I didn't upload a production app and only uploaded it as a Beta app. Now I can publish the app and no one on Google Play can access it (unless I invite them) until I publish (or move the beta app) the production app.