March 2023 SP-API Release Announcement
Amazon’s March 2023 SP‑API update shortens the nextToken lifespan to 30 seconds, eliminating blank responses and adding a TokenExpired error. Developers must adjust pagination logic to use tokens within 30 seconds and handle the new error. This change reduces API call failures and improves inventory accuracy.
Overview
In mid‑March 2023, Amazon rolled out a critical update to the SP‑API’s Fulfillment by Amazon (FBA) Inventory API. The change introduces a 30‑second expiration for the nextToken used in pagination, eliminating the blank‑response errors that previously plagued inventory retrieval scripts. Sellers who rely on automated inventory feeds must adjust their integrations right away to keep data accurate and avoid unnecessary API calls.
Key Points
- 30‑Second
nextTokenlifespan — Tokens now expire 30 seconds after issuance, forcing developers to paginate quickly. - Blank‑response error eliminated — The update stops empty responses that were triggered by expired or misused
nextTokenvalues. startDateTimenow works with pagination — The API correctly handlesstartDateTimeparameters alongsidenextToken, ensuring accurate inventory snapshots.- Legacy calls remain functional — Existing API requests that omit
nextTokencontinue to work unchanged, preserving backward compatibility. - Clear error messages for expired tokens — Requests with an expired token now return a specific “TokenExpired” error instead of a silent failure.
- Security and performance gains — Shorter token validity reduces the risk of replay attacks and cuts down on redundant pagination attempts.
How the Updated API Works
- Initial inventory request — Call
GetInventorySupplywith an optionalstartDateTime.- Example:
GET /fba/inventory/v1/supplies?startDateTime=2023-03-01T00:00:00Z.
- Example:
- Receive first page — The response includes inventory items and a
nextTokenif more data exists.- Example:
nextToken: "abc123".
- Example:
- — Store the token and note the exact time it was received; plan to use it within 30 seconds.
Analysis & Recommendations
Why This Matters
The 30‑second token window means scripts that pause for minutes will now receive TokenExpired errors, forcing retries and increasing API usage. By handling the error and paginating promptly, sellers avoid unnecessary calls, reduce latency, and keep inventory data up‑to‑date.
Key Takeaways
- nextToken now expires 30 seconds after issuance, requiring pagination within that window
- Blank responses are eliminated; expired tokens now return a TokenExpired error
- `startDateTime` works alongside nextToken for accurate snapshots
- Legacy calls without nextToken remain functional, preserving backward compatibility
Recommended Actions
- →Update your inventory scripts to log the issuance timestamp of each nextToken and enforce a 30‑second usage window before making the next request.
- →Add error handling for the TokenExpired response; on receipt, immediately request a fresh token instead of retrying the same one.
- →Test pagination with a 20‑second delay between requests to confirm tokens stay valid and monitor API logs for any TokenExpired errors.
Comments
Join the discussion
Log in or create an account to share your thoughts on this update.
No comments yet. Be the first to share your thoughts!