Try this -> Add money to your Apple Account balance
Add money to your Apple Account balance - Apple Support
Then check -> Check your Apple ID balance -> Check your Apple ID balance – Apple Support (UK)
I am getting a message saying there is an error.
What kind of error message do you get?
If you update your payment method or add funds to your Apple Account balance, It would take about 1 to 3 business days in order to process.
If you're still unable to update your payment method, Contact Apple Support.
-----
Perhaps you need to check the network connection?
You need to have a good Service and/or Wi-Fi.
If they are On, turn Off Hotspot & VPN.
Charge the battery > 70%.
If you can't connect to the App Store, iTunes Store, or other Apple services
If you can't connect to the App Store, iTunes Store, or other Apple services - Apple Support
-> If you tried all of the above steps and you still can’t connect, contact Apple Support.
If you still need help, get more help and assistant from Apple directly, see Contact Apple for support and service -> Contact Apple for support and service – Apple Support (UK)