This commit is contained in:
C committed 2026-01-04 14:08:10 -08:00
1 parent 4a88f1ec53
commit f652b108f4
2 files changed
+7 -7

No files matched your search

+2 -1
View File
@@ -298,7 +298,8 @@ async def update_itm(item_id: str, lego_set: dict, item_data: dict = None):
"amount": price_in_cents,
"currency": "USD",
},
"sku": set_upc if set_upc else None,
"sku": set_number, # LEGO set number (e.g., "10338")
"upc": set_upc if set_upc else None, # Barcode/GTIN
},
}
+5 -6
View File
@@ -4,7 +4,8 @@ List all Square categories with their IDs to help identify the correct LEGO cate
import asyncio
import json
from asquare import client
from . import asquare
from . import get_sq_env
async def list_categories():
@@ -30,7 +31,7 @@ async def list_categories():
if cursor:
search_params["cursor"] = cursor
result = await client.catalog.search(**search_params)
result = await asquare.client.catalog.search(**search_params)
result_json = json.loads(result.model_dump_json())
if not result_json.get("objects"):
@@ -47,7 +48,7 @@ async def list_categories():
print(f" ID: {category_id}")
# Count items in this category
items_result = await client.catalog.search(
items_result = await asquare.client.catalog.search(
object_types=["ITEM"],
query={
"exact_query": {
@@ -72,9 +73,7 @@ async def list_categories():
print("=" * 60 + "\n")
# Show current configured category
from get_sq_env import LEGO_CAT_ID
print(f"Currently configured LEGO_CAT_ID: {LEGO_CAT_ID}")
print(f"Currently configured LEGO_CAT_ID: {get_sq_env.LEGO_CAT_ID}")
print("\nUpdate .env file with the correct category ID if needed:")
print('SQUARE_LEGO_CAT_ID = "YOUR_CATEGORY_ID_HERE"')
print()