---
title: "What does invalidCredentialsError (code 11) mean in the purchases SDK?"
description: "invalidCredentialsError (code 11) means the backend rejected the SDK's API key or an auth token, usually code 7225. Copy the app's public SDK key again."
url: https://revenuedot.app/docs/errors/sdk-invalid-credentials-error
---

# What does invalidCredentialsError (code 11) mean in the purchases SDK?

The purchases SDK raises invalidCredentialsError (code 11) when the backend rejects the API key or an auth token.

## Quick facts

| | |
|---|---|
| Error | `ErrorCode.invalidCredentialsError` (iOS), `PurchasesErrorCode.InvalidCredentialsError` (Android), code 11 |
| Where | Purchases SDK (iOS, Android and the hybrid SDKs built on them) |
| What the vendor says | There was a credentials issue. Check the underlying error for more details. |

## Cause

- The backend answered 7225 (invalid API key) or 7224 (invalid auth token). iOS also maps 7104 (invalid App Store shared secret) and 7981, and Android maps 7107 (invalid Play Store credentials).
- The key has a typo, or it belongs to another project or another server; a RevenueCat key sent to RevenueDot is unknown, and the reverse.
- The proxy URL was set after `configure`, or the key is of the wrong kind, such as a `test_` Test Store key in a release build.

## Fix

1. Copy the app's public SDK key again from the app page and check each character.
2. Set `Purchases.proxyURL` before `Purchases.configure`.
3. Use the iOS app's key in the iOS build and the Android app's key in the Android build.
4. On iOS, `PurchasesDiagnostics.default.testSDKHealth()` reports an invalid API key as such.

## Example

```swift
// The purchases SDK throws `ErrorCode` values; match the one you handle and let the rest fall through.
func handle(_ error: Error) {
    guard let code = error as? ErrorCode else {
        print("Not a purchases SDK error: \(error)")
        return
    }
    switch code {
    case .invalidCredentialsError:
        // The key stays wrong until you fix it: alert yourself, show customers a generic message.
        print("The API key was rejected")
    default:
        print("Other purchases error: \(code.description)")
    }
}
```

*Compile-checked: `npm run check:snippets` type-checks this snippet with `swiftc` together with the `ErrorCode.swift` file of the RevenueDot `purchases-ios` fork (checked 2026-10-03).*

## How the RevenueDot SDK reports it

RevenueDot answers 401 with code 7225 for an unknown key. See [the server error codes](https://revenuedot.app/docs/api/errors.md). Deep dive: [revenuedot.app/errors/invalid-credentials-error](https://revenuedot.app/errors/invalid-credentials-error).

## Related

- [What does configurationError (code 23) mean in the purchases SDK?](https://revenuedot.app/docs/errors/sdk-configuration-error.md)
- [What does invalidReceiptError (code 8) mean in the purchases SDK?](https://revenuedot.app/docs/errors/sdk-invalid-receipt-error.md)
- [What does networkError (code 10) mean in the purchases SDK?](https://revenuedot.app/docs/errors/sdk-network-error.md)
- [What RevenueDot's API errors mean (server codes)](https://revenuedot.app/docs/api/errors.md)

## Source

- [RevenueDot purchases-ios: ErrorCode.swift (the iOS ErrorCode enum)](https://github.com/revenuedot/purchases-ios/blob/revenuedot/main-patches/Sources/Generated/ErrorCode.swift)
- [RevenueDot purchases-android: PurchasesErrorCode.kt (the Android enum)](https://github.com/revenuedot/purchases-android/blob/revenuedot/main-patches/purchases/src/main/kotlin/generated/com/revenuecat/purchases/PurchasesErrorCode.kt)
- [RevenueDot purchases-ios: BackendErrorCode.swift (backend code mapping)](https://github.com/revenuedot/purchases-ios/blob/revenuedot/main-patches/Sources/Error%20Handling/BackendErrorCode.swift)
- [RevenueDot purchases-android: common/errors.kt (backend code mapping)](https://github.com/revenuedot/purchases-android/blob/revenuedot/main-patches/purchases/src/main/kotlin/com/revenuecat/purchases/common/errors.kt)

Checked: 2026-10-03
