Stocky’s answer about the availability of Soapnut seems a credible one. Western-style soap made from animal fat was first produced in Japan in 1870. (source).
Still, it’s questionable whether any soapy product was commonly used for cleansing. Prior to the beginning of the modern era, bathing held an important place in Japanese society for many reasons (social, religious, recreational, ritual, etc.)(source), but cleansing was not among them. It was the custom to wash oneself before entering the bath so as not to foul the bathwater (which was typically used by many people before being thrown out) . Abrasion was the method of choice for cleaning: “bathing in Japan seems to have involved a preliminary cleansing with exfoliant material and scoops of cold water from a bucket (one of the earliest American visitors to Japan remarks that “sand does duty for soap” in Japan; see Edward Yorke McCauley, With Perry in Japan, ed. Allan B. Cole, Princeton University Press, 1942, p. 105, entry for April 21 1854). Only when clean did one enter the tub of very hot water, whose primary purpose was to relax a tired body.”
(source)