selling-partner-api icon indicating copy to clipboard operation
selling-partner-api copied to clipboard

Manually check ttoken expire before request

Open Braindea7 opened this issue 3 months ago • 0 comments

Problem description:

Hey, we use your library for various purposes, including obtaining various reports and reading the inventory of several seller accounts.

Unfortunately, we have recently been experiencing an increasing number of problems with tokens becoming invalid and requests returning a 403 error.

There are two possible scenarios. In one case, a report is requested with an invalid token and a 403 error is returned immediately. In the other case, the token expires ‘in the middle’ of a recursive function (to retrieve all pages) that retrieves the entire inventory of an account via the InventoryAPI.

Is there a way to check the token again with your library before a request and, if necessary, manually initiate the renewal process?

Error:

(403) "Access to requested resource is denied.", "details": "The access token you provided has expired."

Braindea7 avatar Nov 27 '25 10:11 Braindea7