A polite expression of mild surprise or seeking confirmation. Often used as a conversational response to new information. The plain form is そうなんだ.
See also: そうなんです
来月、転勤することになりました。そうなんですか。
I am being transferred next month. Is that so?
この店、来週閉店するらしいよ。そうなんですか。知
I heard this shop is closing next week. Really? I did not know.