- DATE:
- AUTHOR:
- The Toast - API team
Stock API inventory update endpoint behavior change
The behavior of the /stock/v1/inventory/update
endpoint of the stock API will change on 2024-08-26. The endpoint will no longer return an error response if some menu items in the request are not found in the restaurant location menu configuration. After the behavior change, the endpoint will make updates to inventory information for menu items in an update request, even if some menu items are not found.
Currently, if any menu item identifier in an update request is invalid (the identifier does not match an active menu item configured for the restaurant location), the endpoint returns an HTTP 404 response listing each invalid identifier and does not take any action.
On 2024-08-26, if any menu item identifier in an update request is invalid, the endpoint will return an HTTP 200 response and will update the inventory information for each menu item in the request that matches existing menu items. The response body will include an array of the
MenuItemInventory
objects in your request. TheitemGuidValidity
value in each object will indicate whether the menu item was found and the inventory information updated or not found and no action was taken. If a menu item status isINVALID
, your integration should update the list of menu items it associates with the restaurant location.
The following example shows the HTTP 200 response data that you will receive from the /stock/v1/inventory/update
endpoint starting on 2024-08-26.
[
{
"guid": "e1e874d8-08fe-40dd-88b7-03686a2fbaf5",
"itemGuidValidity": "VALID", //See comment (1) below.
"status": "QUANTITY",
"quantity": 70.0,
"multiLocationId": "200000008746447369",
"versionId": "e1e874d8-08fe-40dd-88b7-03686a2fbaf5"
},
{
"guid": "12ed7e46-58cf-42bf-817d-2c3980b82a20",
"itemGuidValidity": "INVALID", // See comment (2) below.
"status": "QUANTITY",
"quantity": 80.0,
"multiLocationId": "200000008746446309",
"versionId": "12ed7e46-58cf-42bf-817d-2c3980b82a20"
}
]
(1) When a menu item identifier in the inventory update request matches a menu item configured for the restaurant location, the itemGuidValidity value is VALID. This indicates that the API updated the inventory information for that menu item.
(2) On 2024-08-26, the endpoint will return an HTTP 200 response even when some menu item identifiers do not match menu items configured for the restaurant location. In the response data, the MenuItemInventory object for each menu item that is not found at the restaurant location will include the itemGuidValidity value INVALID. This indicates that the API did not find the menu item and did not update any inventory information for it.