Update Inventory in Catalog

You can update the inventory details of specific items by sending a request to the Cataloglake API using the following code:

Python

try:
catalog_inventory_update = catalog.update_inventory(inventory_object)
print("catalog_inventory_data----", catalog_inventory_update)
except Exception as e:
    print(f"Error updating inventory: {e}")

Example Inventory Object

{
    "items": [
        {
            "groc_item_id": "2640001967",
            "inventory_info": {
                "qty": "1",
                "min_qty": "1",
                "max_qty": "2",
                "is_in_stock": "1"
            }
        }
    ]
}

Example App Code

inventory_object = {
  "items": [
    {
      "groc_item_id": "2466313886",
       "inventory_info": {
        "qty": "10",
        "min_qty": "1",
        "max_qty": "2",
        "is_in_stock": "1"
      }
    }
    ]
}

catalog_inventory_update = catalog.update_inventory(inventory_object)
print("catalog_inventory_data----", catalog_inventory_update)

#RESPONSE OBJECT

# {
#     "api_action_status": "success",
#     "items": [
#         {
#             "groc_item_id": 2466313886,
#             "updated_qty": 10,
#             "is_in_stock": 1,
#             "updated_at": "2024-10-29 22:05:19"
#         }
#     ]
# }

Last updated