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.
Mojang gift codes are five sets of five numbers and letters (example: A1B2C-D3E4F-G5H6I-J7K8L-M9N0P). Older gift codes were three sets of alternating numbers and letters, either lowercase or uppercase (example: a1b2-c3d4-e5f6 or 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.