Skip to content

katana_public_api_client.api.variant.update_variant

katana_public_api_client.api.variant.update_variant

Classes

Functions

asyncio(id, *, client, body) async

Update a variant

Updates the specified variant by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Parameters:

  • id (int) –
  • body (UpdateVariantRequest) –

    Request payload for updating product variant details including pricing, configuration, and inventory information Example: {'sku': 'KNF-PRO-8PC-UPD', 'sales_price': 319.99, 'purchase_price': 160.0, 'product_id': 101, 'material_id': None, 'supplier_item_codes': ['SUP-KNF-8PC-002'], 'internal_barcode': 'INT-KNF-002', 'registered_barcode': '789123456790', 'lead_time': 5, 'minimum_order_quantity': 1, 'config_attributes': [{'config_name': 'Piece Count', 'config_value': '8-piece'}, {'config_name': 'Handle Material', 'config_value': 'Premium Steel'}], 'custom_fields': [{'field_name': 'Warranty Period', 'field_value': '7 years'}]}.

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/variant/update_variant.py
async def asyncio(
    id: int,
    *,
    client: AuthenticatedClient | Client,
    body: UpdateVariantRequest,
) -> DetailedErrorResponse | ErrorResponse | Variant | None:
    """Update a variant

     Updates the specified variant by setting the values of the parameters passed.
        Any parameters not provided will be left unchanged.

    Args:
        id (int):
        body (UpdateVariantRequest): Request payload for updating product variant details
            including pricing, configuration, and inventory information
             Example: {'sku': 'KNF-PRO-8PC-UPD', 'sales_price': 319.99, 'purchase_price': 160.0,
            'product_id': 101, 'material_id': None, 'supplier_item_codes': ['SUP-KNF-8PC-002'],
            'internal_barcode': 'INT-KNF-002', 'registered_barcode': '789123456790', 'lead_time': 5,
            'minimum_order_quantity': 1, 'config_attributes': [{'config_name': 'Piece Count',
            'config_value': '8-piece'}, {'config_name': 'Handle Material', 'config_value': 'Premium
            Steel'}], 'custom_fields': [{'field_name': 'Warranty Period', 'field_value': '7 years'}]}.


    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, Variant]
    """

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

asyncio_detailed(id, *, client, body) async

Update a variant

Updates the specified variant by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Parameters:

  • id (int) –
  • body (UpdateVariantRequest) –

    Request payload for updating product variant details including pricing, configuration, and inventory information Example: {'sku': 'KNF-PRO-8PC-UPD', 'sales_price': 319.99, 'purchase_price': 160.0, 'product_id': 101, 'material_id': None, 'supplier_item_codes': ['SUP-KNF-8PC-002'], 'internal_barcode': 'INT-KNF-002', 'registered_barcode': '789123456790', 'lead_time': 5, 'minimum_order_quantity': 1, 'config_attributes': [{'config_name': 'Piece Count', 'config_value': '8-piece'}, {'config_name': 'Handle Material', 'config_value': 'Premium Steel'}], 'custom_fields': [{'field_name': 'Warranty Period', 'field_value': '7 years'}]}.

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/variant/update_variant.py
async def asyncio_detailed(
    id: int,
    *,
    client: AuthenticatedClient | Client,
    body: UpdateVariantRequest,
) -> Response[DetailedErrorResponse | ErrorResponse | Variant]:
    """Update a variant

     Updates the specified variant by setting the values of the parameters passed.
        Any parameters not provided will be left unchanged.

    Args:
        id (int):
        body (UpdateVariantRequest): Request payload for updating product variant details
            including pricing, configuration, and inventory information
             Example: {'sku': 'KNF-PRO-8PC-UPD', 'sales_price': 319.99, 'purchase_price': 160.0,
            'product_id': 101, 'material_id': None, 'supplier_item_codes': ['SUP-KNF-8PC-002'],
            'internal_barcode': 'INT-KNF-002', 'registered_barcode': '789123456790', 'lead_time': 5,
            'minimum_order_quantity': 1, 'config_attributes': [{'config_name': 'Piece Count',
            'config_value': '8-piece'}, {'config_name': 'Handle Material', 'config_value': 'Premium
            Steel'}], 'custom_fields': [{'field_name': 'Warranty Period', 'field_value': '7 years'}]}.


    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, Variant]]
    """

    kwargs = _get_kwargs(
        id=id,
        body=body,
    )

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

    return _build_response(client=client, response=response)

sync(id, *, client, body)

Update a variant

Updates the specified variant by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Parameters:

  • id (int) –
  • body (UpdateVariantRequest) –

    Request payload for updating product variant details including pricing, configuration, and inventory information Example: {'sku': 'KNF-PRO-8PC-UPD', 'sales_price': 319.99, 'purchase_price': 160.0, 'product_id': 101, 'material_id': None, 'supplier_item_codes': ['SUP-KNF-8PC-002'], 'internal_barcode': 'INT-KNF-002', 'registered_barcode': '789123456790', 'lead_time': 5, 'minimum_order_quantity': 1, 'config_attributes': [{'config_name': 'Piece Count', 'config_value': '8-piece'}, {'config_name': 'Handle Material', 'config_value': 'Premium Steel'}], 'custom_fields': [{'field_name': 'Warranty Period', 'field_value': '7 years'}]}.

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/variant/update_variant.py
def sync(
    id: int,
    *,
    client: AuthenticatedClient | Client,
    body: UpdateVariantRequest,
) -> DetailedErrorResponse | ErrorResponse | Variant | None:
    """Update a variant

     Updates the specified variant by setting the values of the parameters passed.
        Any parameters not provided will be left unchanged.

    Args:
        id (int):
        body (UpdateVariantRequest): Request payload for updating product variant details
            including pricing, configuration, and inventory information
             Example: {'sku': 'KNF-PRO-8PC-UPD', 'sales_price': 319.99, 'purchase_price': 160.0,
            'product_id': 101, 'material_id': None, 'supplier_item_codes': ['SUP-KNF-8PC-002'],
            'internal_barcode': 'INT-KNF-002', 'registered_barcode': '789123456790', 'lead_time': 5,
            'minimum_order_quantity': 1, 'config_attributes': [{'config_name': 'Piece Count',
            'config_value': '8-piece'}, {'config_name': 'Handle Material', 'config_value': 'Premium
            Steel'}], 'custom_fields': [{'field_name': 'Warranty Period', 'field_value': '7 years'}]}.


    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, Variant]
    """

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

sync_detailed(id, *, client, body)

Update a variant

Updates the specified variant by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Parameters:

  • id (int) –
  • body (UpdateVariantRequest) –

    Request payload for updating product variant details including pricing, configuration, and inventory information Example: {'sku': 'KNF-PRO-8PC-UPD', 'sales_price': 319.99, 'purchase_price': 160.0, 'product_id': 101, 'material_id': None, 'supplier_item_codes': ['SUP-KNF-8PC-002'], 'internal_barcode': 'INT-KNF-002', 'registered_barcode': '789123456790', 'lead_time': 5, 'minimum_order_quantity': 1, 'config_attributes': [{'config_name': 'Piece Count', 'config_value': '8-piece'}, {'config_name': 'Handle Material', 'config_value': 'Premium Steel'}], 'custom_fields': [{'field_name': 'Warranty Period', 'field_value': '7 years'}]}.

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/variant/update_variant.py
def sync_detailed(
    id: int,
    *,
    client: AuthenticatedClient | Client,
    body: UpdateVariantRequest,
) -> Response[DetailedErrorResponse | ErrorResponse | Variant]:
    """Update a variant

     Updates the specified variant by setting the values of the parameters passed.
        Any parameters not provided will be left unchanged.

    Args:
        id (int):
        body (UpdateVariantRequest): Request payload for updating product variant details
            including pricing, configuration, and inventory information
             Example: {'sku': 'KNF-PRO-8PC-UPD', 'sales_price': 319.99, 'purchase_price': 160.0,
            'product_id': 101, 'material_id': None, 'supplier_item_codes': ['SUP-KNF-8PC-002'],
            'internal_barcode': 'INT-KNF-002', 'registered_barcode': '789123456790', 'lead_time': 5,
            'minimum_order_quantity': 1, 'config_attributes': [{'config_name': 'Piece Count',
            'config_value': '8-piece'}, {'config_name': 'Handle Material', 'config_value': 'Premium
            Steel'}], 'custom_fields': [{'field_name': 'Warranty Period', 'field_value': '7 years'}]}.


    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, Variant]]
    """

    kwargs = _get_kwargs(
        id=id,
        body=body,
    )

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

    return _build_response(client=client, response=response)