Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
Hello,
We'd like to keep track of all Product Inventory Adjustments, by Variant. Is there an API endpoint to retrieve that information? I'm aware of how to retrieve the current inventory count and information about transfers, but what I'm interested in is the history log of all "update quantity" actions in the Inventory tab. This is of course necessary both for auditing and accounting reasons.
Thank you!
neewadogs.com
Hi Dario,
There isn't an API I've seen that can show you the history of a product/variant but you could build a log yourself using the webhook API. If you set up a webhook for products updates, Shopify would send a request to your server each time a product is modified. The request would include the current state of the product so you could save those and then you would have a historical record of how the product was.
There's more info on setting up webhooks at https://help.shopify.com/api/reference/webhook
Best,
Daniel
Hi Dario,
I am not aware of any way to query past inventory adjustments.
You could however subscribe to the inventory_levels/update webhook topic and keep track of such events yourself.
Hope this helps!
Oh, sorry, didn't realize this is such an old post.
Seems the forum got jumbled up as all of a sudden there's a few very old posts popping up among new ones!
I see that there is a non-public API called inventoryAdjustments that Shopify is using on the product's inventory history page:
query InventoryHistory($first: Int, $last: Int, $after: String, $before: String, $query: String) {
inventoryAdjustments(first: $first, last: $last, after: $after, before: $before, query: $query) {
edges {
node {
app {
id
title
__typename
}
availableDelta
availableQuantity
createdAt
id
reasonMessage
referenceDocument {
__typename
... on InventoryTransfer {
id
name
__typename
}
... on Order {
id
name
__typename
}
... on PurchaseOrder {
id
name
__typename
}
... on Refund {
id
order {
id
name
__typename
}
__typename
}
... on Location
{
id
name
__typename
}
}
staffMember {
id
name
__typename
}
__typename
}
cursor
__typename
}
pageInfo {
hasNextPage
hasPreviousPage
__typename
}
__typename
}
}
Will this be publicly available any time soon? Is it possible to get early access to it?
User | RANK |
---|---|
5 | |
4 | |
4 | |
3 | |
3 |