Skip to content

katana_public_api_client.api.services.create_service

katana_public_api_client.api.services.create_service

Classes

Functions

asyncio(*, client, body) async

Create Service

Create a new Service. (See: Create Service)

Parameters:

  • body (CreateServiceRequest) –

    Request payload for creating a new service with variants and specifications Example: {'name': 'Assembly Service', 'uom': 'hours', 'category_name': 'Manufacturing Services', 'additional_info': 'Professional product assembly service', 'is_sellable': True, 'custom_field_collection_id': 1, 'variants': [{'sku': 'ASSM-001', 'sales_price': 75.0, 'default_cost': 50.0, 'custom_fields': [{'field_name': 'Skill Level', 'field_value': 'Expert'}]}]}.

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/services/create_service.py
async def asyncio(
    *,
    client: AuthenticatedClient | Client,
    body: CreateServiceRequest,
) -> DetailedErrorResponse | ErrorResponse | Service | None:
    """Create Service

     Create a new Service. (See: [Create
    Service](https://developer.katanamrp.com/reference/createservice))

    Args:
        body (CreateServiceRequest): Request payload for creating a new service with variants and
            specifications Example: {'name': 'Assembly Service', 'uom': 'hours', 'category_name':
            'Manufacturing Services', 'additional_info': 'Professional product assembly service',
            'is_sellable': True, 'custom_field_collection_id': 1, 'variants': [{'sku': 'ASSM-001',
            'sales_price': 75.0, 'default_cost': 50.0, 'custom_fields': [{'field_name': 'Skill Level',
            'field_value': 'Expert'}]}]}.

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

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

asyncio_detailed(*, client, body) async

Create Service

Create a new Service. (See: Create Service)

Parameters:

  • body (CreateServiceRequest) –

    Request payload for creating a new service with variants and specifications Example: {'name': 'Assembly Service', 'uom': 'hours', 'category_name': 'Manufacturing Services', 'additional_info': 'Professional product assembly service', 'is_sellable': True, 'custom_field_collection_id': 1, 'variants': [{'sku': 'ASSM-001', 'sales_price': 75.0, 'default_cost': 50.0, 'custom_fields': [{'field_name': 'Skill Level', 'field_value': 'Expert'}]}]}.

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/services/create_service.py
async def asyncio_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateServiceRequest,
) -> Response[DetailedErrorResponse | ErrorResponse | Service]:
    """Create Service

     Create a new Service. (See: [Create
    Service](https://developer.katanamrp.com/reference/createservice))

    Args:
        body (CreateServiceRequest): Request payload for creating a new service with variants and
            specifications Example: {'name': 'Assembly Service', 'uom': 'hours', 'category_name':
            'Manufacturing Services', 'additional_info': 'Professional product assembly service',
            'is_sellable': True, 'custom_field_collection_id': 1, 'variants': [{'sku': 'ASSM-001',
            'sales_price': 75.0, 'default_cost': 50.0, 'custom_fields': [{'field_name': 'Skill Level',
            'field_value': 'Expert'}]}]}.

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

    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 Service

Create a new Service. (See: Create Service)

Parameters:

  • body (CreateServiceRequest) –

    Request payload for creating a new service with variants and specifications Example: {'name': 'Assembly Service', 'uom': 'hours', 'category_name': 'Manufacturing Services', 'additional_info': 'Professional product assembly service', 'is_sellable': True, 'custom_field_collection_id': 1, 'variants': [{'sku': 'ASSM-001', 'sales_price': 75.0, 'default_cost': 50.0, 'custom_fields': [{'field_name': 'Skill Level', 'field_value': 'Expert'}]}]}.

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/services/create_service.py
def sync(
    *,
    client: AuthenticatedClient | Client,
    body: CreateServiceRequest,
) -> DetailedErrorResponse | ErrorResponse | Service | None:
    """Create Service

     Create a new Service. (See: [Create
    Service](https://developer.katanamrp.com/reference/createservice))

    Args:
        body (CreateServiceRequest): Request payload for creating a new service with variants and
            specifications Example: {'name': 'Assembly Service', 'uom': 'hours', 'category_name':
            'Manufacturing Services', 'additional_info': 'Professional product assembly service',
            'is_sellable': True, 'custom_field_collection_id': 1, 'variants': [{'sku': 'ASSM-001',
            'sales_price': 75.0, 'default_cost': 50.0, 'custom_fields': [{'field_name': 'Skill Level',
            'field_value': 'Expert'}]}]}.

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

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

sync_detailed(*, client, body)

Create Service

Create a new Service. (See: Create Service)

Parameters:

  • body (CreateServiceRequest) –

    Request payload for creating a new service with variants and specifications Example: {'name': 'Assembly Service', 'uom': 'hours', 'category_name': 'Manufacturing Services', 'additional_info': 'Professional product assembly service', 'is_sellable': True, 'custom_field_collection_id': 1, 'variants': [{'sku': 'ASSM-001', 'sales_price': 75.0, 'default_cost': 50.0, 'custom_fields': [{'field_name': 'Skill Level', 'field_value': 'Expert'}]}]}.

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/services/create_service.py
def sync_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateServiceRequest,
) -> Response[DetailedErrorResponse | ErrorResponse | Service]:
    """Create Service

     Create a new Service. (See: [Create
    Service](https://developer.katanamrp.com/reference/createservice))

    Args:
        body (CreateServiceRequest): Request payload for creating a new service with variants and
            specifications Example: {'name': 'Assembly Service', 'uom': 'hours', 'category_name':
            'Manufacturing Services', 'additional_info': 'Professional product assembly service',
            'is_sellable': True, 'custom_field_collection_id': 1, 'variants': [{'sku': 'ASSM-001',
            'sales_price': 75.0, 'default_cost': 50.0, 'custom_fields': [{'field_name': 'Skill Level',
            'field_value': 'Expert'}]}]}.

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

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)