Li Cheng is a fictional character based on a successful member of the Merchant Class, one of the four classes in Ancient Chinese society. During that era any foreign trader operating in Japan would have had to be careful and have powerful connections in order to remain in Japan as a foreigner. Trading and diplomatic ships were generally routed through Hakata (near modern day Fukouka) during the Heian era, but that does not mean there were no foreign traders that came by other routes. In The Accidental Samurai Li Cheng was trading in Southern Honshu and had been to Heian-Kyo. He had been in Japan for many years. Someone like Li Cheng could have come on a route that landed in Southern Honshu surreptitiously or could have come through Hakata and stayed in Japan if he became a subject of Japan. It is also possible that he landed in a small trading vessel with the support of powerful local or national connections.