diff --git a/src/asquare.py b/src/asquare.py index ed8f46d..76b54b8 100644 --- a/src/asquare.py +++ b/src/asquare.py @@ -64,8 +64,9 @@ async def get_item_by_id(item_id: str) -> dict: Exception: If item not found or API error """ try: - result = await client.catalog.batch_retrieve_catalog_objects( - body={"object_ids": [item_id], "include_related_objects": True} + result = await client.catalog.search( + object_types=["ITEM"], + query={"exact_query": {"attribute_name": "id", "attribute_value": item_id}}, ) result_json = json.loads(result.model_dump_json()) @@ -107,9 +108,12 @@ async def get_item_by_variation_id(variation_id: str) -> dict: Exception: If variation/item not found or API error """ try: - # Get variation object using batch_retrieve - result = await client.catalog.batch_retrieve_catalog_objects( - body={"object_ids": [variation_id], "include_related_objects": True} + # Get variation object using search + result = await client.catalog.search( + object_types=["ITEM_VARIATION"], + query={ + "exact_query": {"attribute_name": "id", "attribute_value": variation_id} + }, ) result_json = json.loads(result.model_dump_json())