Delete inventory
Remove an inventory record for a product.
Mutation
mutation DeleteInventory($id: Int!) {
inventoryDelete(id: $id) {
__typename
}
}
Variables
{
"id": 98422
}
Response
{
"data": {
"inventoryDelete": {
"__typename": "InventoryDeleteResponse"
}
}
}
How it works
Pass the inventory record id (not the product ID) to delete a specific stock entry. The response type has no fields of its own, so select __typename: a response without errors means the record was deleted. If no inventory record has that id, the mutation returns an INVENTORY_NOT_FOUND_ERROR error. Deleting an inventory record does not affect other inventory records for the same product in different warehouses.
See also
- Create inventory — add a stock record
- Fetch product stock across warehouses — query inventory from the storefront