Caravanserais have been used since the 10th century when trade across Turkey was dependent on camel trains. It is possible to see some of the most beautiful examples of these around the region of Cappadocia.
Although we stopped at Aksaray, which was built in 1229 we could have stopped at several as they can be found every 30-40km along the road. This is the distance a camel can trek in a day. After that, the merchants would need to provide safe overnight accommodation for themselves and stabling for their animals. Fort-like buildings were constructed where the walls were thick and high so the merchants would be safe from raiders. The construction of these buildings increased when security of the trading routes was provided by the State. Traders would pay a premium to ensure their safety and any loss would have to be met by the State. This is what is generally accepted as the first insurance system.
When Europeans found new ways to China, the Silk Road lost its importance and of course, the caravanserais did as well. After the 15th and 16th centuries, most of the caravanserais were never used again.