All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
It seems to us – and Allah knows best – that you should go back to the shopkeeper and ask him to seek the permission of the owner of the shop about the exchange that took place. If the shop owner gives his permission, then there is no problem, but if he refuses, then you must return the cloth and take the first piece. The shopkeeper is an agent of the owner of the shop, and he acted contrary to his permission, from what appears to us, so his actions are void unless the shop owner approves of them.
The Kuwaiti Fiqh Encyclopedia reads:
“If the agent acts contrary to the permission of the person who entrusted him, such as ordering him to sell for cash and he sells on credit, then the sale done by the agent here depends on the approval of the owner. If the owner gives his approval, it is valid; otherwise, the agent is responsible for it. This is the view of the Hanafi and Maaliki Schools, whereas the Hanbali School has two opinions, one regarding its validity and another regarding its invalidity. According to the Shaafi'i school, if the agent conducts a sale that is not permitted by the person who gave him the agency, then the sale of the agent is void.”
Allah knows best.