Hey! These docs are for version 1.0, which is no longer officially supported. Click here for the latest version, 2.0!

Error Handling (SKError, NSError, Error)

In this topic we describe how you can handle most of the SKError's errors e.g.: SKErrorPaymentCancelled, SKErrorInvalidOfferIdentifier, SKErrorUnknown, etc.

Adapty SDK has its own wrapper for all kinds of errors, called AdaptyError. Basically, every error returned by an SDK is AdaptyError. It has two useful properties: originalError and adaptyErrorCode, described below.


It contains an original error in case you need the original one to work with. Can be SKError, NSError or just general Swift Error. This property is optional since some errors can be generated directly by SDK, like inconsistent or missing data, and won't have original error around which wrapper was initially built.


This one can be used to handle common issues, like:

  • invalid credentials
  • network errors
  • cancelled payments
  • billing issues
  • invalid receipt
  • and much more

It's pretty easy to check the error for specific codes and react to them accordingly.

import Adapty

Adapty.makePurchase(product: product) { (purchaserInfo, receipt, appleValidationResult, _, error) in
    if error?.adaptyErrorCode == .paymentCancelled {
        // purchase was cancelled
        // you can offer discount to your user or remind them later

Most common errors and how to handle them

StoreKit errors


Corresponds to SKError.Code.paymentCancelled.

User cancelled their purchase and was not charged.

No action required, but in terms of the business logic, you can offer a discount to your user or remind them later.


There is no valid receipt available on the device. Can be an issue during sandbox testing.

In the sandbox, you won't have a valid receipt file until you actually make a purchase, so make sure you did one before accessing it. During sandbox testing also make sure you signed in on a device with a valid Apple sandbox account.


Corresponds to SKError.Code.invalidOfferIdentifier.

The offer identifier is not valid. For example, you have not set up an offer with that identifier in the App Store, or you have revoked the offer.

Make sure you set up desired offers in AppStore connect and pass a valid offer identifier.


We were unable to fetch any products from StoreKit.

Make sure:
– you created products in AppStore connect;
– you added products in Adapty dashboard;
– you running the simulator under iOS 14 or if you want to continue using iOS 14 make sure you run it on a real device;
– you've signed your Paid Applications Agreement in Agreements, Tax & Banking section of App Store Connect


A signature generated for purchase with a promotional offer was missing or invalid.

Make sure you've uploaded Subscription Key in Adapty Dashboard for using promotional offers.

General error list

StoreKit errors

unknown0Error code indicating that an unknown or unexpected error occurred.
clientInvalid1Error code indicating that the client is not allowed to perform the attempted action.
paymentCancelled2Error code indicating that the user canceled a payment request.
paymentInvalid3Error code indicating that one of the payment parameters was not recognized by the App Store.
paymentNotAllowed4Error code indicating that the user is not allowed to authorize payments.
storeProductNotAvailable5Error code indicating that the requested product is not available in the store.
cloudServicePermissionDenied6Error code indicating that the user has not allowed access to Cloud service information.
cloudServiceNetworkConnectionFailed7Error code indicating that the device could not connect to the network.
cloudServiceRevoked8Error code indicating that the user has revoked permission to use this cloud service.
privacyAcknowledgementRequired9Error code indicating that the user has not yet acknowledged Apple’s privacy policy for Apple Music.
unauthorizedRequestData10Error code indicating that the app is attempting to use a property for which it does not have the required entitlement.
invalidOfferIdentifier11Error code indicating that the offer identifier is invalid.
invalidSignature12Error code indicating that the signature in a payment discount is not valid.
missingOfferParams13Error code indicating that parameters are missing in a payment discount.
invalidOfferPrice14Error code indicating that the price you specified in App Store Connect is no longer valid.
noProductIDsFound1000No In-App Purchase product identifiers were found.
noProductsFound1001No In-App Purchases were found.
productRequestFailed1002Unable to fetch available In-App Purchase products at the moment.
cantMakePayments1003In-App Purchases are not allowed on this device.
noPurchasesToRestore1004No purchases to restore.
cantReadReceipt1005Can't find a valid receipt.
productPurchaseFailed1006Product purchase failed.
missingOfferSigningParams1007Missing offer signing required params.
fallbackPaywallsNotRequired1008Fallback paywalls are not required.

Network errors

emptyResponse2000Response is empty.
emptyData2001Request data is empty.
authenticationError2002You need to be authenticated to perform requests.
badRequest2003Bad request.
serverError2004Server error.
failed2005Network request failed.
unableToDecode2006We could not decode the response.
missingParam2007Missing some of the required params.
invalidProperty2008Received invalid property data.
encodingFailed2009Parameters encoding failed.
missingURL2010Request url is nil.

General errors

analyticsDisabled3000We can't handle analytics events, since you've opted it out.