Supply shortage or loss in transit
The online trader is obliged to deliver within the period agreed. If he does not fulfill this obligation, he comes to "delayed delivery". The consumer then has two choices: He can wait for the delayed goods or he can withdraw from the contract after setting an appropriate period of grace. In most cases, a period of two to three weeks is considered appropriate.
Setting a period of grace
"I ordered a book from you on 01.01.2015 (order number 12345) and it should have been delivered until 15.01.2015. I'm setting a period of grace of 14 days. If you don't deliver within this period, I withdraw from the contract and demand the refund of the purchase price."
If no delivery period was stated in the contract (e.g. in the terms and conditions of the online trader), the trader has to deliver within 30 days.
If the trader is responsible for the delay (e.g. because he didn't process the order), the consumer is entitled to damages.
Lost during transportation
Unfortunately, it occassionally happens that goods ordered online get lost during the transportation. It is therefore an important question if this is the risk of the trader or of the buyer.
Since 13.06.2014, a new regulation states that regarding a contract between a consumer and a company, the trader bears the risk of losing goods until the moment of delivery to the consumer. So if the delivery gets lost during transportation, the consumer does not have to pay the purchase price. But if the consumer organises the transport on his own, because he did not want the shipping mode offered by the trader, he has to bear the risk as soon as the goods are given to the chosen carrier.
Right to withdraw
Regarding distance selling contracts (e.g. online shopping), consumers have the right to withdraw from the contract 14 days after delivery. However, it is of course also possible to withdraw before delivery.
But: Regarding contracts that are excluded from the right to withdraw (e.g. custom-made goods), this does not apply.