Skip to content

katana_public_api_client.api.customer_address.create_customer_address

katana_public_api_client.api.customer_address.create_customer_address

Classes

Functions

asyncio(*, client, body) async

Create a customer address

Creates a new customer address.

Parameters:

  • body (CreateCustomerAddressRequest) –

    Request payload for creating a new customer address with complete contact and location information Example: {'customer_id': 2003, 'entity_type': 'shipping', 'first_name': 'Maria', 'last_name': 'Garcia', 'company': 'Cafe Central', 'phone': '+1-555-0127', 'line_1': '789 Main Street', 'line_2': 'Unit 5', 'city': 'San Francisco', 'state': 'CA', 'zip': '94102', 'country': 'US', 'is_default': True}.

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_address/create_customer_address.py
async def asyncio(
    *,
    client: AuthenticatedClient | Client,
    body: CreateCustomerAddressRequest,
) -> CustomerAddress | DetailedErrorResponse | ErrorResponse | None:
    """Create a customer address

     Creates a new customer address.

    Args:
        body (CreateCustomerAddressRequest): Request payload for creating a new customer address
            with complete contact and location information Example: {'customer_id': 2003,
            'entity_type': 'shipping', 'first_name': 'Maria', 'last_name': 'Garcia', 'company': 'Cafe
            Central', 'phone': '+1-555-0127', 'line_1': '789 Main Street', 'line_2': 'Unit 5', 'city':
            'San Francisco', 'state': 'CA', 'zip': '94102', 'country': 'US', 'is_default': True}.

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

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

asyncio_detailed(*, client, body) async

Create a customer address

Creates a new customer address.

Parameters:

  • body (CreateCustomerAddressRequest) –

    Request payload for creating a new customer address with complete contact and location information Example: {'customer_id': 2003, 'entity_type': 'shipping', 'first_name': 'Maria', 'last_name': 'Garcia', 'company': 'Cafe Central', 'phone': '+1-555-0127', 'line_1': '789 Main Street', 'line_2': 'Unit 5', 'city': 'San Francisco', 'state': 'CA', 'zip': '94102', 'country': 'US', 'is_default': True}.

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_address/create_customer_address.py
async def asyncio_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateCustomerAddressRequest,
) -> Response[CustomerAddress | DetailedErrorResponse | ErrorResponse]:
    """Create a customer address

     Creates a new customer address.

    Args:
        body (CreateCustomerAddressRequest): Request payload for creating a new customer address
            with complete contact and location information Example: {'customer_id': 2003,
            'entity_type': 'shipping', 'first_name': 'Maria', 'last_name': 'Garcia', 'company': 'Cafe
            Central', 'phone': '+1-555-0127', 'line_1': '789 Main Street', 'line_2': 'Unit 5', 'city':
            'San Francisco', 'state': 'CA', 'zip': '94102', 'country': 'US', 'is_default': True}.

    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[CustomerAddress, DetailedErrorResponse, 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 address

Creates a new customer address.

Parameters:

  • body (CreateCustomerAddressRequest) –

    Request payload for creating a new customer address with complete contact and location information Example: {'customer_id': 2003, 'entity_type': 'shipping', 'first_name': 'Maria', 'last_name': 'Garcia', 'company': 'Cafe Central', 'phone': '+1-555-0127', 'line_1': '789 Main Street', 'line_2': 'Unit 5', 'city': 'San Francisco', 'state': 'CA', 'zip': '94102', 'country': 'US', 'is_default': True}.

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_address/create_customer_address.py
def sync(
    *,
    client: AuthenticatedClient | Client,
    body: CreateCustomerAddressRequest,
) -> CustomerAddress | DetailedErrorResponse | ErrorResponse | None:
    """Create a customer address

     Creates a new customer address.

    Args:
        body (CreateCustomerAddressRequest): Request payload for creating a new customer address
            with complete contact and location information Example: {'customer_id': 2003,
            'entity_type': 'shipping', 'first_name': 'Maria', 'last_name': 'Garcia', 'company': 'Cafe
            Central', 'phone': '+1-555-0127', 'line_1': '789 Main Street', 'line_2': 'Unit 5', 'city':
            'San Francisco', 'state': 'CA', 'zip': '94102', 'country': 'US', 'is_default': True}.

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

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

sync_detailed(*, client, body)

Create a customer address

Creates a new customer address.

Parameters:

  • body (CreateCustomerAddressRequest) –

    Request payload for creating a new customer address with complete contact and location information Example: {'customer_id': 2003, 'entity_type': 'shipping', 'first_name': 'Maria', 'last_name': 'Garcia', 'company': 'Cafe Central', 'phone': '+1-555-0127', 'line_1': '789 Main Street', 'line_2': 'Unit 5', 'city': 'San Francisco', 'state': 'CA', 'zip': '94102', 'country': 'US', 'is_default': True}.

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_address/create_customer_address.py
def sync_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateCustomerAddressRequest,
) -> Response[CustomerAddress | DetailedErrorResponse | ErrorResponse]:
    """Create a customer address

     Creates a new customer address.

    Args:
        body (CreateCustomerAddressRequest): Request payload for creating a new customer address
            with complete contact and location information Example: {'customer_id': 2003,
            'entity_type': 'shipping', 'first_name': 'Maria', 'last_name': 'Garcia', 'company': 'Cafe
            Central', 'phone': '+1-555-0127', 'line_1': '789 Main Street', 'line_2': 'Unit 5', 'city':
            'San Francisco', 'state': 'CA', 'zip': '94102', 'country': 'US', 'is_default': True}.

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

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)