Inventory API Missing Results If Queried "Too Soon"

NathW
Visitor
1 0 0

Good morning,

 

We have noticed an issue where when querying the inventory within a certain amount of time (undetermined yet) of the update taking place, the results are missing.

 

For example; if at 09:30 I make this request:

https://shop.myshopify.com/admin/api/2021-07/inventory_levels.json?location_ids=123456789&updated_at_min=2021-09-27T09:15:00+01:00

The response is:

{"inventory_levels":[]}

 

However if I were to make the same request later, e.g. 09:50, then the response is:

{
	"inventory_levels": [
		{
			"inventory_item_id": 987654321,
			"location_id": 123456789,
			"available": 5,
			"updated_at": "2021-09-27T09:24:40+01:00",
			"admin_graphql_api_id": "gid://shopify/InventoryLevel/123456789?inventory_item_id=987654321"
		}
	]
}

 

So the question is; why was the inventory that was updated at 09:24:40 not returned in the API response that was made at 09:30?

Reply 1 (1)

awwdam
Shopify Staff
249 42 36

Hey @NathW

Would you be able provide me with example x-request-id response headers from each request you would make in your intended process? If you don't have these from the initial requests mentioned here, I would suggest logging these while replicating the initial steps you followed. We can use these id to check logs on our end, confirm functionality, and pass back any insights or next steps.

Happy to keep an eye out here - Cheers. 

awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog