Skip to content

katana_public_api_client.api.tax_rate.create_tax_rate

katana_public_api_client.api.tax_rate.create_tax_rate

Classes

Functions

asyncio(*, client, body) async

Create a tax rate

Creates a new tax rate object.

Parameters:

  • body (CreateTaxRateRequest) –

    Request payload for creating a new tax rate to be applied to sales and purchase orders for financial compliance Example: {'name': 'VAT 20%', 'rate': 20.0}.

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/tax_rate/create_tax_rate.py
async def asyncio(
    *,
    client: AuthenticatedClient | Client,
    body: CreateTaxRateRequest,
) -> DetailedErrorResponse | ErrorResponse | TaxRate | None:
    """Create a tax rate

     Creates a new tax rate object.

    Args:
        body (CreateTaxRateRequest): Request payload for creating a new tax rate to be applied to
            sales and purchase orders for financial compliance
             Example: {'name': 'VAT 20%', 'rate': 20.0}.


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

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

asyncio_detailed(*, client, body) async

Create a tax rate

Creates a new tax rate object.

Parameters:

  • body (CreateTaxRateRequest) –

    Request payload for creating a new tax rate to be applied to sales and purchase orders for financial compliance Example: {'name': 'VAT 20%', 'rate': 20.0}.

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/tax_rate/create_tax_rate.py
async def asyncio_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateTaxRateRequest,
) -> Response[DetailedErrorResponse | ErrorResponse | TaxRate]:
    """Create a tax rate

     Creates a new tax rate object.

    Args:
        body (CreateTaxRateRequest): Request payload for creating a new tax rate to be applied to
            sales and purchase orders for financial compliance
             Example: {'name': 'VAT 20%', 'rate': 20.0}.


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

    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 tax rate

Creates a new tax rate object.

Parameters:

  • body (CreateTaxRateRequest) –

    Request payload for creating a new tax rate to be applied to sales and purchase orders for financial compliance Example: {'name': 'VAT 20%', 'rate': 20.0}.

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/tax_rate/create_tax_rate.py
def sync(
    *,
    client: AuthenticatedClient | Client,
    body: CreateTaxRateRequest,
) -> DetailedErrorResponse | ErrorResponse | TaxRate | None:
    """Create a tax rate

     Creates a new tax rate object.

    Args:
        body (CreateTaxRateRequest): Request payload for creating a new tax rate to be applied to
            sales and purchase orders for financial compliance
             Example: {'name': 'VAT 20%', 'rate': 20.0}.


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

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

sync_detailed(*, client, body)

Create a tax rate

Creates a new tax rate object.

Parameters:

  • body (CreateTaxRateRequest) –

    Request payload for creating a new tax rate to be applied to sales and purchase orders for financial compliance Example: {'name': 'VAT 20%', 'rate': 20.0}.

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/tax_rate/create_tax_rate.py
def sync_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateTaxRateRequest,
) -> Response[DetailedErrorResponse | ErrorResponse | TaxRate]:
    """Create a tax rate

     Creates a new tax rate object.

    Args:
        body (CreateTaxRateRequest): Request payload for creating a new tax rate to be applied to
            sales and purchase orders for financial compliance
             Example: {'name': 'VAT 20%', 'rate': 20.0}.


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

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)