From 6d376c365383786dbd5faa2c6f17b4f220b9229a Mon Sep 17 00:00:00 2001 From: C <0xicl33n@gmail.com> Date: Sun, 4 Jan 2026 11:38:02 -0800 Subject: [PATCH] i think were going in circles --- src/asquare.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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())