Skip to content

katana_public_api_client.api.customer.create_customer

katana_public_api_client.api.customer.create_customer

Classes

Functions

asyncio(*, client, body) async

Create a customer

Creates a new customer.

Parameters:

  • body (CreateCustomerRequest) –

    Request payload for creating a new customer with contact and business information Example: {'name': 'Gourmet Bistro Group', 'first_name': 'Elena', 'last_name': 'Rodriguez', 'company': 'Gourmet Bistro Group Inc', 'email': 'procurement@gourmetbistro.com', 'phone': '+1-555-0125', 'comment': 'Premium restaurant chain - priority orders', 'currency': 'USD', 'reference_id': 'GBG-2024-003', 'category': 'Fine Dining', 'discount_rate': 7.5}.

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/customer/create_customer.py
async def asyncio(
    *,
    client: AuthenticatedClient | Client,
    body: CreateCustomerRequest,
) -> Customer | ErrorResponse | None:
    """Create a customer

     Creates a new customer.

    Args:
        body (CreateCustomerRequest): Request payload for creating a new customer with contact and
            business information Example: {'name': 'Gourmet Bistro Group', 'first_name': 'Elena',
            'last_name': 'Rodriguez', 'company': 'Gourmet Bistro Group Inc', 'email':
            'procurement@gourmetbistro.com', 'phone': '+1-555-0125', 'comment': 'Premium restaurant
            chain - priority orders', 'currency': 'USD', 'reference_id': 'GBG-2024-003', 'category':
            'Fine Dining', 'discount_rate': 7.5}.

    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[Customer, ErrorResponse]
    """

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

asyncio_detailed(*, client, body) async

Create a customer

Creates a new customer.

Parameters:

  • body (CreateCustomerRequest) –

    Request payload for creating a new customer with contact and business information Example: {'name': 'Gourmet Bistro Group', 'first_name': 'Elena', 'last_name': 'Rodriguez', 'company': 'Gourmet Bistro Group Inc', 'email': 'procurement@gourmetbistro.com', 'phone': '+1-555-0125', 'comment': 'Premium restaurant chain - priority orders', 'currency': 'USD', 'reference_id': 'GBG-2024-003', 'category': 'Fine Dining', 'discount_rate': 7.5}.

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/customer/create_customer.py
async def asyncio_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateCustomerRequest,
) -> Response[Customer | ErrorResponse]:
    """Create a customer

     Creates a new customer.

    Args:
        body (CreateCustomerRequest): Request payload for creating a new customer with contact and
            business information Example: {'name': 'Gourmet Bistro Group', 'first_name': 'Elena',
            'last_name': 'Rodriguez', 'company': 'Gourmet Bistro Group Inc', 'email':
            'procurement@gourmetbistro.com', 'phone': '+1-555-0125', 'comment': 'Premium restaurant
            chain - priority orders', 'currency': 'USD', 'reference_id': 'GBG-2024-003', 'category':
            'Fine Dining', 'discount_rate': 7.5}.

    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[Customer, ErrorResponse]]
    """

    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 customer

Creates a new customer.

Parameters:

  • body (CreateCustomerRequest) –

    Request payload for creating a new customer with contact and business information Example: {'name': 'Gourmet Bistro Group', 'first_name': 'Elena', 'last_name': 'Rodriguez', 'company': 'Gourmet Bistro Group Inc', 'email': 'procurement@gourmetbistro.com', 'phone': '+1-555-0125', 'comment': 'Premium restaurant chain - priority orders', 'currency': 'USD', 'reference_id': 'GBG-2024-003', 'category': 'Fine Dining', 'discount_rate': 7.5}.

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/customer/create_customer.py
def sync(
    *,
    client: AuthenticatedClient | Client,
    body: CreateCustomerRequest,
) -> Customer | ErrorResponse | None:
    """Create a customer

     Creates a new customer.

    Args:
        body (CreateCustomerRequest): Request payload for creating a new customer with contact and
            business information Example: {'name': 'Gourmet Bistro Group', 'first_name': 'Elena',
            'last_name': 'Rodriguez', 'company': 'Gourmet Bistro Group Inc', 'email':
            'procurement@gourmetbistro.com', 'phone': '+1-555-0125', 'comment': 'Premium restaurant
            chain - priority orders', 'currency': 'USD', 'reference_id': 'GBG-2024-003', 'category':
            'Fine Dining', 'discount_rate': 7.5}.

    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[Customer, ErrorResponse]
    """

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

sync_detailed(*, client, body)

Create a customer

Creates a new customer.

Parameters:

  • body (CreateCustomerRequest) –

    Request payload for creating a new customer with contact and business information Example: {'name': 'Gourmet Bistro Group', 'first_name': 'Elena', 'last_name': 'Rodriguez', 'company': 'Gourmet Bistro Group Inc', 'email': 'procurement@gourmetbistro.com', 'phone': '+1-555-0125', 'comment': 'Premium restaurant chain - priority orders', 'currency': 'USD', 'reference_id': 'GBG-2024-003', 'category': 'Fine Dining', 'discount_rate': 7.5}.

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/customer/create_customer.py
def sync_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateCustomerRequest,
) -> Response[Customer | ErrorResponse]:
    """Create a customer

     Creates a new customer.

    Args:
        body (CreateCustomerRequest): Request payload for creating a new customer with contact and
            business information Example: {'name': 'Gourmet Bistro Group', 'first_name': 'Elena',
            'last_name': 'Rodriguez', 'company': 'Gourmet Bistro Group Inc', 'email':
            'procurement@gourmetbistro.com', 'phone': '+1-555-0125', 'comment': 'Premium restaurant
            chain - priority orders', 'currency': 'USD', 'reference_id': 'GBG-2024-003', 'category':
            'Fine Dining', 'discount_rate': 7.5}.

    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[Customer, ErrorResponse]]
    """

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)