TokenExpired (UnauthorizedException): Amazon Creators API error
What it means
Your access token is older than one hour. Fetch a new one and try again.
Message returned by the API: Authentication token has expired.
Typical causes
- The cached token is older than
expires_in(3600 s). - The server clock is wrong, so your cache thinks the token is still fresh.
How to fix it
- Fetch a new token and retry once.
- Store the expiry time with the token and refresh a minute before it runs out.
- Do not fetch a token per request. The token endpoint rate-limits that.
Not sure which part fails? Run Test credentials in the Scratchpad. It checks the token, the API access and the partner tag separately.
Example response
{
"type": "UnauthorizedException",
"message": "Authentication token has expired.",
"reason": "TokenExpired"
}Related errors
- too_many_requests: You fetched new access tokens too often. A token is valid for an hour, so reuse it instead of fetching one per request.
- InvalidToken: The access token in the Authorization header is broken, incomplete or in the wrong format.