Skip to content

katana_public_api_client.api.stock_adjustment.create_stock_adjustment

katana_public_api_client.api.stock_adjustment.create_stock_adjustment

Classes

Functions

asyncio(*, client, body) async

Create a stock adjustment

Creates a new stock adjustment to correct inventory levels.

Parameters:

  • body (CreateStockAdjustmentRequest) –

    Request payload for creating a new stock adjustment to correct inventory levels Example: {'reference_no': 'SA-2024-003', 'location_id': 1, 'adjustment_date': '2024-01-17T14:30:00.000Z', 'reason': 'Cycle count correction', 'additional_info': 'Q1 2024 physical inventory', 'status': 'DRAFT', 'stock_adjustment_rows': [{'variant_id': 501, 'quantity': 100, 'cost_per_unit': 123.45}, {'variant_id': 502, 'quantity': -25, 'cost_per_unit': 234.56}]}.

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/stock_adjustment/create_stock_adjustment.py
async def asyncio(
    *,
    client: AuthenticatedClient | Client,
    body: CreateStockAdjustmentRequest,
) -> DetailedErrorResponse | ErrorResponse | StockAdjustment | None:
    """Create a stock adjustment

     Creates a new stock adjustment to correct inventory levels.

    Args:
        body (CreateStockAdjustmentRequest): Request payload for creating a new stock adjustment
            to correct inventory levels Example: {'reference_no': 'SA-2024-003', 'location_id': 1,
            'adjustment_date': '2024-01-17T14:30:00.000Z', 'reason': 'Cycle count correction',
            'additional_info': 'Q1 2024 physical inventory', 'status': 'DRAFT',
            'stock_adjustment_rows': [{'variant_id': 501, 'quantity': 100, 'cost_per_unit': 123.45},
            {'variant_id': 502, 'quantity': -25, 'cost_per_unit': 234.56}]}.

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

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

asyncio_detailed(*, client, body) async

Create a stock adjustment

Creates a new stock adjustment to correct inventory levels.

Parameters:

  • body (CreateStockAdjustmentRequest) –

    Request payload for creating a new stock adjustment to correct inventory levels Example: {'reference_no': 'SA-2024-003', 'location_id': 1, 'adjustment_date': '2024-01-17T14:30:00.000Z', 'reason': 'Cycle count correction', 'additional_info': 'Q1 2024 physical inventory', 'status': 'DRAFT', 'stock_adjustment_rows': [{'variant_id': 501, 'quantity': 100, 'cost_per_unit': 123.45}, {'variant_id': 502, 'quantity': -25, 'cost_per_unit': 234.56}]}.

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/stock_adjustment/create_stock_adjustment.py
async def asyncio_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateStockAdjustmentRequest,
) -> Response[DetailedErrorResponse | ErrorResponse | StockAdjustment]:
    """Create a stock adjustment

     Creates a new stock adjustment to correct inventory levels.

    Args:
        body (CreateStockAdjustmentRequest): Request payload for creating a new stock adjustment
            to correct inventory levels Example: {'reference_no': 'SA-2024-003', 'location_id': 1,
            'adjustment_date': '2024-01-17T14:30:00.000Z', 'reason': 'Cycle count correction',
            'additional_info': 'Q1 2024 physical inventory', 'status': 'DRAFT',
            'stock_adjustment_rows': [{'variant_id': 501, 'quantity': 100, 'cost_per_unit': 123.45},
            {'variant_id': 502, 'quantity': -25, 'cost_per_unit': 234.56}]}.

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

    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 stock adjustment

Creates a new stock adjustment to correct inventory levels.

Parameters:

  • body (CreateStockAdjustmentRequest) –

    Request payload for creating a new stock adjustment to correct inventory levels Example: {'reference_no': 'SA-2024-003', 'location_id': 1, 'adjustment_date': '2024-01-17T14:30:00.000Z', 'reason': 'Cycle count correction', 'additional_info': 'Q1 2024 physical inventory', 'status': 'DRAFT', 'stock_adjustment_rows': [{'variant_id': 501, 'quantity': 100, 'cost_per_unit': 123.45}, {'variant_id': 502, 'quantity': -25, 'cost_per_unit': 234.56}]}.

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/stock_adjustment/create_stock_adjustment.py
def sync(
    *,
    client: AuthenticatedClient | Client,
    body: CreateStockAdjustmentRequest,
) -> DetailedErrorResponse | ErrorResponse | StockAdjustment | None:
    """Create a stock adjustment

     Creates a new stock adjustment to correct inventory levels.

    Args:
        body (CreateStockAdjustmentRequest): Request payload for creating a new stock adjustment
            to correct inventory levels Example: {'reference_no': 'SA-2024-003', 'location_id': 1,
            'adjustment_date': '2024-01-17T14:30:00.000Z', 'reason': 'Cycle count correction',
            'additional_info': 'Q1 2024 physical inventory', 'status': 'DRAFT',
            'stock_adjustment_rows': [{'variant_id': 501, 'quantity': 100, 'cost_per_unit': 123.45},
            {'variant_id': 502, 'quantity': -25, 'cost_per_unit': 234.56}]}.

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

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

sync_detailed(*, client, body)

Create a stock adjustment

Creates a new stock adjustment to correct inventory levels.

Parameters:

  • body (CreateStockAdjustmentRequest) –

    Request payload for creating a new stock adjustment to correct inventory levels Example: {'reference_no': 'SA-2024-003', 'location_id': 1, 'adjustment_date': '2024-01-17T14:30:00.000Z', 'reason': 'Cycle count correction', 'additional_info': 'Q1 2024 physical inventory', 'status': 'DRAFT', 'stock_adjustment_rows': [{'variant_id': 501, 'quantity': 100, 'cost_per_unit': 123.45}, {'variant_id': 502, 'quantity': -25, 'cost_per_unit': 234.56}]}.

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/stock_adjustment/create_stock_adjustment.py
def sync_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateStockAdjustmentRequest,
) -> Response[DetailedErrorResponse | ErrorResponse | StockAdjustment]:
    """Create a stock adjustment

     Creates a new stock adjustment to correct inventory levels.

    Args:
        body (CreateStockAdjustmentRequest): Request payload for creating a new stock adjustment
            to correct inventory levels Example: {'reference_no': 'SA-2024-003', 'location_id': 1,
            'adjustment_date': '2024-01-17T14:30:00.000Z', 'reason': 'Cycle count correction',
            'additional_info': 'Q1 2024 physical inventory', 'status': 'DRAFT',
            'stock_adjustment_rows': [{'variant_id': 501, 'quantity': 100, 'cost_per_unit': 123.45},
            {'variant_id': 502, 'quantity': -25, 'cost_per_unit': 234.56}]}.

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

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)