Skip to content

katana_public_api_client.api.variant.search_variants

katana_public_api_client.api.variant.search_variants

Classes

Functions

asyncio(*, client, body, x_custom_fields_format=UNSET) async

Search variants

Searches variants using a structured filter body with nested logical operators (and / or) and per-field comparators. Only the fields in the filter schema may appear; unknown fields return 422. Custom field values are addressable via custom_fields.<uuid> nested paths. Returns the same shape as GET /variants — a paginated list of records.

Parameters:

  • x_custom_fields_format (SearchVariantsXCustomFieldsFormat | Unset, default: UNSET ) –
  • body (VariantSearchRequest) –

    Structured search body for POST /variants/search. Returns the same paginated {"data": [...]} shape as the corresponding list endpoint, plus an X-Pagination header. Example: {'filter': {'and': [{'item_type': None, 'eq': 'product'}]}, 'order': ['sku ASC'], 'limit': 50, 'page': 1}.

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/search_variants.py
async def asyncio(
    *,
    client: AuthenticatedClient | Client,
    body: VariantSearchRequest,
    x_custom_fields_format: SearchVariantsXCustomFieldsFormat | Unset = UNSET,
) -> DetailedErrorResponse | ErrorResponse | VariantListResponse | None:
    """Search variants

     Searches variants using a structured filter body with nested
    logical operators (``and`` / ``or``) and per-field comparators.
    Only the fields in the filter schema may appear; unknown fields
    return 422. Custom field values are addressable via
    ``custom_fields.<uuid>`` nested paths. Returns the same shape as
    ``GET /variants`` — a paginated list of records.

    Args:
        x_custom_fields_format (SearchVariantsXCustomFieldsFormat | Unset):
        body (VariantSearchRequest): Structured search body for ``POST /variants/search``. Returns
            the
            same paginated ``{"data": [...]}`` shape as the corresponding list
            endpoint, plus an ``X-Pagination`` header.
             Example: {'filter': {'and': [{'item_type': None, 'eq': 'product'}]}, 'order': ['sku
            ASC'], 'limit': 50, 'page': 1}.


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

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

asyncio_detailed(*, client, body, x_custom_fields_format=UNSET) async

Search variants

Searches variants using a structured filter body with nested logical operators (and / or) and per-field comparators. Only the fields in the filter schema may appear; unknown fields return 422. Custom field values are addressable via custom_fields.<uuid> nested paths. Returns the same shape as GET /variants — a paginated list of records.

Parameters:

  • x_custom_fields_format (SearchVariantsXCustomFieldsFormat | Unset, default: UNSET ) –
  • body (VariantSearchRequest) –

    Structured search body for POST /variants/search. Returns the same paginated {"data": [...]} shape as the corresponding list endpoint, plus an X-Pagination header. Example: {'filter': {'and': [{'item_type': None, 'eq': 'product'}]}, 'order': ['sku ASC'], 'limit': 50, 'page': 1}.

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/search_variants.py
async def asyncio_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: VariantSearchRequest,
    x_custom_fields_format: SearchVariantsXCustomFieldsFormat | Unset = UNSET,
) -> Response[DetailedErrorResponse | ErrorResponse | VariantListResponse]:
    """Search variants

     Searches variants using a structured filter body with nested
    logical operators (``and`` / ``or``) and per-field comparators.
    Only the fields in the filter schema may appear; unknown fields
    return 422. Custom field values are addressable via
    ``custom_fields.<uuid>`` nested paths. Returns the same shape as
    ``GET /variants`` — a paginated list of records.

    Args:
        x_custom_fields_format (SearchVariantsXCustomFieldsFormat | Unset):
        body (VariantSearchRequest): Structured search body for ``POST /variants/search``. Returns
            the
            same paginated ``{"data": [...]}`` shape as the corresponding list
            endpoint, plus an ``X-Pagination`` header.
             Example: {'filter': {'and': [{'item_type': None, 'eq': 'product'}]}, 'order': ['sku
            ASC'], 'limit': 50, 'page': 1}.


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

    kwargs = _get_kwargs(
        body=body,
        x_custom_fields_format=x_custom_fields_format,
    )

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

    return _build_response(client=client, response=response)

sync(*, client, body, x_custom_fields_format=UNSET)

Search variants

Searches variants using a structured filter body with nested logical operators (and / or) and per-field comparators. Only the fields in the filter schema may appear; unknown fields return 422. Custom field values are addressable via custom_fields.<uuid> nested paths. Returns the same shape as GET /variants — a paginated list of records.

Parameters:

  • x_custom_fields_format (SearchVariantsXCustomFieldsFormat | Unset, default: UNSET ) –
  • body (VariantSearchRequest) –

    Structured search body for POST /variants/search. Returns the same paginated {"data": [...]} shape as the corresponding list endpoint, plus an X-Pagination header. Example: {'filter': {'and': [{'item_type': None, 'eq': 'product'}]}, 'order': ['sku ASC'], 'limit': 50, 'page': 1}.

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/search_variants.py
def sync(
    *,
    client: AuthenticatedClient | Client,
    body: VariantSearchRequest,
    x_custom_fields_format: SearchVariantsXCustomFieldsFormat | Unset = UNSET,
) -> DetailedErrorResponse | ErrorResponse | VariantListResponse | None:
    """Search variants

     Searches variants using a structured filter body with nested
    logical operators (``and`` / ``or``) and per-field comparators.
    Only the fields in the filter schema may appear; unknown fields
    return 422. Custom field values are addressable via
    ``custom_fields.<uuid>`` nested paths. Returns the same shape as
    ``GET /variants`` — a paginated list of records.

    Args:
        x_custom_fields_format (SearchVariantsXCustomFieldsFormat | Unset):
        body (VariantSearchRequest): Structured search body for ``POST /variants/search``. Returns
            the
            same paginated ``{"data": [...]}`` shape as the corresponding list
            endpoint, plus an ``X-Pagination`` header.
             Example: {'filter': {'and': [{'item_type': None, 'eq': 'product'}]}, 'order': ['sku
            ASC'], 'limit': 50, 'page': 1}.


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

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

sync_detailed(*, client, body, x_custom_fields_format=UNSET)

Search variants

Searches variants using a structured filter body with nested logical operators (and / or) and per-field comparators. Only the fields in the filter schema may appear; unknown fields return 422. Custom field values are addressable via custom_fields.<uuid> nested paths. Returns the same shape as GET /variants — a paginated list of records.

Parameters:

  • x_custom_fields_format (SearchVariantsXCustomFieldsFormat | Unset, default: UNSET ) –
  • body (VariantSearchRequest) –

    Structured search body for POST /variants/search. Returns the same paginated {"data": [...]} shape as the corresponding list endpoint, plus an X-Pagination header. Example: {'filter': {'and': [{'item_type': None, 'eq': 'product'}]}, 'order': ['sku ASC'], 'limit': 50, 'page': 1}.

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/search_variants.py
def sync_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: VariantSearchRequest,
    x_custom_fields_format: SearchVariantsXCustomFieldsFormat | Unset = UNSET,
) -> Response[DetailedErrorResponse | ErrorResponse | VariantListResponse]:
    """Search variants

     Searches variants using a structured filter body with nested
    logical operators (``and`` / ``or``) and per-field comparators.
    Only the fields in the filter schema may appear; unknown fields
    return 422. Custom field values are addressable via
    ``custom_fields.<uuid>`` nested paths. Returns the same shape as
    ``GET /variants`` — a paginated list of records.

    Args:
        x_custom_fields_format (SearchVariantsXCustomFieldsFormat | Unset):
        body (VariantSearchRequest): Structured search body for ``POST /variants/search``. Returns
            the
            same paginated ``{"data": [...]}`` shape as the corresponding list
            endpoint, plus an ``X-Pagination`` header.
             Example: {'filter': {'and': [{'item_type': None, 'eq': 'product'}]}, 'order': ['sku
            ASC'], 'limit': 50, 'page': 1}.


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

    kwargs = _get_kwargs(
        body=body,
        x_custom_fields_format=x_custom_fields_format,
    )

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

    return _build_response(client=client, response=response)