Skip to content

katana_public_api_client.api.stocktake.create_stocktake

katana_public_api_client.api.stocktake.create_stocktake

Classes

Functions

asyncio(*, client, body) async

Create a stocktake

Creates a new stocktake to perform inventory counting.

Parameters:

  • body (CreateStocktakeRequest) –

    Request payload for creating a new stocktake to perform physical inventory counting Example: {'reference_no': 'STK-2024-003', 'location_id': 1, 'stocktake_date': '2024-01-17T09:00:00.000Z', 'notes': 'Quarterly inventory count', 'status': 'DRAFT'}.

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/stocktake/create_stocktake.py
async def asyncio(
    *,
    client: AuthenticatedClient | Client,
    body: CreateStocktakeRequest,
) -> DetailedErrorResponse | ErrorResponse | Stocktake | None:
    """Create a stocktake

     Creates a new stocktake to perform inventory counting.

    Args:
        body (CreateStocktakeRequest): Request payload for creating a new stocktake to perform
            physical inventory counting Example: {'reference_no': 'STK-2024-003', 'location_id': 1,
            'stocktake_date': '2024-01-17T09:00:00.000Z', 'notes': 'Quarterly inventory count',
            'status': 'DRAFT'}.

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

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

asyncio_detailed(*, client, body) async

Create a stocktake

Creates a new stocktake to perform inventory counting.

Parameters:

  • body (CreateStocktakeRequest) –

    Request payload for creating a new stocktake to perform physical inventory counting Example: {'reference_no': 'STK-2024-003', 'location_id': 1, 'stocktake_date': '2024-01-17T09:00:00.000Z', 'notes': 'Quarterly inventory count', 'status': 'DRAFT'}.

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/stocktake/create_stocktake.py
async def asyncio_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateStocktakeRequest,
) -> Response[DetailedErrorResponse | ErrorResponse | Stocktake]:
    """Create a stocktake

     Creates a new stocktake to perform inventory counting.

    Args:
        body (CreateStocktakeRequest): Request payload for creating a new stocktake to perform
            physical inventory counting Example: {'reference_no': 'STK-2024-003', 'location_id': 1,
            'stocktake_date': '2024-01-17T09:00:00.000Z', 'notes': 'Quarterly inventory count',
            'status': 'DRAFT'}.

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

    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 stocktake

Creates a new stocktake to perform inventory counting.

Parameters:

  • body (CreateStocktakeRequest) –

    Request payload for creating a new stocktake to perform physical inventory counting Example: {'reference_no': 'STK-2024-003', 'location_id': 1, 'stocktake_date': '2024-01-17T09:00:00.000Z', 'notes': 'Quarterly inventory count', 'status': 'DRAFT'}.

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/stocktake/create_stocktake.py
def sync(
    *,
    client: AuthenticatedClient | Client,
    body: CreateStocktakeRequest,
) -> DetailedErrorResponse | ErrorResponse | Stocktake | None:
    """Create a stocktake

     Creates a new stocktake to perform inventory counting.

    Args:
        body (CreateStocktakeRequest): Request payload for creating a new stocktake to perform
            physical inventory counting Example: {'reference_no': 'STK-2024-003', 'location_id': 1,
            'stocktake_date': '2024-01-17T09:00:00.000Z', 'notes': 'Quarterly inventory count',
            'status': 'DRAFT'}.

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

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

sync_detailed(*, client, body)

Create a stocktake

Creates a new stocktake to perform inventory counting.

Parameters:

  • body (CreateStocktakeRequest) –

    Request payload for creating a new stocktake to perform physical inventory counting Example: {'reference_no': 'STK-2024-003', 'location_id': 1, 'stocktake_date': '2024-01-17T09:00:00.000Z', 'notes': 'Quarterly inventory count', 'status': 'DRAFT'}.

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/stocktake/create_stocktake.py
def sync_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateStocktakeRequest,
) -> Response[DetailedErrorResponse | ErrorResponse | Stocktake]:
    """Create a stocktake

     Creates a new stocktake to perform inventory counting.

    Args:
        body (CreateStocktakeRequest): Request payload for creating a new stocktake to perform
            physical inventory counting Example: {'reference_no': 'STK-2024-003', 'location_id': 1,
            'stocktake_date': '2024-01-17T09:00:00.000Z', 'notes': 'Quarterly inventory count',
            'status': 'DRAFT'}.

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

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)