How to fix "You are not authorized to make purchases of this InApp in Sandbox at this time" error
Table of Contents
While testing an In-app purchase in Sandbox mode, you might come across this error.
You are not authorized to make purchases of this InApp in Sandbox at this time.
This Apple ID doesn't have permission to make in app purchases. You can change account permissions in iTunes Connect.
It might not be very obvious how to recover from this. This error message is also quite old since it even mentioned the iTunes Connect, which is the old name of App Store Connect.
In this article, we will learn what is causing this error and how to solve it.
Cause of the problem
In my case, the error "You are not authorized to make purchases of this InApp in Sandbox at this time" happens when I purchase in an Ad-hoc build.
In Ad-hoc build, all purchase are made in a Sandbox mode. You won't be charged when purchasing in this mode.
To test in the sandbox mode, you need two things.
- You need a special test account, not your normal Apple account.
- The test account needs to be created under the same team as the one that generated the Ad-hoc provisioning profile.
Failing to do either one of the above would cause the error.
You can easily support sarunw.com by checking out this sponsor.
Glassfy: The SDK to simplify building, managing, and growing in-app purchases. Full set of monetisation tools from subscription management to Paywalls and more.
How to fix "You are not authorized to make purchases of this InApp in Sandbox at this time"
To fix the error, you need to create a test user and use it as a Sandbox account.
How to create a test user
To create a test user, you need to go to https://appstoreconnect.apple.com/
- Select "User and Access" menu.
- Select the "Sandbox Testers" tab.
- Create a new tester by clicking on the Plus button, then fill in all the information.
Now, you got a Sandbox tester account. The next step is to use this account for purchasing Sandbox mode.
How to use a test user in Sandbox environment
To purchase with a test account, you need to sign in with that account.
Apple has a separate Sandbox sign-in process for a test account.
To sign in to a Sandbox Account:
- Go to "Settings".
- Select "App Store".
- Scroll down until you see the "Sandbox Account" section.
- Sign in using your Sandbox user.
That's all you need to do, try making a purchase again, and the problem should be gone.
Read more article about Debugging, In-App Purchase, or see all available topic
Enjoy the read?
If you enjoy this article, you can subscribe to the weekly newsletter.
Every Friday, you'll get a quick recap of all articles and tips posted on this site. No strings attached. Unsubscribe anytime.
Feel free to follow me on Twitter and ask your questions related to this post. Thanks for reading and see you next time.
If you enjoy my writing, please check out my Patreon https://www.patreon.com/sarunw and become my supporter. Sharing the article is also greatly appreciated.Become a patron Buy me a coffee Tweet Share
What are Character and Run in AttributedString
Learn about the two important views in AttributedString, characters, and run.
How to Reload view in SwiftUI
Learn how to refresh a view with new data in SwiftUI.