Not everyone knows that any online store accepts orders not only online but by phone. Accordingly, using the phone, you can not only order, but to cancel it. But this should not be done on the day of delivery of the order, and it is better to call and report about his desire to cancel the order in advance. If you selected cash as the payment method, you will not lose anything by cancelling the order for a few minutes before delivery, but it's unlikely you will be able to make purchases in this shop the future.
When you pay for goods in the online store by credit card, the refusal shall be made by email with a request to cancel the order and transfer the money to your account back. If your order is already in transit, you can return the money only after receiving the goods and return, if required by the rules of the store (in some foreign stores and the product is not refundable). In this case, you should ask the store in which the order has been made, the conditions of goods return.
The best thing to do cancel an order "without delay" in order not to create unnecessary trouble neither myself nor the staff of the online store.