Link to plugin page: https://zeroqode.com/plugin/quickbooks-accounting-1534843366375x316652045181386750
Demo to preview the settings
For Sandbox version see plugin setup below:
Bubble Editor (sandbox): https://bubble.io/page?type=page&name=quickbooks_sandbox&id=zeroqode-demo-10&tab=tabs-1
Introduction
This plugin connects your Quickbooks account with your bubble application, so you will be allowed to create new accounts, grant access privileges, and manage your Quickbooks data, so you and your team can easily log in and work with it directly from your app.
Prerequisites
You will need a developer account with Quickbooks in order to interact with the Plugin: https://developer.intuit.com/app/developer/qbo/docs/get-started
Note: The documentation provides info for both Development and Production setup. Use both plugin versions for both setups in order to make sure that it works correctly, by starting with Sandbox.
To stay in the app for 100 days, please leverage the QuickBooks Oauth 2.0 plugin.
Difference between the plugin’s Production and Sandbox versions
On our plugin portal plugins are separated into Sandbox and Production versions because they have different authentication methods in the sandbox and prod.
Sandbox:
Production:
Note: Therefore, please use only the sandbox version for tests and the prod version for real projects and configure separate workflows for them.
Getting started
- Sign up for the Quickbooks Developer Website.
- Once you are logged in, go to Dashboard & then 'Create new app'.
- Click '+ Create an app' for a new application.
- Select the platform you want to develop for
- Insert a name for your new app and select the scopes
- Navigate to the 'Keys & credentials' tab, in BOTH 'Redirect URI' sections add your app's redirect URL.
- If you are using the Production plugin, do the same as for the Development keys:
Your Redirect URL in cases will be, https://_your-app_.bubbleapps.io/api/1.1/oauth_redirect
If you already have an application here's how to setup
- Go to Quickbooks Developer Website.
- Click the “Dashboard” tab.
- Select your application from the list.
- Get the keys “Client ID” and “Client Secret” from your app.
- Place your “Client ID” and “Client Secret” into the plugin's settings in your app.
If you wish to add the Webhooks & continue with your App Listing on the Quickbooks Marketplace you can do so although it's not required to use the plugin.
Plugin Parameters
The 'realmId'
There are a few concepts that once are known will make your integration much easier to understand. The first is the realmId. As the user is going through the OAuth process and signing into your app they will choose the company they wish to use, Once this process is finished they will arrive back in your app and you will notice that there is now an extra parameter in your URL, eg. realmId=123456789.
Example: https://zeroqode-demo-10.bubbleapps.io/version-test/quickbooks_sandbox?debug_mode=true&realmId=4620816365004256890
It's important you grab this value from and save it to the current user because this will be needed in every action you use in reference to the current user's company. This should be saved as the parameter may not persist in other parts of your app.
The 'Sync Token'
Quickbooks uses a sync token to stop multiple users from corrupting data in the event the same record is altered at the same time. This means you should read the record then alter it, When you for example read a vendor's record - grab the sync token (tokens are numbers that increase by one each record change) & as you edit the record you will be able to provide the token there.
It's good practice to only save the token in states on the page, Saving them in the current user or another section of your database will reduce performance but more importantly can lead to errors.
Complex
{Looking: "Actions"}
Quickbooks can achieve a lot, It's why they thrive and continue to grow. As you can imagine this makes the data more complex & in turn what we must provide when making calls / creating records also becomes more complex. To combat the number of actions the plugin would require to accommodate the millions of possible record variations we provide you the JSON so you can drop dynamic statements where you need them. This also means in the cases that you need something where your key & value need defining this is done with ease.
Let's look at one of the records, Here is a Vendor,
javascript{ "BillAddr":{ "Line1":"Bill's Store", "Line2":"Bill Smith", "Line3":"1 Notreal Ave.", "City":"Notrealie", "Country":"U.S.A", "CountrySubDivisionCode":"TX", "PostalCode":"55555" }, "TaxIdentifier":"12-3456789", "AcctNum":"12345678", "Title":"Mr.", "GivenName":"Bill", "FamilyName":"Smith", "Suffix":"Sr.", "CompanyName":"Bill's Store", "DisplayName":"Bill's Store", "PrintOnCheckName":"Bill's Store", "PrimaryPhone":{ "FreeFormNumber":"(012) 345-6789" }, "Mobile":{ "FreeFormNumber":"(012) 345-6789" }, "PrimaryEmailAddr":{ "Address":"bill@test.com" }, "WebAddr":{ "URI":"http://billsstore.com" } }
When you see JSON properties like this, in most cases we provide ALL the properties. A lot of the time they are all required however sometimes this is not the case - To view the Quickbooks documentation in regards to these objects, you can click here.
Looking at the above example to make something dynamic in the Bubble, we can do the following.
- In the above example, you can see we have made the 'Line1' property dynamic.
It's a good idea to add an 'on unhandled error' action to your app - if a user was to then input something that QuickBooks will return an error from, the error will not transpire to your user's screen.
To learn about the proper use of the Quickbooks logo & to download image/button assets, you can visit here.
Plugin Element
QuickBooks Converter
Element convert response from Report’s API Calls to rows
Title | Description |
State Type | Choose “Report Type” |
Exposed states
Title | Description | Type |
Header Titles | Contain heater titles | List of text |
Body Rows | Contain body rows | List of text |
Header and Body Rows | Contain heater and body rows | List of text |
Error type | API Call’s error type | Text |
Error message | API Call’s error messages | Text |
Element Actions
- Convert to rows - Action converts report API response to rows, that can be used in tables.
Title | Description | Type |
Data | Provide response from any report’s API call. | API Response |
Plugin Data / Action Calls
Data Calls
- QuickBooks - Company Details
- QuickBooks - Get General Ledger
- QuickBooks - Read Account
- QuickBooks - Read Tax Agency
- QuickBooks - Read Tax Code
- QuickBooks - Read Tax Rate
- QuickBooks - Read Payment
- QuickBooks - Read Journal Entry
- QuickBooks - Read Changed Data List
- QuickBooks - Get Preferences
- QuickBooks - Read Transfer
- QuickBooks - Read Vendor Credit
- QuickBooks - Read Item
- QuickBooks - Read Purchase Order
- QuickBooks - Read Estimate
- QuickBooks - Read a Class
- QuickBooks - Read Attachable
- QuickBooks - Read Employee
- QuickBooks - Read Customer
- QuickBooks - Read Deposit
- QuickBooks - Query Transfer
- QuickBooks - Query Employee
- QuickBooks - Query Customer
- QuickBooks - Query Attachable
- QuickBooks - Query Sales Receipt
- QuickBooks - Query Item
- QuickBooks - Query Vendor Credit
- QuickBooks - Query an account
- QuickBooks - Query Estimate
- QuickBooks - Query Journal Entry
- QuickBooks - Query Payment
- QuickBooks - Query Purchase Order
- QuickBooks - Query Invoice
- QuickBooks - Query Taxcode
- QuickBooks - Query Deposit
- QuickBooks - Read Payment Method
- QuickBooks - Read Accounts
- QuickBooks - Get list of Transactions
- QuickBooks - Profit and loss detail report
- QuickBooks - Sales by customer report
- QuickBooks - Profit and loss report
- QuickBooks - Ar aging detail report
Action Calls
- QuickBooks - Create Account
- QuickBooks - Create Attachable
- QuickBooks - Create Deposit
- QuickBooks - Create Purchase Order
- QuickBooks - Create Account Class
- QuickBooks - Create Customer
- QuickBooks - Create Vendor Credit
- QuickBooks - Create Transfer
- QuickBooks - Create Payment
- QuickBooks - Create Credit Card Account
- QuickBooks - Pay Bill
- QuickBooks - Create Bill
- QuickBooks - Create Tax Agency
- QuickBooks - Create Tax Rate
- QuickBooks - Create Journal Entry
- QuickBooks - Create Item
- QuickBooks - Create Employee
- QuickBooks - Create Vendor
- QuickBooks - Create Estimate
- QuickBooks - Read Vendor
- QuickBooks - Update Account
- QuickBooks - Update Vendor
- QuickBooks - Update Transfer
- QuickBooks - Update Attachable
- QuickBooks - Update Journal Entry
- QuickBooks - Update Preferences
- QuickBooks - Update Employee
- QuickBooks - Update a Class
- QuickBooks - Update Vendor Credit
- QuickBooks - Update Item
- QuickBooks - Update Estimate
- QuickBooks - Create Payment Method
- QuickBooks - Update Purchase Order
- QuickBooks - Update Customer
- QuickBooks - Update Deposit
- QuickBooks - Update Payment Method
- QuickBooks - Delete Something
- QuickBooks - Create a purchase
- QuickBooks - Delete a purchase
- QuickBooks - Read a purchase
- QuickBooks - Full update a purchase
- QuickBooks - Get an invoice as PDF
- QuickBooks - Create sales receipt
- Convert to rows a QuickBooks Converter
- Refresh Access Token (this)
- Initial auth code exchange (this)
Actions
Initial auth code exchange
The action is designed to exchange the authorization code for access tokens.
Fields:
Title | Description | Type |
Authorization | Header field in the form of Authorization: Basic <credentials>, where credentials is the Base64 encoding of ID and password joined by a single colon : . | string |
Authorization Code | The authorization code your app received from the Intuit OAuth 2.0 response. | string |
Redirect URI | The redirect URI listed for your app. | string |
Returned values:
Title | Description | Type |
error | Error | string |
accessToken | The token used to access our API. Max length: 4096 characters. | string |
expires_in | The remaining lifetime of the access token. The value begins at 3600. This is in seconds (one hour). | string |
refreshToken | The token used for refreshing the access token. Max length: 512 characters. | string |
id_token | Token ID | string |
error_description | Error description | string |
- To get the Authorization Header field, go to Playground your developer account.
- Fill in all the required fields and click “Get authorization code”.
- After you receive the “Authorization code” and “Realm ID”, click “Get tokens”. You will receive Authorization Header field.
Refresh Access Token
Use refresh tokens to “refresh” expired access tokens. You can refresh access tokens without prompting users for permission.
Fields:
Title | Description | Type |
Authorization | Header field in the form of Authorization: Basic <credentials>, where credentials is the Base64 encoding of ID and password joined by a single colon : . | string |
Refresh Token | The refresh_token value you exchanged the authorization code for. | string |
Returned values:
Title | Description | Type |
error | Error | string |
accessToken | The token used to access our API. Max length: 4096 characters. | string |
expires_in | The remaining lifetime of the access token. The value begins at 3600. This is in seconds (one hour). | string |
error_description | Error description | string |
- Get a "Refresh Token" in the developer's personal account after clicking the "Get tokens" button in the Playground section.