Get inventory count for an item
Call this endpoint to retrieve the inventory for a given SKU. When the shipNode
parameter is omitted, the API returns the inventory count for the default ship node along with the inventory available date. Use this endpoint to provide an overview of the stock level of a specific SKU.
Note: This page describes an example using only the required parameters and inputs for getting an item's inventory count. For a full list of customization options and additional capabilities, refer to the Marketplace Inventory API reference.
Endpoint
GET https://marketplace.walmartapis.com/v3/inventory?sku={SKU}
Sample request
This sample describes how to retrieve inventory for a specific SKU using the GET /v3/inventory
endpoint. The query parameter sku=SKU_0001
identifies which SKU to retrieve. When a shipNode
parameter isn't included, the API returns inventory from the default ship node along with the inventory available date.
curl -X GET "https://marketplace.walmartapis.com/v3/inventory?sku=SKU_0001" \ -H "Authorization: Basic <Base64EncodedConsumerKey:ConsumerSecret>" \ -H "WM_SVC.NAME: Walmart Marketplace" \ -H "WM_QOS.CORRELATION_ID: 1234567890" \ -H "Accept: application/json" \ -H "Content-Type: application/json"
import requests sku = "SKU_0001" # Replace with your actual SKU
url = f"https://marketplace.walmartapis.com/v3/inventory?sku={sku}" headers = { "Authorization": "Basic <Base64EncodedConsumerKey:ConsumerSecret>", "WM_SVC.NAME": "Walmart Marketplace", "WM_QOS.CORRELATION_ID": "1234567890", "Accept": "application/json", "Content-Type": "application/json"
} response = requests.get(url, headers=headers)
print("Status code:", response.status_code)
print("Response JSON:", response.json())
Modify your code
- Replace
SKU_0001
in the request URL or parameters with your SKU. - Update the
Authorization header
with your Base64-encoded client ID and client secret pair.
Sample response
{ "sku": "SKU_0001", "quantity": { "unit": "EACH", "amount": 10 }, "inventoryAvailableDate": "YYYY-MM-DD"
}
Result
If successful, the API response returns an HTTP status: 200 OK
with a JSON response containing the SKU for the item.
Next step
Update the inventory for a given item.
Updated 9 days ago