Fetch Inventory Details from Catalog
You can fetch the inventory details for specific items by sending a request to the Cataloglake API using the following code:
Python
try:
catalog_inventory = CatalogLake().fetch_inventory(payload)
print("catalog_inventory", catalog_inventory)
except Exception as e:
print(f"Error fetching inventory data: {e}")
Example Fetch Inventory Payload
{
"items": [
{
"groc_item_id": "2147483647"
}
]
}
Example App Code
payload = {
"items": [
{
"groc_item_id": "1384267950"
}
]
}
catalog_inventory = CatalogLake().fetch_inventory(payload)
print("catalog_inventory", catalog_inventory)
#RESPONSE FOR CATALOG INVENTORY FETCHH
# {
# "api_action_status": "success",
# "catalog_inventory_fetch_request_id": "1aa5572b-4337-40fc-96bd-8fd611a0ffc9",
# "items": [
# {
# "groc_item_id": 1384267950,
# "inventory_info": {
# "qty": 98.0,
# "min_qty": 0.0,
# "max_qty": 99.0,
# "is_in_stock": 1
# }
# }
# ]
# }
Last updated