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):

  • Mint (ManufacturingOrder, PurchaseOrderRow) — the serial-number string doesn't need to pre-exist. The API creates a new record and links it to the target resource.
  • Transfer (SalesOrderRow, StockTransferRow, StockAdjustmentRow) — the serial-number string MUST already exist (typically attached to a ManufacturingOrder output). The API moves the linkage from its current resource to the target. If the string isn't anywhere yet, the entry lands in failed with reason: MISSING — the call still returns 200.

Partial failure is the norm, not the exception. The response carries successful AND failed arrays; consumers must handle both. A 200 status does NOT mean every input was applied — check failed to learn which strings the API rejected.

422 cases: non-existent resource_id returns 422 UnprocessableEntityError with detail No entity found (not 404). Invalid resource_type (e.g. Production) returns 422 with an Ajv-style validation detail.

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``) — the
      serial-number string doesn't need to pre-exist. The API creates a
      new record and links it to the target resource.
    - **Transfer** (``SalesOrderRow``, ``StockTransferRow``,
      ``StockAdjustmentRow``) — the serial-number string MUST already
      exist (typically attached to a ManufacturingOrder output). The
      API moves the linkage from its current resource to the target.
      If the string isn't anywhere yet, the entry lands in ``failed``
      with ``reason: MISSING`` — the call still returns 200.

    **Partial failure is the norm, not the exception.** The response
    carries ``successful`` AND ``failed`` arrays; consumers must
    handle both. A 200 status does NOT mean every input was applied —
    check ``failed`` to learn which strings the API rejected.

    **422 cases:** non-existent ``resource_id`` returns
    ``422 UnprocessableEntityError`` with detail ``No entity found``
    (not 404). Invalid ``resource_type`` (e.g. ``Production``)
    returns 422 with an Ajv-style validation detail.

    **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):

  • Mint (ManufacturingOrder, PurchaseOrderRow) — the serial-number string doesn't need to pre-exist. The API creates a new record and links it to the target resource.
  • Transfer (SalesOrderRow, StockTransferRow, StockAdjustmentRow) — the serial-number string MUST already exist (typically attached to a ManufacturingOrder output). The API moves the linkage from its current resource to the target. If the string isn't anywhere yet, the entry lands in failed with reason: MISSING — the call still returns 200.

Partial failure is the norm, not the exception. The response carries successful AND failed arrays; consumers must handle both. A 200 status does NOT mean every input was applied — check failed to learn which strings the API rejected.

422 cases: non-existent resource_id returns 422 UnprocessableEntityError with detail No entity found (not 404). Invalid resource_type (e.g. Production) returns 422 with an Ajv-style validation detail.

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``) — the
      serial-number string doesn't need to pre-exist. The API creates a
      new record and links it to the target resource.
    - **Transfer** (``SalesOrderRow``, ``StockTransferRow``,
      ``StockAdjustmentRow``) — the serial-number string MUST already
      exist (typically attached to a ManufacturingOrder output). The
      API moves the linkage from its current resource to the target.
      If the string isn't anywhere yet, the entry lands in ``failed``
      with ``reason: MISSING`` — the call still returns 200.

    **Partial failure is the norm, not the exception.** The response
    carries ``successful`` AND ``failed`` arrays; consumers must
    handle both. A 200 status does NOT mean every input was applied —
    check ``failed`` to learn which strings the API rejected.

    **422 cases:** non-existent ``resource_id`` returns
    ``422 UnprocessableEntityError`` with detail ``No entity found``
    (not 404). Invalid ``resource_type`` (e.g. ``Production``)
    returns 422 with an Ajv-style validation detail.

    **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):

  • Mint (ManufacturingOrder, PurchaseOrderRow) — the serial-number string doesn't need to pre-exist. The API creates a new record and links it to the target resource.
  • Transfer (SalesOrderRow, StockTransferRow, StockAdjustmentRow) — the serial-number string MUST already exist (typically attached to a ManufacturingOrder output). The API moves the linkage from its current resource to the target. If the string isn't anywhere yet, the entry lands in failed with reason: MISSING — the call still returns 200.

Partial failure is the norm, not the exception. The response carries successful AND failed arrays; consumers must handle both. A 200 status does NOT mean every input was applied — check failed to learn which strings the API rejected.

422 cases: non-existent resource_id returns 422 UnprocessableEntityError with detail No entity found (not 404). Invalid resource_type (e.g. Production) returns 422 with an Ajv-style validation detail.

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``) — the
      serial-number string doesn't need to pre-exist. The API creates a
      new record and links it to the target resource.
    - **Transfer** (``SalesOrderRow``, ``StockTransferRow``,
      ``StockAdjustmentRow``) — the serial-number string MUST already
      exist (typically attached to a ManufacturingOrder output). The
      API moves the linkage from its current resource to the target.
      If the string isn't anywhere yet, the entry lands in ``failed``
      with ``reason: MISSING`` — the call still returns 200.

    **Partial failure is the norm, not the exception.** The response
    carries ``successful`` AND ``failed`` arrays; consumers must
    handle both. A 200 status does NOT mean every input was applied —
    check ``failed`` to learn which strings the API rejected.

    **422 cases:** non-existent ``resource_id`` returns
    ``422 UnprocessableEntityError`` with detail ``No entity found``
    (not 404). Invalid ``resource_type`` (e.g. ``Production``)
    returns 422 with an Ajv-style validation detail.

    **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):

  • Mint (ManufacturingOrder, PurchaseOrderRow) — the serial-number string doesn't need to pre-exist. The API creates a new record and links it to the target resource.
  • Transfer (SalesOrderRow, StockTransferRow, StockAdjustmentRow) — the serial-number string MUST already exist (typically attached to a ManufacturingOrder output). The API moves the linkage from its current resource to the target. If the string isn't anywhere yet, the entry lands in failed with reason: MISSING — the call still returns 200.

Partial failure is the norm, not the exception. The response carries successful AND failed arrays; consumers must handle both. A 200 status does NOT mean every input was applied — check failed to learn which strings the API rejected.

422 cases: non-existent resource_id returns 422 UnprocessableEntityError with detail No entity found (not 404). Invalid resource_type (e.g. Production) returns 422 with an Ajv-style validation detail.

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``) — the
      serial-number string doesn't need to pre-exist. The API creates a
      new record and links it to the target resource.
    - **Transfer** (``SalesOrderRow``, ``StockTransferRow``,
      ``StockAdjustmentRow``) — the serial-number string MUST already
      exist (typically attached to a ManufacturingOrder output). The
      API moves the linkage from its current resource to the target.
      If the string isn't anywhere yet, the entry lands in ``failed``
      with ``reason: MISSING`` — the call still returns 200.

    **Partial failure is the norm, not the exception.** The response
    carries ``successful`` AND ``failed`` arrays; consumers must
    handle both. A 200 status does NOT mean every input was applied —
    check ``failed`` to learn which strings the API rejected.

    **422 cases:** non-existent ``resource_id`` returns
    ``422 UnprocessableEntityError`` with detail ``No entity found``
    (not 404). Invalid ``resource_type`` (e.g. ``Production``)
    returns 422 with an Ajv-style validation detail.

    **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)