API Connector Documentation
Import QuickBooks Data to Google Sheets
In this guide, we’ll walk through how to pull QuickBooks data data directly into Google Sheets, using the API Connector add-on for Sheets.
Contents
- Before You Begin
- Part 1: Connect to the QuickBooks API
- Part 2: Pull Data from QuickBooks to Sheets
- Part 3: Create a Custom API URL
- Part 4: Other Reports
- Part 5: Handle Pagination
- Part 6: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Connect to the QuickBooks API
The easiest way to get started with the QuickBooks API is through API Connector’s built-in integration.
- Select QuickBooks from the drop-down list of applications
- Under Authorization, click Connect to QuickBooks
- You will be directed to Intuit.com and asked to accept the connection.
- You'll then be returned to your Google Sheet, and can verify that your QuickBooks connection is active in the Connections screen.
Part 2: Pull Data from QuickBooks to Sheets
Now that we’re connected, let’s pull some data into Sheets.
- Under Endpoint, choose an endpoint. Let’s start by querying accounts.
- Enter your company ID in the
company_id
parameter. To get your company ID, click the Gear icon in the top right corner of your navigation bar while logged into QuickBooks, and navigate to Billing and Subscription. You'll see your company ID listed at the top: - Select a destination sheet, name your request, and click Run.
Part 3: Create a Custom API Request
Alternatively, you can run your own custom requests instead of using API Connector’s pre-built integration, using any of the requests shown in the API documentation. This is useful for more advanced queries that include filters, pagination, and other elements not yet supported by our preset integration. Here's an example request setup:
- Application:
Custom
- Method:
GET
- Request URL:
https://quickbooks.api.intuit.com/v3/company/9130355007498326/query?query=SELECT * FROM Item WHERE Metadata.LastUpdatedTime >= '2022-01-01' STARTPOSITION 1 MAXRESULTS 1000&minorversion=65
- OAuth:
Quickbooks
- Headers:
Content-type
:application/json
Part 4: Other Reports
By default, several of Quickbook's reports come through in a format that doesn't work well with the tabular nature of sheets, so they haven't yet been added to API Connector's list of preset endpoints. We'll add some automated pre-processing for this in the near future, but for now you can grab this data with custom requests, and clean them up with a JMESPath expression. Here are some examples:
P&L Report
- Application:
Custom
- Method:
GET
- Request URL:
https://quickbooks.api.intuit.com/v3/company/YOUR_COMPANY_ID/reports/ProfitAndLoss?start_date=2022-01-01&end_date=2022-12-31
- OAuth:
Quickbooks
- Headers:
Content-type
:application/json
- JMESPath:
Rows.Row[].Rows.Row[].ColData.{account:[0],money:[1]}
TransactionList Report
- Application:
Custom
- Method:
GET
- Request URL:
https://quickbooks.api.intuit.com/v3/company/YOUR_COMPANY_ID/reports/TransactionList?start_date=2022-01-01&end_date=2022-12-31&group_by=Customer
- OAuth:
Quickbooks
- Headers:
Content-type
:application/json
- JMESPath:
Rows.Row[].Rows.Row[].ColData.{tx_date:[0],txn_type:[1],doc_num:[2],is_no_post:[3],name:[4],memo:[5],account_name:[6],other_account:[7],subt_nat_amount:[8]}
Part 5: Handle Pagination
By default, QuickBooks will only return 100 records at a time, as described in their documentation.
To get more, use the STARTPOSITION
and MAXRESULTS
parameters as shown below. MAXRESULTS
accepts any number up to 1000.
These URLs can be stacked to retrieve multiple blocks of 1000 (info: Multi-Query Requests), e.g.
https://quickbooks.api.intuit.com/v3/company/111111111/query?query=SELECT * FROM Invoices STARTPOSITION 1 MAXRESULTS
1000
https://quickbooks.api.intuit.com/v3/company/111111111/query?query=SELECT * FROM Invoices STARTPOSITION 1001 MAXRESULTS 1000
https://quickbooks.api.intuit.com/v3/company/111111111/query?query=SELECT * FROM Invoices STARTPOSITION 2001 MAXRESULTS 1000
Part 6: API Documentation
Official API documentation: https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/account
Hi Ana,
Did you find how to get invoices from a custom period:
This is what I was using:
https://quickbooks.api.intuit.com/v3/company/YOUR_COMPANY_ID/query?query=select * from Invoice Item MAXRESULTS 1000
That version looks like working
...query?query=select * from Invoice where MetaData.CreateTime > '2021-03-01T00:00:00'
Awesome, yeah that looks right to me. Based on their docs you can use
MetaData.CreateTime
orMetaData.LastUpdatedTime
in your query.What I would like to add to the query is BETWEEN two date. I didn't find how to do it. Any Ideas?
I saw this example in their docs, does it work for you?
SELECT * FROM Invoice WHERE MetaData.CreateTime >= '2009-10-14T04:05:05-07:00' AND MetaData.CreateTime <= '2012-10-14T04:05:05-07:00'
Hi Ana,
I used:
https://quickbooks.api.intuit.com/v3/company/+++Inputs!C3+++/query?query=SELECT * FROM Invoice WHERE MetaData.CreateTime >= '2021-01-01T00:00:00-00:00' AND MetaData.CreateTime <= '2021-04-01T00:0:00-00:00'
I get :
Completed with errors
- Server responded with an error (400) show response{"Fault":{"Error":[{"Message":"Demande non valide","Detail":"Erreur de validation de demande : value 2021-04-01T00:0:00-00:00 is not valid for property 'MetaData.CreateTime'","code":"4001"}],"type":"ValidationFault"},"time":"2021-04-19T18:04:48.423-07:00"}
Do you see why?
It looks like you've written 2021-04-01T00:0:00 instead of 2021-04-01T00:00:00, adding the 0 should resolve the issue.
Hello is it possible to connect to Quickbooks desktop through the Quickbooks web connector?
I don't know much about Quickbooks desktop, but I don't think it will work here since API Connector connects to services on the internet while it sounds like this would be something local on your computer.
Good article! Thanks a lot.
Hello,
The "Connect to QuickBooks" option is greyed out for me. Is this feature no longer working?
Thanks!
Hi Mike, the QuickBooks integration uses OAuth (aka the "Connect" button) which is only available on the Business plan. If it was working before and now it's not, most likely you were in your 2-week free trial that activates all features.
The OAuth function in API Connector appears to only allow one active Quickbooks Online account connection at a time. This is problematic as I would like to pull data from multiple client accounts to my google sheets. Is there anyway to resolve and have two (or more) QBO accounts connected to API Connector at once? I can only toggle back and forth manually with no automatic scheduling.
Hi Seth, API Connector currently doesn't support multiple OAuth connection at the same time. This is on the to-do list, please check back in the future (or feel free to message support with your email address if you'd like me to send you an update when it's ready).
Update: multiple OAuth connections are now available (info).
Hi Anna,
Thank you for the article.
I need help with querying items, I do get most of the information but not the product Sku.
How do I go about retrieving everything in items plus the product Sku?
Hope this makes sense, I'm very new to this.
Hey Richard, their sample response for the Items endpoint doesn't contain any field named product SKU, there's just an QueryResponse.Item.Id field. I'm wondering if the SKU is the same as the ID, can you please look for the QueryResponse.Item.Id field in your report and see if it contains the SKU?
Update: I found this useful post that explains that it's related to the API version. By default SKU isn't returned unless you add a
minorversion
parameter to your request, e.g.minorversion=65
.Thank you so much Works now, I never added the "&", I found that you just have to add &minoversion=65 to your query for it to work.
Great, I'm glad that fixed it. We also added that parameter into API Connector's preset integration for Quickbooks, so you can include it there as well.
Hey All - had a question: I'm trying to pull class into a transaction report query as a column, I'm having an issue with the JMESPath to pull in the class. Would anyone know what the identifier is to pull in the class?
Thanks all!
Specifically, using the transaction list query
https://quickbooks.api.intuit.com/v3/company//reports/TransactionList?start_date=2023-06-13&end_date=2023-06-19&group_by=Customer
Hey Nathan, I don't see "class" as a field in the response from Quickbooks. Do you see it returned in the response you get back? (Click Edit fields > show raw response to view) If so, can you please contact support with a sample of the JSON response so I can take a look?
For a custom OAuth connection, what do I enter for Name, Authorization Base URL, and Token URL?
For the Client ID and Secret, do I use the ones under Production (and not Development)?
API Connector already has a native Quickbooks connector, is there a reason you want to create your own? If it's because you're receiving an error we should address that rather than create a new custom OAuth connector. With that said, if you still want to make your own custom OAuth connection, it would be like this:
Type:
Authorization Code
Authorization Request URL:
https://appcenter.intuit.com/connect/oauth2?scope=com.intuit.quickbooks.accounting
Token URL:
https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer
Client ID & Secret: provided by Quickbooks (you'll need to set up an app in their developer site. Use production credentials)