Hello, good day and thanks for your question. To add to the above, you will not be able to redeem this if you are on a different region from where the gift came from and you friend can try checking if it is eligible for a refund, as "Some products are not eligible for return or refund; unless otherwise provided by law or a specific offer, all purchases of such products are final and non-refundable. Products not eligible for return or refund include, but are not limited to, the following:"
Digital applications, games, in-app content, in-app subscriptions, movies, TV shows and associated content, except for Microsoft digital game products and subscription services.
Third-party subscription services billed through Microsoft.
Gift cards and service/subscription cards (e.g., Skype, Xbox Live).
Customized products.
Special order products, if they are not part of a promotional offer from the Store.
Random access memory ("RAM") products.
Services that have been performed or consumed.
Items on clearance or those marked with a designation such as "Final Sale" or "Non-Returnable".
Reference links: https://support.microsoft.com/en-us/account-billing/get-a-refund-on-apps-and-games-bought-from-microsoft-81629012-aa4f-f48b-2394-8596f415072b
https://www.microsoft.com/en-us/store/b/terms-of-sale
Open the following link in a browser to access the refund process.
https://support.xbox.com/en-us/help/subscriptions-billing/buy-games-apps/refund-orders