How do I connect to the QuickBooks REST API?

I am struggling setting up a REST API resource to use the QuickBooks API. QuickBooks seems complicated in how it has a multi-step authentication process. Has anyone already set this up that can share a screen shot or any pointers on how they did it?

Thank you!

Looking at their docs, it looks like quickbooks is using OAuth2.0 for authenticating with their REST API. This should be pretty simple to set up in Retool by selecting "OAuth2.0" for the authentication type and providing the appropriate values.

An overview of how to set up Oauth2.0 authentication in Retool can be found here: https://docs.retool.com/docs/api-authentication#oauth-20

If you run into specific issue when setting this up, don't hesitate to reach out with specific questions or errors you encounter!

Thank you for the link. I have made a lot of progress with the QuickBooks API and have it mostly working. When QuickBooks authenticates through OAuth, it returns what QuickBooks calls a RealmID through the authentication codes. (step 11 of Intuit Developer). This realm ID is needed later for each subsequent request to QuickBooks. Is there a way for me to find the result JSON of the authentication codes returned from QuickBooks during the OAuth process? It seems to me that this would be a variable held in the connection resource in Retool but I don't know how to access the resource information from inside the code in the Retool application.

I hope all that makes sense. I know it is a little confusing and I feel like I only vaguely know what I'm talking about!

Thanks,

Paul

Hey @pdamato!

Happy to help here! Since this workflow relies on an additional variable realmID, you may want to build this out as Custom Auth with an OAuth2 step. After entering your credentials in this workflow you should be able to test it with the button at the bottom of the resource setup page which will show you what is returned from this flow. From here, you can add additional custom auth steps to declare and add these variables to your auth scheme. Do you think this could work for your use case here?

Thank you for the reply. I'm not entirely sure I'm following what you are saying but I will play around with it. Intuit definately requires 0Auth but I'm not sure I know how to set up a custom Auth.

Cris -

Thank you again for this information.

I have created a custom authentication workflow for QuickBooks authentication. As you suggested, the first step is an Auth2 step. I am still unable to fine the RealmID variable returned from the QuickBooks server response. When I run "Test Auth Workflow" I get a set of values which include the accessToken and refreshToken but not the RealmID.

Unfortunately, this seems to be the only time the QB server provides this information. From this point on, the QB server expects me to provide this on future queries. Is there a way to view the full server response on an Auth2 request?

Thank you!

Hey @pdamato — I see :thinking: it doesn't look like quickbooks has an easy way to list all realmIds unfortunately and returns this realmId during the SSO step which at the moment there is no way to retrieve in Retool. I will create a feature request for this and link it to this thread so we can keep you up to date as we address this. In the meantime, since it seems these realmIds are static and are essentially a companyId, I think the best workaround would be to grab these realmIds from QuickBooks directly and use the multi-select component to allow users to switch between companies and interpolate the corresponding realmID into your queries. Do you think this could work for your use case here?

Sorry for my delay replying. It is possible to keep track of the realm IDs on the Retool side. Unfortunately, you don't know if that was the company that the user authenticated or not. It is weird, but when the user authenticates with QB the user has to pick from a list of companies they have access to. When control goes back to Retool, Retool can't tell which one of the companies the user has chosen. Retool can ask the user to then pick again from a list of companies but if the user doesn't pick the same one for whatever reason, it will error out. I have this setup built right now but it is pretty awkward. We have about 10 companies in QB and I am pulling QB information into retool but it is a laborious process for the user.

QB may have a more sophisticated authentication system now but I don't understand enough about APIs to wade my way through their description.