Our Inventory Update API allows you to update product stock levels in real time by sending a simple POST request. In this guide, we'll explain how to use our API to update inventory using required fields like store code and quantity. We'll also show you how to look up a product using alternative identifiers like SKU, size, and width instead of relying solely on the UPC.
API Overview
Our Inventory Update API is designed to update product stock levels by sending a POST request to:
POST https://YOUR_URL/api/product/inventory
At a minimum, your API request should include the following information:
store: The code that identifies the store where inventory is being updated.
quantity: The number of units currently in stock at that store.
For products identified by UPC, your JSON payload would look like this:
{
"upc": "849632048260",
"store": "3",
"quantity": 12
}
However, in cases where a UPC is not available, or when you prefer to look up the product using other identifiers, our API offers flexibility.
Authentication
You must authenticate your API requests by including a Bearer Token in the headers. This ensures that only authorized requests can modify inventory data. Your headers should be structured as follows:
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json
Alternative Product Lookup Using SKU, Size, and Width
While UPC is a common identifier for products, it's not always the most convenient or preferred method. Our Inventory Update API allows you to identify products using a combination of SKU, size, and width. This flexibility is particularly useful for businesses that manage product variations, such as clothing and footwear, where size and width are critical attributes.
Here’s how you can structure your JSON payload to update inventory by using SKU, size, and width instead of UPC:
{
"sku": "ZOOT-SUIT",
"size": "34",
"width": "D",
"store": "3",
"quantity": 44
}
Required Fields for Alternative Lookup:
sku: The Stock Keeping Unit, which is used to uniquely identify the product within your system.
size: The size of the product (e.g., clothing or shoes).
width: The width of the product (especially useful for shoes).
store: The unique code for the store where inventory is being updated.
quantity: The number of items in stock at the specified store.
Using SKU, size, and width as an alternative to UPC allows for more granular inventory updates, especially when dealing with products that have variations.
Example API Request Using SKU, Size, and Width
Here’s how you can make an API request when identifying a product by SKU, size, and width:
Request URL:
POST https://YOUR_URL/api/product/inventory
Headers:
Authorization: Bearer YOUR_API_TOKEN Content-Type: application/json
Request Body:
{
"sku": "ZOOT-SUIT",
"size": "34",
"width": "D",
"store": "3",
"quantity": 44
}
In this example, the inventory for the product with SKU ZOOT-SUIT, size 34, and width D at store 3 will be updated to reflect a stock quantity of 44 units.
Error Handling
If any required fields are missing from your request, or if your Bearer Token is invalid, the API will return an error message. Here’s an example of what that might look like:
{
"error": "Missing required field: sku"
}
To avoid errors, ensure your payload is correctly formatted and contains all the required fields, and that the Bearer Token is valid and properly set in the headers.