Closed bschembri-UoM closed 2 years ago
@bschembri-UoM Most likely you're using an old value of the refresh token.
Notice that once QuickBooks class instance is created the new value of the refresh token is saved as the intance property https://github.com/ej2/python-quickbooks/blob/master/quickbooks/client.py#L84
It might not be quite obvious, but the refresh token changes it's value once a day. When you request a new access token, API might return a new value of the refresh token as well. Next time you'll need this new value to refresh access token. If you fail to do that and use the original value of the refresh token instead you'll get the "invalid grant" error.
Here's the docs section that you might find helpful https://help.developer.intuit.com/s/article/Validity-of-Refresh-Token
Am trying to use the library but the bellow error; intuitlib.exceptions.AuthClientError: HTTP status 400, error message: b'{"error_description":"Incorrect or invalid refresh token","error":"invalid_grant"}', intuit_tid 1-6283b427-062f1d215a21a12048b92b5e at time Tue, 17 May 2022 14:41:43 GMT
This is the piece of code I have to be able to get some understanding of what and how I can do things with the library;
I have commented the access_token part with the understanding that the Quickbooks client will get a new access token. I also tried with the access_token set but am not sure how to get the actual access token to be able to pass this to the AuthClient.
What am I missing and how can this be resolved?
Thank you in advance.