About to gift a game.

I already owned Halo Wars 2 Ultimate Edition. and i just wrong click to a standard edition its allow me to buy. at first i want to buy this for my friend but it cant give to a friend.

so how can i refund a game? or get a redeem code to my friend.

You would need to reach out to Xbox Live Support on this OP, they will be be able to help you with billing issues