How to fix "You are not authorized to make purchases of this InApp in Sandbox at this time" error

⋅ 2 min read ⋅ Debugging In-App Purchase

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.

You are not authorized to make purchases of this InApp in Sandbox at this time.
You are not authorized to make purchases of this InApp in Sandbox at this time.

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.

  1. You need a special test account, not your normal Apple account.
  2. 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.

Sponsor sarunw.com and reach thousands of iOS developers.

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/

  1. Select "User and Access" menu.
User and Access.
User and Access.
  1. Select the "Sandbox Testers" tab.
Sandbox Testers.
Sandbox Testers.
  1. Create a new tester by clicking on the Plus button, then fill in all the information.
New Tester.
New Tester.

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:

  1. Go to "Settings".
  2. Select "App Store".
  3. Scroll down until you see the "Sandbox Account" section.
  4. Sign in using your Sandbox user.
Sandbox Account.
Sandbox Account.

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
Previous
What are Character and Run in AttributedString

Learn about the two important views in AttributedString, characters, and run.

Next
How to Reload view in SwiftUI

Learn how to refresh a view with new data in SwiftUI.

← Home