whoops
This commit is contained in:
1 parent
4a88f1ec53
commit
f652b108f4
2 files changed
+7
-7
No files matched your search
+2
-1
@@ -298,7 +298,8 @@ async def update_itm(item_id: str, lego_set: dict, item_data: dict = None):
|
|||||||
"amount": price_in_cents,
|
"amount": price_in_cents,
|
||||||
"currency": "USD",
|
"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
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ List all Square categories with their IDs to help identify the correct LEGO cate
|
|||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import json
|
import json
|
||||||
from asquare import client
|
from . import asquare
|
||||||
|
from . import get_sq_env
|
||||||
|
|
||||||
|
|
||||||
async def list_categories():
|
async def list_categories():
|
||||||
@@ -30,7 +31,7 @@ async def list_categories():
|
|||||||
if cursor:
|
if cursor:
|
||||||
search_params["cursor"] = 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())
|
result_json = json.loads(result.model_dump_json())
|
||||||
|
|
||||||
if not result_json.get("objects"):
|
if not result_json.get("objects"):
|
||||||
@@ -47,7 +48,7 @@ async def list_categories():
|
|||||||
print(f" ID: {category_id}")
|
print(f" ID: {category_id}")
|
||||||
|
|
||||||
# Count items in this category
|
# Count items in this category
|
||||||
items_result = await client.catalog.search(
|
items_result = await asquare.client.catalog.search(
|
||||||
object_types=["ITEM"],
|
object_types=["ITEM"],
|
||||||
query={
|
query={
|
||||||
"exact_query": {
|
"exact_query": {
|
||||||
@@ -72,9 +73,7 @@ async def list_categories():
|
|||||||
print("=" * 60 + "\n")
|
print("=" * 60 + "\n")
|
||||||
|
|
||||||
# Show current configured category
|
# Show current configured category
|
||||||
from get_sq_env import LEGO_CAT_ID
|
print(f"Currently configured LEGO_CAT_ID: {get_sq_env.LEGO_CAT_ID}")
|
||||||
|
|
||||||
print(f"Currently configured LEGO_CAT_ID: {LEGO_CAT_ID}")
|
|
||||||
print("\nUpdate .env file with the correct category ID if needed:")
|
print("\nUpdate .env file with the correct category ID if needed:")
|
||||||
print('SQUARE_LEGO_CAT_ID = "YOUR_CATEGORY_ID_HERE"')
|
print('SQUARE_LEGO_CAT_ID = "YOUR_CATEGORY_ID_HERE"')
|
||||||
print()
|
print()
|
||||||
|
|||||||
Reference in new issue
Block a user