history
From the 《清会典事例》 - the Qing dynasty administrative statutes regulating officials: 「学臣应用员役,傥有招摇撞骗及受贿传递等弊」. The phrase was a legal category long before it became everyday vocabulary, and 招摇撞骗罪 ('crime of impersonation fraud') remains a formal charge in the PRC Criminal Code.