Skip to content

katana_public_api_client.api.recipe.create_recipes

katana_public_api_client.api.recipe.create_recipes

Classes

Functions

asyncio(*, client, body) async

Create recipes

Create one or many new recipe rows for a product. The endpoint accepts up to 150 recipe rows and processes them in bulk. This endpoint is deprecated in favor of BOM rows.

Parameters:

  • body (CreateRecipesRequest) –

    Request payload for creating recipe rows (deprecated in favor of BOM rows) Example: {'keep_current_rows': True, 'rows': [{'ingredient_variant_id': 1001, 'product_variant_id': 2001, 'quantity': 2.5, 'notes': 'Primary ingredient'}]}.

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/recipe/create_recipes.py
async def asyncio(
    *,
    client: AuthenticatedClient | Client,
    body: CreateRecipesRequest,
) -> Any | DetailedErrorResponse | ErrorResponse | None:
    """Create recipes

     Create one or many new recipe rows for a product. The endpoint accepts up to 150 recipe rows and
    processes them
    in bulk. This endpoint is deprecated in favor of BOM rows.

    Args:
        body (CreateRecipesRequest): Request payload for creating recipe rows (deprecated in favor
            of BOM rows) Example: {'keep_current_rows': True, 'rows': [{'ingredient_variant_id': 1001,
            'product_variant_id': 2001, 'quantity': 2.5, 'notes': 'Primary ingredient'}]}.

    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[Any, DetailedErrorResponse, ErrorResponse]
    """

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

asyncio_detailed(*, client, body) async

Create recipes

Create one or many new recipe rows for a product. The endpoint accepts up to 150 recipe rows and processes them in bulk. This endpoint is deprecated in favor of BOM rows.

Parameters:

  • body (CreateRecipesRequest) –

    Request payload for creating recipe rows (deprecated in favor of BOM rows) Example: {'keep_current_rows': True, 'rows': [{'ingredient_variant_id': 1001, 'product_variant_id': 2001, 'quantity': 2.5, 'notes': 'Primary ingredient'}]}.

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/recipe/create_recipes.py
async def asyncio_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateRecipesRequest,
) -> Response[Any | DetailedErrorResponse | ErrorResponse]:
    """Create recipes

     Create one or many new recipe rows for a product. The endpoint accepts up to 150 recipe rows and
    processes them
    in bulk. This endpoint is deprecated in favor of BOM rows.

    Args:
        body (CreateRecipesRequest): Request payload for creating recipe rows (deprecated in favor
            of BOM rows) Example: {'keep_current_rows': True, 'rows': [{'ingredient_variant_id': 1001,
            'product_variant_id': 2001, 'quantity': 2.5, 'notes': 'Primary ingredient'}]}.

    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[Any, DetailedErrorResponse, ErrorResponse]]
    """

    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 recipes

Create one or many new recipe rows for a product. The endpoint accepts up to 150 recipe rows and processes them in bulk. This endpoint is deprecated in favor of BOM rows.

Parameters:

  • body (CreateRecipesRequest) –

    Request payload for creating recipe rows (deprecated in favor of BOM rows) Example: {'keep_current_rows': True, 'rows': [{'ingredient_variant_id': 1001, 'product_variant_id': 2001, 'quantity': 2.5, 'notes': 'Primary ingredient'}]}.

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/recipe/create_recipes.py
def sync(
    *,
    client: AuthenticatedClient | Client,
    body: CreateRecipesRequest,
) -> Any | DetailedErrorResponse | ErrorResponse | None:
    """Create recipes

     Create one or many new recipe rows for a product. The endpoint accepts up to 150 recipe rows and
    processes them
    in bulk. This endpoint is deprecated in favor of BOM rows.

    Args:
        body (CreateRecipesRequest): Request payload for creating recipe rows (deprecated in favor
            of BOM rows) Example: {'keep_current_rows': True, 'rows': [{'ingredient_variant_id': 1001,
            'product_variant_id': 2001, 'quantity': 2.5, 'notes': 'Primary ingredient'}]}.

    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[Any, DetailedErrorResponse, ErrorResponse]
    """

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

sync_detailed(*, client, body)

Create recipes

Create one or many new recipe rows for a product. The endpoint accepts up to 150 recipe rows and processes them in bulk. This endpoint is deprecated in favor of BOM rows.

Parameters:

  • body (CreateRecipesRequest) –

    Request payload for creating recipe rows (deprecated in favor of BOM rows) Example: {'keep_current_rows': True, 'rows': [{'ingredient_variant_id': 1001, 'product_variant_id': 2001, 'quantity': 2.5, 'notes': 'Primary ingredient'}]}.

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/recipe/create_recipes.py
def sync_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateRecipesRequest,
) -> Response[Any | DetailedErrorResponse | ErrorResponse]:
    """Create recipes

     Create one or many new recipe rows for a product. The endpoint accepts up to 150 recipe rows and
    processes them
    in bulk. This endpoint is deprecated in favor of BOM rows.

    Args:
        body (CreateRecipesRequest): Request payload for creating recipe rows (deprecated in favor
            of BOM rows) Example: {'keep_current_rows': True, 'rows': [{'ingredient_variant_id': 1001,
            'product_variant_id': 2001, 'quantity': 2.5, 'notes': 'Primary ingredient'}]}.

    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[Any, DetailedErrorResponse, ErrorResponse]]
    """

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)