Skip to content

katana_public_api_client.api.webhook.create_webhook

katana_public_api_client.api.webhook.create_webhook

Classes

Functions

asyncio(*, client, body) async

Create a webhook

Creates a new webhook object.

Parameters:

  • body (CreateWebhookRequest) –

    Request payload for creating a new webhook subscription to receive real-time event notifications Example: {'url': 'https://api.customer.com/webhooks/katana', 'subscribed_events': ['sales_order.created', 'sales_order.delivered', 'current_inventory.product_out_of_stock', 'manufacturing_order.done'], 'description': 'ERP integration webhook for inventory and order sync'}.

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/webhook/create_webhook.py
async def asyncio(
    *,
    client: AuthenticatedClient | Client,
    body: CreateWebhookRequest,
) -> DetailedErrorResponse | ErrorResponse | Webhook | None:
    """Create a webhook

     Creates a new webhook object.

    Args:
        body (CreateWebhookRequest): Request payload for creating a new webhook subscription to
            receive real-time event notifications Example: {'url':
            'https://api.customer.com/webhooks/katana', 'subscribed_events': ['sales_order.created',
            'sales_order.delivered', 'current_inventory.product_out_of_stock',
            'manufacturing_order.done'], 'description': 'ERP integration webhook for inventory and
            order sync'}.

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

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

asyncio_detailed(*, client, body) async

Create a webhook

Creates a new webhook object.

Parameters:

  • body (CreateWebhookRequest) –

    Request payload for creating a new webhook subscription to receive real-time event notifications Example: {'url': 'https://api.customer.com/webhooks/katana', 'subscribed_events': ['sales_order.created', 'sales_order.delivered', 'current_inventory.product_out_of_stock', 'manufacturing_order.done'], 'description': 'ERP integration webhook for inventory and order sync'}.

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/webhook/create_webhook.py
async def asyncio_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateWebhookRequest,
) -> Response[DetailedErrorResponse | ErrorResponse | Webhook]:
    """Create a webhook

     Creates a new webhook object.

    Args:
        body (CreateWebhookRequest): Request payload for creating a new webhook subscription to
            receive real-time event notifications Example: {'url':
            'https://api.customer.com/webhooks/katana', 'subscribed_events': ['sales_order.created',
            'sales_order.delivered', 'current_inventory.product_out_of_stock',
            'manufacturing_order.done'], 'description': 'ERP integration webhook for inventory and
            order sync'}.

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

    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 webhook

Creates a new webhook object.

Parameters:

  • body (CreateWebhookRequest) –

    Request payload for creating a new webhook subscription to receive real-time event notifications Example: {'url': 'https://api.customer.com/webhooks/katana', 'subscribed_events': ['sales_order.created', 'sales_order.delivered', 'current_inventory.product_out_of_stock', 'manufacturing_order.done'], 'description': 'ERP integration webhook for inventory and order sync'}.

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/webhook/create_webhook.py
def sync(
    *,
    client: AuthenticatedClient | Client,
    body: CreateWebhookRequest,
) -> DetailedErrorResponse | ErrorResponse | Webhook | None:
    """Create a webhook

     Creates a new webhook object.

    Args:
        body (CreateWebhookRequest): Request payload for creating a new webhook subscription to
            receive real-time event notifications Example: {'url':
            'https://api.customer.com/webhooks/katana', 'subscribed_events': ['sales_order.created',
            'sales_order.delivered', 'current_inventory.product_out_of_stock',
            'manufacturing_order.done'], 'description': 'ERP integration webhook for inventory and
            order sync'}.

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

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

sync_detailed(*, client, body)

Create a webhook

Creates a new webhook object.

Parameters:

  • body (CreateWebhookRequest) –

    Request payload for creating a new webhook subscription to receive real-time event notifications Example: {'url': 'https://api.customer.com/webhooks/katana', 'subscribed_events': ['sales_order.created', 'sales_order.delivered', 'current_inventory.product_out_of_stock', 'manufacturing_order.done'], 'description': 'ERP integration webhook for inventory and order sync'}.

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/webhook/create_webhook.py
def sync_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateWebhookRequest,
) -> Response[DetailedErrorResponse | ErrorResponse | Webhook]:
    """Create a webhook

     Creates a new webhook object.

    Args:
        body (CreateWebhookRequest): Request payload for creating a new webhook subscription to
            receive real-time event notifications Example: {'url':
            'https://api.customer.com/webhooks/katana', 'subscribed_events': ['sales_order.created',
            'sales_order.delivered', 'current_inventory.product_out_of_stock',
            'manufacturing_order.done'], 'description': 'ERP integration webhook for inventory and
            order sync'}.

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

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)