From 5cbbed19928c9c3041c94e34cbff59f0c0f42e00 Mon Sep 17 00:00:00 2001 From: C <0xicl33n@gmail.com> Date: Sun, 4 Jan 2026 12:21:15 -0800 Subject: [PATCH] SQUARE THESE NUTS --- src/asquare.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/asquare.py b/src/asquare.py index c09fdda..5125230 100644 --- a/src/asquare.py +++ b/src/asquare.py @@ -289,22 +289,22 @@ async def update_itm(item_id: str, lego_set: dict, item_data: dict = None): print(f"[@DEBUG] Upserting item {item_id} with name: {pw_name}") - # Perform upsert using batch_upsert_catalog_objects (async version) - result = await client.catalog.batch_upsert_catalog_objects( - body={ - "idempotency_key": upsert_body["idempotency_key"], - "batches": [{"objects": [upsert_body["object"]]}], - } + # Perform upsert using catalog.object.upsert + result = await client.catalog.object.upsert( + idempotency_key=upsert_body["idempotency_key"], + object=upsert_body["object"], ) result_json = json.loads(result.model_dump_json()) - if result_json.get("objects"): + if result_json.get("catalog_object"): print(f"[@DEBUG] ✓ Successfully updated item {item_id}") # TODO: Handle image upload separately (Square Images API) # This requires multipart/form-data upload return True else: - print(f"[@ERROR] Failed to update item {item_id}: No objects in response") + print( + f"[@ERROR] Failed to update item {item_id}: No catalog_object in response" + ) return False except Exception as e: