I wonder how refund works. What if one buys the code, copies it and then ships the voucher back asking for refund? How do you invalidate the code without linking the code to the purchase?
I would imagine that Amazon either won't let you refund this (since it's basically a gift card), or if you try to refund it and return an opened package your refund will get denied.
No need to specifically invalidate the code inside to stop you from doing refund fraud.
It looks like a scratch-off code like on Netflix gift cards. Once you scratched it off there won't be a refund available would be my guess just like any other gift card and many digital purchases.
As someone who does handles a lot of gift cards, it's not hard at all to cover the code back up. They sell little peel and stick things online, or it's not hard to make your own. There are people that go around to stores, take unactivated giftcards, scratch off the sticker to get the code, and will then reapply another one and put it back in the store to be bought and activated by someone, meanwhile they are periodically checking whatever website you can see the balance on to see if it's been activated yet so they can use it or sell it out from under you.
So my guess would be Amazon doesn't take returns on giftcards in the first place.