take it up with the seller not sure if there is buyer protection on these items now but you can try and raise a dispute if they won't put things right
if the code was sent by email there will not be buyer protection
if it was avoucher you may be lucky
If you are asking for help please give as much detail as possible in your post to help responders find a correct answer for you.
i have the voucher card still so i cant see why im not protected, can they not give code to microsoft and they should know time and what was on code