Skip to content

katana_public_api_client.api.product.create_product

katana_public_api_client.api.product.create_product

Classes

Functions

asyncio(*, client, body) async

Create a product

Creates a product object.

Parameters:

  • body (CreateProductRequest) –

    Request payload for creating a new finished product with variants, configurations, and manufacturing specifications Example: {'name': 'Professional Kitchen Knife Set', 'uom': 'set', 'category_name': 'Kitchen Equipment', 'is_sellable': True, 'is_producible': True, 'is_purchasable': False, 'is_auto_assembly': False, 'additional_info': 'High-quality steel construction with ergonomic handles', 'batch_tracked': False, 'serial_tracked': True, 'operations_in_sequence': True, 'lead_time': 14, 'minimum_order_quantity': 1, 'configs': [{'name': 'Piece Count', 'values': ['6-piece', '8-piece', '12-piece']}, {'name': 'Handle Material', 'values': ['Steel', 'Wooden', 'Composite']}], 'variants': [{'sku': 'KNF- PRO-8PC-STL', 'sales_price': 299.99, 'purchase_price': 150.0, 'supplier_item_codes': ['KNF-8PC-STEEL-001'], 'lead_time': 14, 'minimum_order_quantity': 1, 'config_attributes': [{'config_name': 'Piece Count', 'config_value': '8-piece'}, {'config_name': 'Handle Material', 'config_value': 'Steel'}]}]}.

Raises:

  • UnexpectedStatus

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException

    If the request takes longer than Client.timeout.

Returns:

Source code in katana_public_api_client/api/product/create_product.py
async def asyncio(
    *,
    client: AuthenticatedClient | Client,
    body: CreateProductRequest,
) -> DetailedErrorResponse | ErrorResponse | Product | None:
    """Create a product

     Creates a product object.

    Args:
        body (CreateProductRequest): Request payload for creating a new finished product with
            variants, configurations, and manufacturing
            specifications
             Example: {'name': 'Professional Kitchen Knife Set', 'uom': 'set', 'category_name':
            'Kitchen Equipment', 'is_sellable': True, 'is_producible': True, 'is_purchasable': False,
            'is_auto_assembly': False, 'additional_info': 'High-quality steel construction with
            ergonomic handles', 'batch_tracked': False, 'serial_tracked': True,
            'operations_in_sequence': True, 'lead_time': 14, 'minimum_order_quantity': 1, 'configs':
            [{'name': 'Piece Count', 'values': ['6-piece', '8-piece', '12-piece']}, {'name': 'Handle
            Material', 'values': ['Steel', 'Wooden', 'Composite']}], 'variants': [{'sku': 'KNF-
            PRO-8PC-STL', 'sales_price': 299.99, 'purchase_price': 150.0, 'supplier_item_codes':
            ['KNF-8PC-STEEL-001'], 'lead_time': 14, 'minimum_order_quantity': 1, 'config_attributes':
            [{'config_name': 'Piece Count', 'config_value': '8-piece'}, {'config_name': 'Handle
            Material', 'config_value': 'Steel'}]}]}.


    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.


    Returns:
        Union[DetailedErrorResponse, ErrorResponse, Product]
    """

    return (
        await asyncio_detailed(
            client=client,
            body=body,
        )
    ).parsed

asyncio_detailed(*, client, body) async

Create a product

Creates a product object.

Parameters:

  • body (CreateProductRequest) –

    Request payload for creating a new finished product with variants, configurations, and manufacturing specifications Example: {'name': 'Professional Kitchen Knife Set', 'uom': 'set', 'category_name': 'Kitchen Equipment', 'is_sellable': True, 'is_producible': True, 'is_purchasable': False, 'is_auto_assembly': False, 'additional_info': 'High-quality steel construction with ergonomic handles', 'batch_tracked': False, 'serial_tracked': True, 'operations_in_sequence': True, 'lead_time': 14, 'minimum_order_quantity': 1, 'configs': [{'name': 'Piece Count', 'values': ['6-piece', '8-piece', '12-piece']}, {'name': 'Handle Material', 'values': ['Steel', 'Wooden', 'Composite']}], 'variants': [{'sku': 'KNF- PRO-8PC-STL', 'sales_price': 299.99, 'purchase_price': 150.0, 'supplier_item_codes': ['KNF-8PC-STEEL-001'], 'lead_time': 14, 'minimum_order_quantity': 1, 'config_attributes': [{'config_name': 'Piece Count', 'config_value': '8-piece'}, {'config_name': 'Handle Material', 'config_value': 'Steel'}]}]}.

Raises:

  • UnexpectedStatus

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException

    If the request takes longer than Client.timeout.

Returns:

Source code in katana_public_api_client/api/product/create_product.py
async def asyncio_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateProductRequest,
) -> Response[DetailedErrorResponse | ErrorResponse | Product]:
    """Create a product

     Creates a product object.

    Args:
        body (CreateProductRequest): Request payload for creating a new finished product with
            variants, configurations, and manufacturing
            specifications
             Example: {'name': 'Professional Kitchen Knife Set', 'uom': 'set', 'category_name':
            'Kitchen Equipment', 'is_sellable': True, 'is_producible': True, 'is_purchasable': False,
            'is_auto_assembly': False, 'additional_info': 'High-quality steel construction with
            ergonomic handles', 'batch_tracked': False, 'serial_tracked': True,
            'operations_in_sequence': True, 'lead_time': 14, 'minimum_order_quantity': 1, 'configs':
            [{'name': 'Piece Count', 'values': ['6-piece', '8-piece', '12-piece']}, {'name': 'Handle
            Material', 'values': ['Steel', 'Wooden', 'Composite']}], 'variants': [{'sku': 'KNF-
            PRO-8PC-STL', 'sales_price': 299.99, 'purchase_price': 150.0, 'supplier_item_codes':
            ['KNF-8PC-STEEL-001'], 'lead_time': 14, 'minimum_order_quantity': 1, 'config_attributes':
            [{'config_name': 'Piece Count', 'config_value': '8-piece'}, {'config_name': 'Handle
            Material', 'config_value': 'Steel'}]}]}.


    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.


    Returns:
        Response[Union[DetailedErrorResponse, ErrorResponse, Product]]
    """

    kwargs = _get_kwargs(
        body=body,
    )

    response = await client.get_async_httpx_client().request(**kwargs)

    return _build_response(client=client, response=response)

sync(*, client, body)

Create a product

Creates a product object.

Parameters:

  • body (CreateProductRequest) –

    Request payload for creating a new finished product with variants, configurations, and manufacturing specifications Example: {'name': 'Professional Kitchen Knife Set', 'uom': 'set', 'category_name': 'Kitchen Equipment', 'is_sellable': True, 'is_producible': True, 'is_purchasable': False, 'is_auto_assembly': False, 'additional_info': 'High-quality steel construction with ergonomic handles', 'batch_tracked': False, 'serial_tracked': True, 'operations_in_sequence': True, 'lead_time': 14, 'minimum_order_quantity': 1, 'configs': [{'name': 'Piece Count', 'values': ['6-piece', '8-piece', '12-piece']}, {'name': 'Handle Material', 'values': ['Steel', 'Wooden', 'Composite']}], 'variants': [{'sku': 'KNF- PRO-8PC-STL', 'sales_price': 299.99, 'purchase_price': 150.0, 'supplier_item_codes': ['KNF-8PC-STEEL-001'], 'lead_time': 14, 'minimum_order_quantity': 1, 'config_attributes': [{'config_name': 'Piece Count', 'config_value': '8-piece'}, {'config_name': 'Handle Material', 'config_value': 'Steel'}]}]}.

Raises:

  • UnexpectedStatus

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException

    If the request takes longer than Client.timeout.

Returns:

Source code in katana_public_api_client/api/product/create_product.py
def sync(
    *,
    client: AuthenticatedClient | Client,
    body: CreateProductRequest,
) -> DetailedErrorResponse | ErrorResponse | Product | None:
    """Create a product

     Creates a product object.

    Args:
        body (CreateProductRequest): Request payload for creating a new finished product with
            variants, configurations, and manufacturing
            specifications
             Example: {'name': 'Professional Kitchen Knife Set', 'uom': 'set', 'category_name':
            'Kitchen Equipment', 'is_sellable': True, 'is_producible': True, 'is_purchasable': False,
            'is_auto_assembly': False, 'additional_info': 'High-quality steel construction with
            ergonomic handles', 'batch_tracked': False, 'serial_tracked': True,
            'operations_in_sequence': True, 'lead_time': 14, 'minimum_order_quantity': 1, 'configs':
            [{'name': 'Piece Count', 'values': ['6-piece', '8-piece', '12-piece']}, {'name': 'Handle
            Material', 'values': ['Steel', 'Wooden', 'Composite']}], 'variants': [{'sku': 'KNF-
            PRO-8PC-STL', 'sales_price': 299.99, 'purchase_price': 150.0, 'supplier_item_codes':
            ['KNF-8PC-STEEL-001'], 'lead_time': 14, 'minimum_order_quantity': 1, 'config_attributes':
            [{'config_name': 'Piece Count', 'config_value': '8-piece'}, {'config_name': 'Handle
            Material', 'config_value': 'Steel'}]}]}.


    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.


    Returns:
        Union[DetailedErrorResponse, ErrorResponse, Product]
    """

    return sync_detailed(
        client=client,
        body=body,
    ).parsed

sync_detailed(*, client, body)

Create a product

Creates a product object.

Parameters:

  • body (CreateProductRequest) –

    Request payload for creating a new finished product with variants, configurations, and manufacturing specifications Example: {'name': 'Professional Kitchen Knife Set', 'uom': 'set', 'category_name': 'Kitchen Equipment', 'is_sellable': True, 'is_producible': True, 'is_purchasable': False, 'is_auto_assembly': False, 'additional_info': 'High-quality steel construction with ergonomic handles', 'batch_tracked': False, 'serial_tracked': True, 'operations_in_sequence': True, 'lead_time': 14, 'minimum_order_quantity': 1, 'configs': [{'name': 'Piece Count', 'values': ['6-piece', '8-piece', '12-piece']}, {'name': 'Handle Material', 'values': ['Steel', 'Wooden', 'Composite']}], 'variants': [{'sku': 'KNF- PRO-8PC-STL', 'sales_price': 299.99, 'purchase_price': 150.0, 'supplier_item_codes': ['KNF-8PC-STEEL-001'], 'lead_time': 14, 'minimum_order_quantity': 1, 'config_attributes': [{'config_name': 'Piece Count', 'config_value': '8-piece'}, {'config_name': 'Handle Material', 'config_value': 'Steel'}]}]}.

Raises:

  • UnexpectedStatus

    If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

  • TimeoutException

    If the request takes longer than Client.timeout.

Returns:

Source code in katana_public_api_client/api/product/create_product.py
def sync_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateProductRequest,
) -> Response[DetailedErrorResponse | ErrorResponse | Product]:
    """Create a product

     Creates a product object.

    Args:
        body (CreateProductRequest): Request payload for creating a new finished product with
            variants, configurations, and manufacturing
            specifications
             Example: {'name': 'Professional Kitchen Knife Set', 'uom': 'set', 'category_name':
            'Kitchen Equipment', 'is_sellable': True, 'is_producible': True, 'is_purchasable': False,
            'is_auto_assembly': False, 'additional_info': 'High-quality steel construction with
            ergonomic handles', 'batch_tracked': False, 'serial_tracked': True,
            'operations_in_sequence': True, 'lead_time': 14, 'minimum_order_quantity': 1, 'configs':
            [{'name': 'Piece Count', 'values': ['6-piece', '8-piece', '12-piece']}, {'name': 'Handle
            Material', 'values': ['Steel', 'Wooden', 'Composite']}], 'variants': [{'sku': 'KNF-
            PRO-8PC-STL', 'sales_price': 299.99, 'purchase_price': 150.0, 'supplier_item_codes':
            ['KNF-8PC-STEEL-001'], 'lead_time': 14, 'minimum_order_quantity': 1, 'config_attributes':
            [{'config_name': 'Piece Count', 'config_value': '8-piece'}, {'config_name': 'Handle
            Material', 'config_value': 'Steel'}]}]}.


    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.


    Returns:
        Response[Union[DetailedErrorResponse, ErrorResponse, Product]]
    """

    kwargs = _get_kwargs(
        body=body,
    )

    response = client.get_httpx_client().request(
        **kwargs,
    )

    return _build_response(client=client, response=response)