Your Tamagotchi can hold only a certain number of meals, snacks, and items. When you reach the maximum, you aren't allowed to purchase any more (or use shop codes.) Consume a snack you purchased, then try the shop code again.
If you have the maximum amount of items or foods or snacks you won't be able to enter shop codes because there are codes for items, snacks, and meals even though the list that is full isn't the one you intend to add items to. Delete one of your items or use one time use items or eat one of your foods and snacks.