Skip to content

katana_public_api_client.api.customer.update_customer

katana_public_api_client.api.customer.update_customer

Classes

Functions

asyncio(id, *, client, body) async

Update a customer

Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Parameters:

  • id (int) –
  • body (UpdateCustomerRequest) –

    Request payload for updating an existing 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, 'default_shipping_id': 2}.

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/update_customer.py
async def asyncio(
    id: int,
    *,
    client: AuthenticatedClient | Client,
    body: UpdateCustomerRequest,
) -> Customer | DetailedErrorResponse | ErrorResponse | None:
    """Update a customer

     Updates the specified customer by setting the values of the parameters passed. Any parameters not
    provided will
    be left unchanged.

    Args:
        id (int):
        body (UpdateCustomerRequest): Request payload for updating an existing 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, 'default_shipping_id': 2}.

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

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

asyncio_detailed(id, *, client, body) async

Update a customer

Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Parameters:

  • id (int) –
  • body (UpdateCustomerRequest) –

    Request payload for updating an existing 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, 'default_shipping_id': 2}.

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/update_customer.py
async def asyncio_detailed(
    id: int,
    *,
    client: AuthenticatedClient | Client,
    body: UpdateCustomerRequest,
) -> Response[Customer | DetailedErrorResponse | ErrorResponse]:
    """Update a customer

     Updates the specified customer by setting the values of the parameters passed. Any parameters not
    provided will
    be left unchanged.

    Args:
        id (int):
        body (UpdateCustomerRequest): Request payload for updating an existing 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, 'default_shipping_id': 2}.

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

    kwargs = _get_kwargs(
        id=id,
        body=body,
    )

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

    return _build_response(client=client, response=response)

sync(id, *, client, body)

Update a customer

Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Parameters:

  • id (int) –
  • body (UpdateCustomerRequest) –

    Request payload for updating an existing 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, 'default_shipping_id': 2}.

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/update_customer.py
def sync(
    id: int,
    *,
    client: AuthenticatedClient | Client,
    body: UpdateCustomerRequest,
) -> Customer | DetailedErrorResponse | ErrorResponse | None:
    """Update a customer

     Updates the specified customer by setting the values of the parameters passed. Any parameters not
    provided will
    be left unchanged.

    Args:
        id (int):
        body (UpdateCustomerRequest): Request payload for updating an existing 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, 'default_shipping_id': 2}.

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

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

sync_detailed(id, *, client, body)

Update a customer

Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Parameters:

  • id (int) –
  • body (UpdateCustomerRequest) –

    Request payload for updating an existing 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, 'default_shipping_id': 2}.

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/update_customer.py
def sync_detailed(
    id: int,
    *,
    client: AuthenticatedClient | Client,
    body: UpdateCustomerRequest,
) -> Response[Customer | DetailedErrorResponse | ErrorResponse]:
    """Update a customer

     Updates the specified customer by setting the values of the parameters passed. Any parameters not
    provided will
    be left unchanged.

    Args:
        id (int):
        body (UpdateCustomerRequest): Request payload for updating an existing 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, 'default_shipping_id': 2}.

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

    kwargs = _get_kwargs(
        id=id,
        body=body,
    )

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

    return _build_response(client=client, response=response)