How to make bulk updates on prices and quantities via API on python?

Topic summary

A developer needs to bulk update prices and inventory quantities for over 10,000 items via Python API but finds individual updates too slow (requiring sleep delays).

Initial Approach & Problem:

  • Currently updating items one-by-one using REST API with shopify.Product.find() and InventoryLevel.set()
  • This method is inefficient for large-scale updates

Recommended Solutions:
Shopify support suggests two approaches:

  1. GraphQL bulk mutations for asynchronous large-volume updates
  2. Specific mutations:
    • productVariantsBulkUpdate for prices
    • inventoryBulkAdjustQuantityAtLocation for inventory (deprecated as of API 2024-04)
    • inventoryAdjustQuantities (current replacement)

Key Issues Identified:

  • REST endpoint inventory_levels/set.json only accepts single items per call, not bulk arrays
  • inventoryBulkAdjustQuantityAtLocation was deprecated and removed in API version 2024-04
  • The developer needs to set absolute values, not adjust relative quantities, but no bulk “set” mutation exists for inventory
  • inventorySetOnHandQuantities doesn’t support bulk operations

Current Status:
Multiple users struggling with implementation. One user reports 10+ hours attempting various approaches without success, encountering errors with both REST and GraphQL methods across different API versions.

Summarized with AI on November 9. AI used: claude-sonnet-4-5-20250929.

If I use the function update_products_in_bulk() with json_payload return the error =

Error updating batch 1: Status Code 400, Response: {“errors”:{“inventory_item_id”:“Required parameter missing or invalid”}}
Processed batch 1/1: {“errors”:[{“message”:“Field ‘inventoryBulkAdjustQuantityAtLocation’ doesn’t exist on type ‘Mutation’”,“locations”:[{“line”:3,“column”:9}],“path”:[“mutation”,“inventoryBulkAdjustQuantityAtLocation”],“extensions”:{“code”:“undefinedField”,“typeName”:“Mutation”,“fieldName”:“inventoryBulkAdjustQuantityAtLocation”}},{“message”:“Variable $inventoryItemAdjustments is declared by anonymous mutation but not used”,“locations”:[{“line”:2,“column”:9}],“path”:[“mutation”],“extensions”:{“code”:“variableNotUsed”,“variableName”:“inventoryItemAdjustments”}},{“message”:“Variable $locationId is declared by anonymous mutation but not used”,“locations”:[{“line”:2,“column”:9}],“path”:[“mutation”],“extensions”:{“code”:“variableNotUsed”,“variableName”:“locationId”}}]}

this function only work with json_payload_b