Skip to content

katana_public_api_client.api.serial_number.create_serial_numbers

katana_public_api_client.api.serial_number.create_serial_numbers

Classes

Functions

asyncio(*, client, body) async

Create serial numbers

Mints new or transfers existing serial numbers to a resource.

Write semantics differ by resource_type (see CreateSerialNumberResourceType):

  • MintManufacturingOrder, PurchaseOrderRow.
  • Transfer (move an existing serial number onto the target) — SalesOrderRow, StockTransferRow, StockAdjustmentRow, Production. The serial-number string must already exist.

Error cases (verified live 2026-07-14, #980): a non-existent resource_id returns 404 NotFoundError with a type-specific message (e.g. manufacturing order <id> not found / production <id> not found). A resource_type outside the CreateSerialNumberResourceType enum returns 422 with an Ajv-style validation detail. A serial-number string the tenant doesn't already know is rejected with 422 — observed for SalesOrderRow (serial numbers not found) and Production (UnknownSerialNumber). The successful / failed partial-outcome response shape below was NOT reproduced for these cases and needs re-verification — tracked in #983.

Transfer response quirks: on a successful transfer the moved record's transaction_id may be the literal string undefined and resource_id may be null — re-fetch via GET /serial_numbers to confirm the landing state.

Parameters:

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/serial_number/create_serial_numbers.py
async def asyncio(
    *,
    client: AuthenticatedClient | Client,
    body: CreateSerialNumbersRequest,
) -> CreateSerialNumbersResponse | DetailedErrorResponse | ErrorResponse | None:
    """Create serial numbers

     Mints new or transfers existing serial numbers to a resource.

    **Write semantics differ by ``resource_type``** (see
    ``CreateSerialNumberResourceType``):

    - **Mint** — ``ManufacturingOrder``, ``PurchaseOrderRow``.
    - **Transfer** (move an existing serial number onto the target) —
      ``SalesOrderRow``, ``StockTransferRow``, ``StockAdjustmentRow``,
      ``Production``. The serial-number string must already exist.

    **Error cases** (verified live 2026-07-14, #980): a non-existent
    ``resource_id`` returns ``404 NotFoundError`` with a type-specific
    message (e.g. ``manufacturing order <id> not found`` /
    ``production <id> not found``). A ``resource_type`` outside the
    ``CreateSerialNumberResourceType`` enum returns ``422`` with an
    Ajv-style validation detail. A serial-number string the tenant
    doesn't already know is rejected with ``422`` — observed for
    ``SalesOrderRow`` (``serial numbers not found``) and ``Production``
    (``UnknownSerialNumber``). The ``successful`` / ``failed``
    partial-outcome response shape below was NOT reproduced for these
    cases and needs re-verification — tracked in #983.

    **Transfer response quirks:** on a successful transfer the moved
    record's ``transaction_id`` may be the literal string
    ``undefined`` and ``resource_id`` may be ``null`` — re-fetch via
    ``GET /serial_numbers`` to confirm the landing state.

    Args:
        body (CreateSerialNumbersRequest): Request payload for creating serial numbers for a
            resource

    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:
        CreateSerialNumbersResponse | DetailedErrorResponse | ErrorResponse
    """

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

asyncio_detailed(*, client, body) async

Create serial numbers

Mints new or transfers existing serial numbers to a resource.

Write semantics differ by resource_type (see CreateSerialNumberResourceType):

  • MintManufacturingOrder, PurchaseOrderRow.
  • Transfer (move an existing serial number onto the target) — SalesOrderRow, StockTransferRow, StockAdjustmentRow, Production. The serial-number string must already exist.

Error cases (verified live 2026-07-14, #980): a non-existent resource_id returns 404 NotFoundError with a type-specific message (e.g. manufacturing order <id> not found / production <id> not found). A resource_type outside the CreateSerialNumberResourceType enum returns 422 with an Ajv-style validation detail. A serial-number string the tenant doesn't already know is rejected with 422 — observed for SalesOrderRow (serial numbers not found) and Production (UnknownSerialNumber). The successful / failed partial-outcome response shape below was NOT reproduced for these cases and needs re-verification — tracked in #983.

Transfer response quirks: on a successful transfer the moved record's transaction_id may be the literal string undefined and resource_id may be null — re-fetch via GET /serial_numbers to confirm the landing state.

Parameters:

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/serial_number/create_serial_numbers.py
async def asyncio_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateSerialNumbersRequest,
) -> Response[CreateSerialNumbersResponse | DetailedErrorResponse | ErrorResponse]:
    """Create serial numbers

     Mints new or transfers existing serial numbers to a resource.

    **Write semantics differ by ``resource_type``** (see
    ``CreateSerialNumberResourceType``):

    - **Mint** — ``ManufacturingOrder``, ``PurchaseOrderRow``.
    - **Transfer** (move an existing serial number onto the target) —
      ``SalesOrderRow``, ``StockTransferRow``, ``StockAdjustmentRow``,
      ``Production``. The serial-number string must already exist.

    **Error cases** (verified live 2026-07-14, #980): a non-existent
    ``resource_id`` returns ``404 NotFoundError`` with a type-specific
    message (e.g. ``manufacturing order <id> not found`` /
    ``production <id> not found``). A ``resource_type`` outside the
    ``CreateSerialNumberResourceType`` enum returns ``422`` with an
    Ajv-style validation detail. A serial-number string the tenant
    doesn't already know is rejected with ``422`` — observed for
    ``SalesOrderRow`` (``serial numbers not found``) and ``Production``
    (``UnknownSerialNumber``). The ``successful`` / ``failed``
    partial-outcome response shape below was NOT reproduced for these
    cases and needs re-verification — tracked in #983.

    **Transfer response quirks:** on a successful transfer the moved
    record's ``transaction_id`` may be the literal string
    ``undefined`` and ``resource_id`` may be ``null`` — re-fetch via
    ``GET /serial_numbers`` to confirm the landing state.

    Args:
        body (CreateSerialNumbersRequest): Request payload for creating serial numbers for a
            resource

    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[CreateSerialNumbersResponse | 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 serial numbers

Mints new or transfers existing serial numbers to a resource.

Write semantics differ by resource_type (see CreateSerialNumberResourceType):

  • MintManufacturingOrder, PurchaseOrderRow.
  • Transfer (move an existing serial number onto the target) — SalesOrderRow, StockTransferRow, StockAdjustmentRow, Production. The serial-number string must already exist.

Error cases (verified live 2026-07-14, #980): a non-existent resource_id returns 404 NotFoundError with a type-specific message (e.g. manufacturing order <id> not found / production <id> not found). A resource_type outside the CreateSerialNumberResourceType enum returns 422 with an Ajv-style validation detail. A serial-number string the tenant doesn't already know is rejected with 422 — observed for SalesOrderRow (serial numbers not found) and Production (UnknownSerialNumber). The successful / failed partial-outcome response shape below was NOT reproduced for these cases and needs re-verification — tracked in #983.

Transfer response quirks: on a successful transfer the moved record's transaction_id may be the literal string undefined and resource_id may be null — re-fetch via GET /serial_numbers to confirm the landing state.

Parameters:

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/serial_number/create_serial_numbers.py
def sync(
    *,
    client: AuthenticatedClient | Client,
    body: CreateSerialNumbersRequest,
) -> CreateSerialNumbersResponse | DetailedErrorResponse | ErrorResponse | None:
    """Create serial numbers

     Mints new or transfers existing serial numbers to a resource.

    **Write semantics differ by ``resource_type``** (see
    ``CreateSerialNumberResourceType``):

    - **Mint** — ``ManufacturingOrder``, ``PurchaseOrderRow``.
    - **Transfer** (move an existing serial number onto the target) —
      ``SalesOrderRow``, ``StockTransferRow``, ``StockAdjustmentRow``,
      ``Production``. The serial-number string must already exist.

    **Error cases** (verified live 2026-07-14, #980): a non-existent
    ``resource_id`` returns ``404 NotFoundError`` with a type-specific
    message (e.g. ``manufacturing order <id> not found`` /
    ``production <id> not found``). A ``resource_type`` outside the
    ``CreateSerialNumberResourceType`` enum returns ``422`` with an
    Ajv-style validation detail. A serial-number string the tenant
    doesn't already know is rejected with ``422`` — observed for
    ``SalesOrderRow`` (``serial numbers not found``) and ``Production``
    (``UnknownSerialNumber``). The ``successful`` / ``failed``
    partial-outcome response shape below was NOT reproduced for these
    cases and needs re-verification — tracked in #983.

    **Transfer response quirks:** on a successful transfer the moved
    record's ``transaction_id`` may be the literal string
    ``undefined`` and ``resource_id`` may be ``null`` — re-fetch via
    ``GET /serial_numbers`` to confirm the landing state.

    Args:
        body (CreateSerialNumbersRequest): Request payload for creating serial numbers for a
            resource

    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:
        CreateSerialNumbersResponse | DetailedErrorResponse | ErrorResponse
    """

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

sync_detailed(*, client, body)

Create serial numbers

Mints new or transfers existing serial numbers to a resource.

Write semantics differ by resource_type (see CreateSerialNumberResourceType):

  • MintManufacturingOrder, PurchaseOrderRow.
  • Transfer (move an existing serial number onto the target) — SalesOrderRow, StockTransferRow, StockAdjustmentRow, Production. The serial-number string must already exist.

Error cases (verified live 2026-07-14, #980): a non-existent resource_id returns 404 NotFoundError with a type-specific message (e.g. manufacturing order <id> not found / production <id> not found). A resource_type outside the CreateSerialNumberResourceType enum returns 422 with an Ajv-style validation detail. A serial-number string the tenant doesn't already know is rejected with 422 — observed for SalesOrderRow (serial numbers not found) and Production (UnknownSerialNumber). The successful / failed partial-outcome response shape below was NOT reproduced for these cases and needs re-verification — tracked in #983.

Transfer response quirks: on a successful transfer the moved record's transaction_id may be the literal string undefined and resource_id may be null — re-fetch via GET /serial_numbers to confirm the landing state.

Parameters:

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/serial_number/create_serial_numbers.py
def sync_detailed(
    *,
    client: AuthenticatedClient | Client,
    body: CreateSerialNumbersRequest,
) -> Response[CreateSerialNumbersResponse | DetailedErrorResponse | ErrorResponse]:
    """Create serial numbers

     Mints new or transfers existing serial numbers to a resource.

    **Write semantics differ by ``resource_type``** (see
    ``CreateSerialNumberResourceType``):

    - **Mint** — ``ManufacturingOrder``, ``PurchaseOrderRow``.
    - **Transfer** (move an existing serial number onto the target) —
      ``SalesOrderRow``, ``StockTransferRow``, ``StockAdjustmentRow``,
      ``Production``. The serial-number string must already exist.

    **Error cases** (verified live 2026-07-14, #980): a non-existent
    ``resource_id`` returns ``404 NotFoundError`` with a type-specific
    message (e.g. ``manufacturing order <id> not found`` /
    ``production <id> not found``). A ``resource_type`` outside the
    ``CreateSerialNumberResourceType`` enum returns ``422`` with an
    Ajv-style validation detail. A serial-number string the tenant
    doesn't already know is rejected with ``422`` — observed for
    ``SalesOrderRow`` (``serial numbers not found``) and ``Production``
    (``UnknownSerialNumber``). The ``successful`` / ``failed``
    partial-outcome response shape below was NOT reproduced for these
    cases and needs re-verification — tracked in #983.

    **Transfer response quirks:** on a successful transfer the moved
    record's ``transaction_id`` may be the literal string
    ``undefined`` and ``resource_id`` may be ``null`` — re-fetch via
    ``GET /serial_numbers`` to confirm the landing state.

    Args:
        body (CreateSerialNumbersRequest): Request payload for creating serial numbers for a
            resource

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

    kwargs = _get_kwargs(
        body=body,
    )

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

    return _build_response(client=client, response=response)