Retrieve access token details
Call this Token Details
API endpoint to the retrieve the permissions or OAuth 2.0 scopes a seller has granted to your application and the validity window of the current access token. The response organizes scope by API category such as Items, Orders, or Reports, and provides normalized access levels for example, view only or full access.
As best practice, scope only the permissions you need. Request more access later using re-consent. Store the access token and refresh token securely. To start selling on Walmart Marketplace using the Marketplace APIs, refer to Get started as a seller or Get started as a solution provider.
This page describes an example using only the required parameters and inputs to retrieve access token details. For a full list of customization options and additional capabilities, refer to Token Details.
Endpoint
GET https://marketplace.walmartapis.com/v3/token/detail
Sample request
This sample request shows how to request details about OAuth2.0 scopes and the validity window of the current access token.
curl --request GET \
--url https://marketplace.walmartapis.com/v3/token/detail \
--header 'accept: application/json' \
--header 'authorization: Basic eW91cl9pZDp5b3VyX3NlY3JldA==' \
--header 'WM_QOS.CORRELATION_ID: <uuid>'
import requests url = "https://marketplace.walmartapis.com/v3/token/detail" headers = { "Accept": "application/json", "Authorization": "Basic eW91cl9pZDp5b3VyX3NlY3JldA==", "WM_QOS.CORRELATION_ID": "<uuid>",
} response = requests.get(url, headers=headers)
print(response.status_code)
print(response.text)
Sample response
This sample response displays the validity of the access token and the OAuth2.0 scopes that the seller has been granted.
{ "expire_at": "1560973098000", "issued_at": "1560972198000", "is_valid": true, "scopes": { "reports": "view_only", "item": "full_access", "price": "no_access", "lagtime": "full_access", "feeds": "view_only", "returns": "full_access", "orders": "full_access", "inventory": "full_access", "content": "full_access" }
}
Common scenarios
You can use this API to do a scope check and to review the validity of access tokens.
- Verify access - Ensure that you have the right level of access before making API calls. For example, if your feature required order write access, ensure that scopes contents
"orders": "full_access"
before you call the Acknowledge orders or the Ship order lines API. If the scope permission is missing, prompt re-consent with additional scope. - Verify token validity - Ensure that your access token is within the validity window. If the access token is expired, use your refresh token to obtain an new access token and then retry your call. To refresh an access token, use the Token API.
Updated 1 day ago