QuickBooks Online API requests need the OAuth 2.0 protocol for authentication and authorization purposes. These access tokens are valid for 60 minutes or one hour. You will have to renew the access token after one hour, which is generally returned to you from your previous request.
The refresh access token can last up to 100 days before its expiration, so the user will not have to sign in again and grant consent again during this period. But the token can change a day later or at the time you apply for renewing token call, whichever action is later of the both.
How to Generate the Access Token in QuickBooks Online?
To generate or renew an access token, you need to follow the below steps:
- You will have to first register the app in QuickBooks.
- Then, in the next step, you need to use to OAuth 2.0 playground for generating and renewing the access tokens in QuickBooks.
Read More: How to Record Bounced Check in QuickBooks Online
What to do When your Access Token Stops Working or Fails?
You may come across situations where your access token in QuickBooks will stop working. There may be below reasons behind this situation.
- The user revoked your application access, in this case, you will have to ask the user to reauthorize the connection.
- Your access token expired; in this case, you will come across a 401 error while making an Online API call. You will have to request a new token by using the last received refresh token.
- If the token is not used for more than 100 days, then you will have to ask the user to reauthorize the connection.
Workflow for Renewing the Access Token by Using the Last Refresh Token in QuickBooks
You need to follow the below steps to renew the access token by using the last returned token:
- First of all, you should use the current returned refresh token to renew the access and refresh the token.
- You need to store both the returned access and refresh tokens and use the new access token for making QuickBooks API calls.
- If the Access token or refresh token fails or stops working, you need to start from Step one again.
Read More: How to Void or Delete Invoices in QuickBooks Online
Steps for Obtaining the Access Token Initially
To prepare your application to access data using QuickBooks Online API, you need to follow the below process steps:
- First of all, you need to prepare the authorization request with the help of parameters that identify your application.
- After that, you will have to redirect your request to the OAuth 2.0 server.
- Now, it will prompt the user with a consent window with details of your application, the user will grant authorization in this step.
- Once the user authorizes your application, you will receive the authorization code.
- Once the uthorization code is entered in the application, it will be able to exchange the authorization code for an access token as well as a refresh token.
Speak to A Specialist about QuickBooks Software
Headache🥺. Huh, Save time & money with QuickBooks Support 24×7 @ +1-800-892-1352, we provide assistance to those who face problems while using QuickBooks (Support all U.S. & Canada Editions)
--- Support - We provide solutions for the following QuickBooks (Pro, Premier, Accountant, Enterprise, Payroll, Cloud) ---
- Error Support
- Data Import
- Data Conversion
- Payment Solutions
- Upgradation
- Payroll Support
- Data Export
- Software Integration
- QuickBooks Printer Support
- Complete QuickBooks Solutions
- Tax-Related Issues
- Data Damage Recovery
- Installation, Activation Help
- QuickBooks Windows Support