def METHOD_NAME(cls, lines_data, cleaned_input):
    order_lines = cls.get_nodes_or_error(
        [line["order_line_id"] for line in lines_data],
        field="order_lines",
        only_type=OrderLine,
        qs=order_models.OrderLine.objects.prefetch_related(
            "fulfillment_lines__fulfillment", "variant", "allocations"
        ),
    )
    order_lines = list(order_lines)
    cleaned_order_lines = []
    for line, line_data in zip(order_lines, lines_data):
        quantity = line_data["quantity"]
        if line.is_gift_card:
            cls._raise_error_for_line(
                "Cannot refund or return gift card line.",
                "OrderLine",
                line.pk,
                "order_line_id",
                OrderErrorCode.GIFT_CARD_LINE.value,
            )
        if line.quantity < quantity:
            cls._raise_error_for_line(
                "Provided quantity is bigger than quantity from order line.",
                "OrderLine",
                line.pk,
                "order_line_id",
            )
        quantity_ready_to_move = line.quantity_unfulfilled
        if quantity_ready_to_move < quantity:
            cls._raise_error_for_line(
                "Provided quantity is bigger than unfulfilled quantity.",
                "OrderLine",
                line.pk,
                "order_line_id",
            )
        variant = line.variant
        replace = line_data.get("replace", False)
        if replace and not line.variant_id:
            cls._raise_error_for_line(
                "Unable to replace line as the assigned product doesn't exist.",
                "OrderLine",
                line.pk,
                "order_line_id",
            )
        cleaned_order_lines.append(
            OrderLineInfo(
                line=line, quantity=quantity, variant=variant, replace=replace
            )
        )
    cleaned_input["order_lines"] = cleaned_order_lines