Locate the 16-digit code on the back of your gift card. (You may need to peel or scratch off the label first).
Open the App Store on your Mac.
Click on your name or the sign-in button in the sidebar to get to your “Account” page.
Select “Redeem Gift Card” in the top-right corner.
Select “Use Camera” and apple.com/redeem follow the instructions on the screen to upload the card info instantly. You can also tap “Enter Code Manually,” then follow the instructions on the screen to input the card info yourself.