How was the first Esperanto book paid for?

The first Esperanto book was paid for with a wedding dowry. Zamenhof had finished the manuscript in spring 1885 and then spent about two years looking for a publisher. In 1887 he married Klara. Her father, Aleksandr Silbernik, advised him to use money from her dowry to pay for publication himself.
So the 42-page book came out in Warsaw on 26 July 1887, under the pseudonym "Dr. Esperanto". It did not yet call the language Esperanto. It called it simply "the international language". The name came from the pseudonym and only caught on around 1889. The dictionary had just 917 roots.
The book also asked readers to sign a pledge promising to learn the language. The target was 10 million signatures. By 1889 there were about 1,000, roughly 0.01% of the goal.
Sources: en.wikipedia.org