INVENTORY_CHANGED
Important
The Buy with Prime API is offered as a preview and might change as we receive feedback and iterate on the interfaces. We are sharing this early documentation to help you learn about the Buy with Prime API as we write and iterate on the content.
The INVENTORY_CHANGED
event is sent when the available quantity for a Buy with Prime-eligible product changes. You can use inventory levels for your own reporting, such as for alarming when inventory reaches a low threshold.
The available number of products is a point in time calculation, with potential delays. To determine whether a shopper can order an item through Buy with Prime, we recommend that you determine inventory based on whether a call to the Delivery Preview interface succeeds instead. If you encounter an ItemAmountUnavailable
error, the requested quantity isn't available. For examples of calling the Delivery Preview interface, see Create a Delivery Preview for a Product Detail Page and Create a Delivery Preview for Checkout.
For details on the schema and fields of an event, see Subscribe to Events.
Required permission
To subscribe to this event, your API credentials must have at least Read Inventory permission. You choose permissions when you generate your API credentials. For details, see Authenticate to the Buy with Prime API.
Handling the event
When you receive this event, parse the resources
array of the event for the inventory item ID of the associated item. You can then use the inventoryItem
query to find the available inventory and the SKU of the item.
In some cases, when you use the inventoryItem
query you might receive the following error.
{
"errors": [
{
"message": "Input request is not valid, the following issues were encountered: This item is not associated with a valid mSKU",
"locations": [
{
"line": 2,
"column": 23
}
],
"path": [
"inventoryItem"
],
"extensions": {
"classification": {
"type": "ValidationError",
"code": "InvalidAmazonSkuConfiguration" // or MissingAmazonSkuConfiguration
}
}
}
]
}
This error means that Buy with Prime can't find the specified mSKU in Seller Central, so Buy with Prime can't retrieve the associated inventory quantities. A way to fix this error is to find the correct mSKU for the product on Seller Central, and then to upload a new catalog with the correct mSKU.
This error can have one of the following two error codes:
MissingAmazonSkuConfiguration
: You didn't specify an mSKU for this product when you uploaded the catalog. To fix this issue, upload the catalog with an mSKU for that product.InvalidAmazonSkuConfiguration
: The mSKU isn't valid, so Buy with Prime couldn't find the mSKU in Seller Central. In this case, check the mSKU that you used when you uploaded the catalog to Buy with Prime, and make sure that it matches the mSKU you find for that product in Seller Central.
Related topics
Updated 4 days ago