This hadith which I found on Islam QA is:
It was narrated that Ma’qil ibn Yassaar said: the Messenger of Allaah (peace and blessings of Allaah be upon him) said: “For one of you to be stabbed in the head with an iron needle is better for him than that he should touch a woman who is not permissible for him.”
Narrated by al-Tabaraani in al-Kabeer, 486. Shaykh al-Albaani said in Saheeh al-Jaami’, 5045, that this hadeeth is saheeh.
According to this article, it is understood from the hadith that touching a woman in any way is haram.
My case is that when you buy something from a shop and the cashier is a woman, she gives you change and you put your hand out to receive it but when the woman gives it, she touches your hand.
Is this a sin or not?