Usually, when you cannot redeem a gift code, it is due to a typo or the addition of an extra space when trying to redeem it. Please be sure that you enter the code exactly as it appears.
Older gift codes are three sets of alternating lowercase letters and numbers (example: a1b2-c3d4-e5f6), while codes issued on Mojang accounts are uppercase (example: B2C3-D4F6-G7H8).
Please make sure that your gift code was originally purchased through Mojang. Unfortunately, we cannot provide support for codes that were obtained through other sites.
If your code still does not work, please contact customer support and provide the code that was used.