katana_public_api_client.helpers.products¶
katana_public_api_client.helpers.products
¶
Product catalog operations.
Classes¶
Products(client)
¶
Bases: Base
Product catalog management.
Provides CRUD operations and search for products in the Katana catalog.
Example
async with KatanaClient() as client: ... # Search products ... products = await client.products.search("widget") ... ... # CRUD operations ... products = await client.products.list(is_sellable=True) ... product = await client.products.get(123) ... new_product = await client.products.create({"name": "Widget"})
Source code in katana_public_api_client/helpers/base.py
Functions¶
create(product_data)
async
¶
Create a new product.
Parameters:
-
product_data(CreateProductRequest) –CreateProductRequest model with product details.
Returns:
-
KatanaProduct–Created KatanaProduct domain model object.
Example
from katana_public_api_client.models import CreateProductRequest new_product = await client.products.create( ... CreateProductRequest( ... name="New Widget", ... sku="WIDGET-NEW", ... is_sellable=True, ... variants=[], ... ) ... )
Source code in katana_public_api_client/helpers/products.py
delete(product_id)
async
¶
Delete a product.
Parameters:
-
product_id(int) –The product ID to delete.
Example
await client.products.delete(123)
Source code in katana_public_api_client/helpers/products.py
get(product_id)
async
¶
Get a specific product by ID.
Parameters:
-
product_id(int) –The product ID.
Returns:
-
KatanaProduct–KatanaProduct domain model object.
Example
product = await client.products.get(123)
Source code in katana_public_api_client/helpers/products.py
list(**filters)
async
¶
List all products with optional filters.
Parameters:
-
**filters(Any, default:{}) –Filtering parameters (e.g., is_sellable, is_producible, include_deleted).
Returns:
-
list[KatanaProduct]–List of KatanaProduct domain model objects.
Example
products = await client.products.list(is_sellable=True, limit=100)
Source code in katana_public_api_client/helpers/products.py
search(query, limit=50)
async
¶
Search products by name and category (case-insensitive substring search).
Used by: MCP tool search_products
Note: The Katana API 'name' parameter only does exact matches, so we fetch all products and perform client-side substring searching against product names and categories.
Parameters:
-
query(str) –Search query to match against product names (case-insensitive).
-
limit(int, default:50) –Maximum number of results to return.
Returns:
-
list[KatanaProduct]–List of matching KatanaProduct domain model objects, sorted by relevance.
Example
products = await client.products.search("fox", limit=10) for product in products: ... print(f"{product.id}: {product.name}")
Source code in katana_public_api_client/helpers/products.py
update(product_id, product_data)
async
¶
Update an existing product.
Parameters:
-
product_id(int) –The product ID to update.
-
product_data(UpdateProductRequest) –UpdateProductRequest model with fields to update.
Returns:
-
KatanaProduct–Updated KatanaProduct domain model object.
Example
from katana_public_api_client.models import UpdateProductRequest updated = await client.products.update( ... 123, UpdateProductRequest(name="Updated Name") ... )