Hello Mohan,
This error normally means the code was issued for a different region than the region on your Microsoft account.
First, make sure your Microsoft account and Xbox location are set to your actual country/region. If they already are, Xbox Support specifically advises contacting the retailer when a purchased code does not match your account region.
Since the code was purchased from Amazon, I would contact Amazon and request a replacement code for the correct region or a refund.