Skip to content

katana_public_api_client.api.sales_order.rerank_sales_order

katana_public_api_client.api.sales_order.rerank_sales_order

Classes

Functions

asyncio(*, client, body) async

Change a sales order's rank

Moves one or more sales orders to an exact place in the sales order list.

The sales orders in order_ids are placed as one consecutive block, in the order given, at the place set in place. The first id ends up highest in the list. All other sales orders keep their order relative to each other.

before_id places them directly above that sales order, and after_id directly below it. Sending the same request again changes nothing, so a request can be retried safely.

Only open sales orders can be reranked. A sales order moves together with its linked manufacturing orders.

To rerank more than 250 sales orders, send them in batches: the first batch with place.position set to top, each next batch with place.after_id set to the last id in the previous response's order_ids.

Sales order lists show the new order shortly after the request returns.

The request returns 422 when any of the sales orders, including the one in before_id or after_id, doesn't exist or is not open, or when before_id or after_id is one of order_ids.

Parameters:

  • body (RerankSalesOrderRequest) –

    Request payload for repositioning a sales order in the schedule, relative to another sales order Example: {'order_ids': [1], 'place': {'before_id': 4}}.

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/sales_order/rerank_sales_order.py
async def asyncio(
    *,
    client: AuthenticatedClient | Client,
    body: RerankSalesOrderRequest,
) -> Any | DetailedErrorResponse | ErrorResponse | RerankOrdersResponse | None:
    """Change a sales order's rank

     Moves one or more sales orders to an exact place in the sales order list.

    The sales orders in `order_ids` are placed as one consecutive block, in the order given, at the
    place set in `place`. The first id ends up highest in the list. All other sales orders keep their
    order relative to each other.

    `before_id` places them directly above that sales order, and `after_id` directly below it. Sending
    the same request again changes nothing, so a request can be retried safely.

    Only open sales orders can be reranked. A sales order moves together with its linked manufacturing
    orders.

    To rerank more than 250 sales orders, send them in batches: the first batch with `place.position`
    set to `top`, each next batch with `place.after_id` set to the last id in the previous response's
    `order_ids`.

    Sales order lists show the new order shortly after the request returns.

    The request returns 422 when any of the sales orders, including the one in `before_id` or
    `after_id`, doesn't exist or is not open, or when `before_id` or `after_id` is one of `order_ids`.

    Args:
        body (RerankSalesOrderRequest): Request payload for repositioning a sales order in the
            schedule, relative to another sales order Example: {'order_ids': [1], 'place':
            {'before_id': 4}}.

    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:
        Any | DetailedErrorResponse | ErrorResponse | RerankOrdersResponse
    """

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

asyncio_detailed(*, client, body) async

Change a sales order's rank

Moves one or more sales orders to an exact place in the sales order list.

The sales orders in order_ids are placed as one consecutive block, in the order given, at the place set in place. The first id ends up highest in the list. All other sales orders keep their order relative to each other.

before_id places them directly above that sales order, and after_id directly below it. Sending the same request again changes nothing, so a request can be retried safely.

Only open sales orders can be reranked. A sales order moves together with its linked manufacturing orders.

To rerank more than 250 sales orders, send them in batches: the first batch with place.position set to top, each next batch with place.after_id set to the last id in the previous response's order_ids.

Sales order lists show the new order shortly after the request returns.

The request returns 422 when any of the sales orders, including the one in before_id or after_id, doesn't exist or is not open, or when before_id or after_id is one of order_ids.

Parameters:

  • body (RerankSalesOrderRequest) –

    Request payload for repositioning a sales order in the schedule, relative to another sales order Example: {'order_ids': [1], 'place': {'before_id': 4}}.

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/sales_order/rerank_sales_order.py
async def asyncio_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: RerankSalesOrderRequest,
) -> Response[Any | DetailedErrorResponse | ErrorResponse | RerankOrdersResponse]:
    """Change a sales order's rank

     Moves one or more sales orders to an exact place in the sales order list.

    The sales orders in `order_ids` are placed as one consecutive block, in the order given, at the
    place set in `place`. The first id ends up highest in the list. All other sales orders keep their
    order relative to each other.

    `before_id` places them directly above that sales order, and `after_id` directly below it. Sending
    the same request again changes nothing, so a request can be retried safely.

    Only open sales orders can be reranked. A sales order moves together with its linked manufacturing
    orders.

    To rerank more than 250 sales orders, send them in batches: the first batch with `place.position`
    set to `top`, each next batch with `place.after_id` set to the last id in the previous response's
    `order_ids`.

    Sales order lists show the new order shortly after the request returns.

    The request returns 422 when any of the sales orders, including the one in `before_id` or
    `after_id`, doesn't exist or is not open, or when `before_id` or `after_id` is one of `order_ids`.

    Args:
        body (RerankSalesOrderRequest): Request payload for repositioning a sales order in the
            schedule, relative to another sales order Example: {'order_ids': [1], 'place':
            {'before_id': 4}}.

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

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)

sync(*, client, body)

Change a sales order's rank

Moves one or more sales orders to an exact place in the sales order list.

The sales orders in order_ids are placed as one consecutive block, in the order given, at the place set in place. The first id ends up highest in the list. All other sales orders keep their order relative to each other.

before_id places them directly above that sales order, and after_id directly below it. Sending the same request again changes nothing, so a request can be retried safely.

Only open sales orders can be reranked. A sales order moves together with its linked manufacturing orders.

To rerank more than 250 sales orders, send them in batches: the first batch with place.position set to top, each next batch with place.after_id set to the last id in the previous response's order_ids.

Sales order lists show the new order shortly after the request returns.

The request returns 422 when any of the sales orders, including the one in before_id or after_id, doesn't exist or is not open, or when before_id or after_id is one of order_ids.

Parameters:

  • body (RerankSalesOrderRequest) –

    Request payload for repositioning a sales order in the schedule, relative to another sales order Example: {'order_ids': [1], 'place': {'before_id': 4}}.

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/sales_order/rerank_sales_order.py
def sync(
    *,
    client: AuthenticatedClient | Client,
    body: RerankSalesOrderRequest,
) -> Any | DetailedErrorResponse | ErrorResponse | RerankOrdersResponse | None:
    """Change a sales order's rank

     Moves one or more sales orders to an exact place in the sales order list.

    The sales orders in `order_ids` are placed as one consecutive block, in the order given, at the
    place set in `place`. The first id ends up highest in the list. All other sales orders keep their
    order relative to each other.

    `before_id` places them directly above that sales order, and `after_id` directly below it. Sending
    the same request again changes nothing, so a request can be retried safely.

    Only open sales orders can be reranked. A sales order moves together with its linked manufacturing
    orders.

    To rerank more than 250 sales orders, send them in batches: the first batch with `place.position`
    set to `top`, each next batch with `place.after_id` set to the last id in the previous response's
    `order_ids`.

    Sales order lists show the new order shortly after the request returns.

    The request returns 422 when any of the sales orders, including the one in `before_id` or
    `after_id`, doesn't exist or is not open, or when `before_id` or `after_id` is one of `order_ids`.

    Args:
        body (RerankSalesOrderRequest): Request payload for repositioning a sales order in the
            schedule, relative to another sales order Example: {'order_ids': [1], 'place':
            {'before_id': 4}}.

    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:
        Any | DetailedErrorResponse | ErrorResponse | RerankOrdersResponse
    """

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

sync_detailed(*, client, body)

Change a sales order's rank

Moves one or more sales orders to an exact place in the sales order list.

The sales orders in order_ids are placed as one consecutive block, in the order given, at the place set in place. The first id ends up highest in the list. All other sales orders keep their order relative to each other.

before_id places them directly above that sales order, and after_id directly below it. Sending the same request again changes nothing, so a request can be retried safely.

Only open sales orders can be reranked. A sales order moves together with its linked manufacturing orders.

To rerank more than 250 sales orders, send them in batches: the first batch with place.position set to top, each next batch with place.after_id set to the last id in the previous response's order_ids.

Sales order lists show the new order shortly after the request returns.

The request returns 422 when any of the sales orders, including the one in before_id or after_id, doesn't exist or is not open, or when before_id or after_id is one of order_ids.

Parameters:

  • body (RerankSalesOrderRequest) –

    Request payload for repositioning a sales order in the schedule, relative to another sales order Example: {'order_ids': [1], 'place': {'before_id': 4}}.

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/sales_order/rerank_sales_order.py
def sync_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: RerankSalesOrderRequest,
) -> Response[Any | DetailedErrorResponse | ErrorResponse | RerankOrdersResponse]:
    """Change a sales order's rank

     Moves one or more sales orders to an exact place in the sales order list.

    The sales orders in `order_ids` are placed as one consecutive block, in the order given, at the
    place set in `place`. The first id ends up highest in the list. All other sales orders keep their
    order relative to each other.

    `before_id` places them directly above that sales order, and `after_id` directly below it. Sending
    the same request again changes nothing, so a request can be retried safely.

    Only open sales orders can be reranked. A sales order moves together with its linked manufacturing
    orders.

    To rerank more than 250 sales orders, send them in batches: the first batch with `place.position`
    set to `top`, each next batch with `place.after_id` set to the last id in the previous response's
    `order_ids`.

    Sales order lists show the new order shortly after the request returns.

    The request returns 422 when any of the sales orders, including the one in `before_id` or
    `after_id`, doesn't exist or is not open, or when `before_id` or `after_id` is one of `order_ids`.

    Args:
        body (RerankSalesOrderRequest): Request payload for repositioning a sales order in the
            schedule, relative to another sales order Example: {'order_ids': [1], 'place':
            {'before_id': 4}}.

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

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)