If you've just created a new Apple ID, and it is giving you the message "This Apple ID has not yet been used with the App Store", it is because you have to set your billing and shipping address in your account information.:
- The payment details are not added, please check that you have entered a valid credit/ debit card in the payment section in the below mentioned link, then try.
- After entering the payment details then sign out from your device and then try again to login, try until you get the welcome page.
Login to appleid, go to "Payment & Shipping" and set your address for both Billing and Shipping and enter the details. I think this helps to get out of that cycle.