SKErrorDomain Error 0: What SKError.Code.unknown Means and How to Triage It
A purchase attempt returns SKErrorDomain error 0, which surfaces in code as SKError.Code.unknown. The label is honest: StoreKit is reporting a failure without telling you which condition caused it, and the fault may sit in Apple's systems rather than in your app. That makes a fixed order of checks more useful than guesswork. Start with outages, isolate the Apple API layer with a local StoreKit configuration file, then audit App Store Connect and your test accounts. The steps below follow that order and explain what each result rules out.
Why this error is hard to act on
StoreKit hands back code 0 when it cannot classify the failure, so the number itself carries no diagnosis. What you can read from it is timing. If purchases were fine last week and started failing with no release in between, the balance of suspicion shifts toward Apple. That shift is a hypothesis, not a verdict: a drifted product configuration or a stale test account produces the same opaque code. Treat error 0 as a cue to run a short elimination sequence, and let each result narrow the field instead of guessing at a cause.
Step 1: Confirm whether a platform outage exists
Begin by checking the status page for the subscription platform you use, then look at Apple's developer system status page. A platform that handles a large volume of purchase traffic often notices StoreKit disruptions early, but that is a general expectation rather than a guarantee. Apple's page is the official place where developer-facing incidents are announced, and it may update later than a third-party monitor. If either page shows an active incident affecting StoreKit, wait for it to be resolved before changing your code.
Step 2: Isolate the Apple API with a StoreKit configuration file
With no known incident, run the app in the simulator against a StoreKit configuration file. This is a recommended way to test in-app purchase problems on iOS because the file mocks the Apple API portion of the purchase flow. The result is diagnostic: if purchases succeed locally, your purchase code and subscription platform configuration are wired correctly, so look next at App Store Connect. If purchases still fail locally, the problem is closer to your code or your local setup, and App Store Connect is unlikely to be the cause. Figure 1 in the original walkthrough shows the configuration file open in Xcode.
Step 3: Audit App Store Connect
If the local test passes, verify the live configuration in App Store Connect. Two checks matter most: first, the bundle id and every product identifier must match between App Store Connect and your subscription platform configuration. Second, each product should be Approved, Ready to Submit, or Waiting on Review. Also open your Paid Applications Agreement and tax forms. They must be signed and unexpired, because lapsed agreements can make API calls fail. Figure 2 shows the subscription product statuses in App Store Connect.
Step 4: Reset corrupted test state
Test environments can end up in a bad state that mimics a real failure. The reset depends on where you are testing. In the simulator with a StoreKit configuration file, delete the app from the simulator and run it again from Xcode. Purchase state is cleared and the app behaves as a brand-new user with no purchases. On a real device in sandbox, create a fresh sandbox test account and retry, following the sandbox testing documentation for your subscription platform. Figure 3 shows where sandbox testers live in App Store Connect. If a clean environment still returns error 0, the remaining explanation is usually outside your control.
Step 5: When waiting is the correct action
In most remaining cases the failure originates in Apple's backend, and no code change will clear it sooner than Apple does. Production sees this less often than the sandbox, but App Review runs in a sandbox environment, so a reviewer can hit an Apple-side failure and reject a build for something the app did not do. When that happens, resubmitting is the practical move, with the hope that the environment behaves for the next reviewer.
Triage at a glance
Use the pattern of failure to choose a starting branch, then confirm with the steps above. The table is a routing aid, not a substitute for the checks themselves.
A worked example
Suppose a subscription purchase that shipped last month now fails in the simulator with error 0, while nothing in the code changed. You check both status pages and find no incident. You then switch the scheme to a StoreKit configuration file and the purchase completes, which tells you the app code and subscription platform configuration are fine and points at App Store Connect. There you find one auto-renewable subscription still sitting in a state outside Approved, Ready to Submit, or Waiting on Review. Correcting that state and retesting resolves the error. Had the configuration-file test also failed, you would have stayed in the local branch and inspected your code and test setup instead.
Before you resubmit after a sandbox rejection
Run through this list so the resubmission is not wasted: both status pages checked and clear at the time of testing; local StoreKit configuration test passing; bundle id and all product identifiers matching between App Store Connect and your subscription platform configuration; every product in an accepted state; Paid Applications Agreement and tax forms signed and current; a fresh sandbox test account used for the final device test; and rejection notes recorded so a pattern of sandbox failures is visible if it recurs.
| Observed pattern | Most likely branch | First check | What a pass proves |
|---|---|---|---|
| Worked previously, now fails everywhere | Apple-side incident | Your subscription platform's status page, then Apple developer system status | No active outage, so continue to local isolation |
| Fails in simulator with a StoreKit configuration file | Local code or test setup | Rerun against the configuration file | A pass means code and backend are configured correctly |
| Passes locally, fails on device or in production | App Store Connect configuration | Bundle id, product identifiers and product status | Identifiers and product states are consistent |
| Fails only for one tester | Corrupted sandbox state | Create a new sandbox test account | A fresh account removes stale purchase state |
| Rejected in App Review with error 0 | Sandbox environment issue | Confirm status pages and local test first | Rules out your own configuration before resubmitting |
Routing guidance assembled from the troubleshooting steps; it does not guarantee a cause for any individual error.
Frequently asked questions
Does SKErrorDomain error 0 always mean Apple is at fault?
No. It is an unknown error from Apple's API, and an Apple-side problem is a common explanation, particularly when nothing changed in your app. Configuration mismatches and corrupted test state can produce the same code, so the checks still matter.
What does a passing StoreKit configuration file test tell me?
It shows that your purchase code and subscription platform configuration are set up correctly, because the file mocks the Apple API layer. It does not clear your App Store Connect configuration, which is the next place to look.
How do I reset purchase state in the simulator?
Delete the app from the simulator and run it again from Xcode. The app should then behave as a new user with no purchases.
Can a sandbox problem cause an App Store rejection?
Yes. App Review works in a sandbox environment, and failures there can lead to a rejection even when your app is not responsible. Resubmitting is the usual response.
Which product states are acceptable in App Store Connect?
Products should be Approved, Ready to Submit, or Waiting on Review. Anything else is worth correcting before further testing.