Covers all questions related to inventory management, order fulfillment, and shipping.
Set the inventory level API requires to pass the system-generated Inventory Item ID & Location IDs rather than the generic unique ID's. Since the end systems don't store the System IDs, is there anyway to set the inventory level by passing the SKU code & location code.
Solved! Go to the solution
This is an accepted solution.
No, you should use a query to get all item ids, cache this locally and use it to map the SKUs to location ids. You can use `inventory_levels/connect` and `inventory_levels/disconnect` webhooks to invalidate your local cache.
GraphQL to get all item ids for a location (use a loop with cursor while hasNextPage):
query locationItemIds($locationId: ID!, $cursor: String) {
location(id: $locationId) {
inventoryLevels(first: 250, after: $cursor) {
pageInfo {
hasNextPage
endCursor
}
edges {
node {
item {
legacyResourceId
sku
}
}
}
}
}
}
This is an accepted solution.
No, you should use a query to get all item ids, cache this locally and use it to map the SKUs to location ids. You can use `inventory_levels/connect` and `inventory_levels/disconnect` webhooks to invalidate your local cache.
GraphQL to get all item ids for a location (use a loop with cursor while hasNextPage):
query locationItemIds($locationId: ID!, $cursor: String) {
location(id: $locationId) {
inventoryLevels(first: 250, after: $cursor) {
pageInfo {
hasNextPage
endCursor
}
edges {
node {
item {
legacyResourceId
sku
}
}
}
}
}
}