cancel
Showing results for 
Search instead for 
Did you mean: 
Soumya Goyal
Level 1

Quick Books online Refresh token

Hii QBO support,

 

While testing a trial account in Quickbooks online , When tried to generate access token with the help of refresh token getting error below with status code 400 :

{"error_description":"Incorrect Token type or clientID","error":"invalid_grant"}

 

 

8 Comments 8
FritzF
Moderator

Quick Books online Refresh token

Hi there, @Soumya Goyal.

 

Welcome, and thanks for posting here in the Community. I can help fix the issue you're having with QuickBooks Online (QBO).

 

The error may be caused by an interrupted connection with our server. We'll perform a few steps to resolve this.

 

Let's begin with logging into your account through a private browser (incognito). It's the best place to isolate connectivity issues.

 

Here's how:

 

  • Press Ctrl Shift (Google Chrome).
  • Ctrl Shift (Firefox).
  • Control Option (Safari).

 

If it's successful, return to your default browser and perform a clear cache to refresh the system. However, if the issue persists, try using other supported browsers.

 

You can also visit our website for more tips and other resources you can use in the future: Self-help articles.

 

Please let me know in the comment section below if you have more questions about this or anything else. I'm always here to help. Stay safe.

Soumya Goyal
Level 1

Quick Books online Refresh token

Hii QBO community,
Thank you , But we are trying to get access token from the below script that is created by us and getting previously mentioned issue here :

client_id = "<client_id>"
client_secret = "<client_secret>"
code = f"{client_id}:{client_secret}"
code = code.encode('ascii')
base_code = base64.b64encode(code)
base_code = base_code.decode('ascii')
print(base_code)
headers = {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': f"Basic {base_code}"
}
payload = dict(
grant_type="refresh_token",
refresh_token=""

)

response = request("POST", url="https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer", headers=headers, data=payload)

Thanks & Regards


Kyle69
Level 1

Quick Books online Refresh token


@FritzF wrote: www.mcdvoice.com

Hi there, @Soumya Goyal.

 

Welcome, and thanks for posting here in the Community. I can help fix the issue you're having with QuickBooks Online (QBO).

 

The error may be caused by an interrupted connection with our server. We'll perform a few steps to resolve this.

 

Let's begin with logging into your account through a private browser (incognito). It's the best place to isolate connectivity issues.

 

Here's how:

 

  • Press Ctrl Shift (Google Chrome).
  • Ctrl Shift (Firefox).
  • Control Option (Safari).

 

If it's successful, return to your default browser and perform a clear cache to refresh the system. However, if the issue persists, try using other supported browsers.

 

You can also visit our website for more tips and other resources you can use in the future: Self-help articles.

 

Please let me know in the comment section below if you have more questions about this or anything else. I'm always here to help. Stay safe.


Thanks for the information, I will try to figure it out for more.

Soumya Goyal
Level 1

Quick Books online Refresh token

Hii QBO community,

We have tried this solution but it is not server error . We are tryin to get access token from refresh token by creating a script mentioned earlier on our own . If its possible , We need technical support on this issue.


Thanks & Regards

LeizylM
QuickBooks Team

Quick Books online Refresh token

Thanks for getting back to us, Soumya Goyal.

 

I'm here to make sure you'll get the right support for your token access concern.

 

Each Refresh Token lasts up to 100 days before it expires. This means that the user need not sign in and grant consent again until this time. However, it can change around a day later or the next time you make the Refresh Token API call, whichever is later.

 

The Intuit Developer Forum is a great way to communicate with our product developers. I suggest you contact them. You can post the details of your token issue here. Many QuickBooks programmers, developers, and specialists are available to assist and guide you through the process.

 

  1. Go to our Intuit Developer support link.
  2. Choose QuickBooks Online.
  3. Click Ask Questions, then tap Sign in or Create Account if prompted.
  4. Type your concern in the box, then select Post a question.

If you need assistance with QuickBooks chores, please visit our QuickBooks Help page for instructions, articles, and connections.

 

Please let me know in the comment section if you have follow-up questions or any QuickBooks concerns. I'm willing to answer them. Keep safe.

luisfbn
Level 1

Quick Books online Refresh token

I'm having the same error. See the following code.

 

$settings = [
'auth_mode' => 'oauth2',
'ClientID' => 'client id',
'ClientSecret' => 'client secret',
'RedirectURI' => 'http://example.test/redirect',
'accessTokenKey' => 'token key',
'refreshTokenKey' => 'refresh token key',
'QBORealmID' => 'my realm',
'scope' => 'com.intuit.quickbooks.accounting',
'baseUrl' => 'Development'
];
$dataService = DataService::Configure($settings);

$OAuth2LoginHelper = $dataService->getOAuth2LoginHelper();

try {
$refreshedAccessTokenObj = $OAuth2LoginHelper->refreshToken();
} catch (\Exception $exception) {
// throws exception, answer from QBO
// Incorrect Token type or clientID
var_dump($exception);
}

$error = $OAuth2LoginHelper->getLastError();
if($error){
echo 'got error'.PHP_EOL;
var_dump($error);
} else {
echo 'update auth token'.PHP_EOL;
//Refresh Token is called successfully
$dataService->updateOAuth2Token($refreshedAccessTokenObj);
}

// the token is valid
// I can see company info
echo 'get company info'.PHP_EOL;
print_r($dataService->getCompanyInfo());

 

chris tilby
Level 1

Quick Books online Refresh token

We do not use quick books online anymore. We tried to go from desktop pro to online we hated it, so we canceled it. and went back to desktop pro and we all so use pos in two locations and now we keep getting a  warning saying we need to purchase a token for quick books online, which we do not use anymore could you please  advice 

TirzahC
QuickBooks Team

Quick Books online Refresh token

Hi, chris tilby.
 

Since your concern about a warning saying we need to purchase a token for QuickBooks Online, which we do not use anymore. I would advise contacting our Support team. They can check the file and see what's causing the error message to appear.  

 

  1. Go to the Help menu.
  2. Select QuickBooks Desktop Help.
  3. Click the Contact us option at the bottom.
  4. Follow the on-screen instructions and tell us about your purchased token concern.
  5. Scroll down and choose how you want to connect with a QuickBooks expert.

I've collated some of our resources that you can use as a reference. These links will serve as a guide in navigating QuickBooks: QBDT Help articles.

 

Let me know if I can be of additional assistance by posting below. Hope you have a good rest of your week. 

Sign in for expert help
Ask questions, post replies & join our community of QuickBooks users.

Need to get in touch?

Contact us