I got an error when i try to update quantity on hand using GraphQL
Field ‘referenceDocument’ doesn’t exist on type 'InventoryAdjustmentGroup
I got an error when i try to update quantity on hand using GraphQL
Field ‘referenceDocument’ doesn’t exist on type 'InventoryAdjustmentGroup
Hi Arnab1,
Should you be using the referenceDocumentUri field for the InventoryAdjustmentGroup object? There does not appear to be a field for referenceDocument.
hi @Liam ,
i want to bulk update quantity on hand on my product variant, how to update that using api?
To update product variant inventory you’ll need to get item IDs, location IDs and then set the inventory levels with this info:
Get the Inventory Item ID: First, you need to identify the inventory_item_id for each variant you want to update. You can obtain this from the Product Variant API with the endpoint: GET /admin/api/2023-07/products/{product_id}/variants.json
Get the Location ID: Inventory levels are associated with specific locations in Shopify with the Location resource. You’ll need the ID of the location where you’re adjusting inventory with this endpoint: GET /admin/api/2023-07/locations.json
Set the Inventory Level:
Once you have the inventory_item_id and location_id, you can set the inventory level for that item at that location with this endpoint: POST /admin/api/2023-07/inventory_levels/set.json
An example payload could be:
{
"location_id": "your_location_id",
"inventory_item_id": "your_inventory_item_id",
"available": "new_quantity"
}
Replace your_location_id, your_inventory_item_id, and new_quantity with the appropriate values.
Hope this helps!
Hi @Liam ,
For using this inventory Level can i update bulk amount of product on hand quantity?