If you are trying to redeem a Vanilla gift card to your Apple Account, that will not work. It is also unlikely you can add it as a payment type since it is not a credit or debit card. You would need to use it in a store where you can use it to buy Apple gift cards and then redeem those to your account.
The article "What type of gift card do I have?" explains the different kinds of gift cards Apple uses, has links on how to redeem them, and what can be purchased with each kind. Click on the link --> What type of gift card do I have? - Apple Support
Ref:
Payment methods that you can use with your Apple ID - Apple Support