---
title: appStoreReceiptURL
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/bundle/appstorereceipturl
---

# appStoreReceiptURL

The file URL for the bundle’s App Store receipt.

## Declaration

```swift
var appStoreReceiptURL: URL? { get }
```

## Discussion

Discussion note: The receipt isn’t necessary if you use AppTransaction to validate the app download, or Transaction to validate in-app purchases. Only use the receipt if your app uses the Original API for In-App Purchase, or needs the receipt to validate the app download because it can’t use AppTransaction. Use this app bundle property to locate the app receipt if it’s present; this property is nil if the receipt isn’t present. In the rare case a receipt is invalid or missing in an app that a user downloads from the App Store, use SKReceiptRefreshRequest to request a new receipt. For information about validating receipts, see Choosing a receipt validation technique. You can’t use the general best practice of weak linking using the responds(to:) method here; the method’s implementation uses the doesNotRecognizeSelector(_:) method. Get the receipt in testing environments Receipts aren’t initially present in iOS and iPadOS apps in the sandbox environment and in Xcode. Apps get a receipt after the tester completes the first in-app purchase. When your app checks appStoreReceiptURL and finds that it’s nil, assume the tester is a new customer and has no access to premium content. For Mac apps running in TestFlight, the receipt is always present.

## See Also

### Getting the standard bundle directories

- [resourceURL](foundation/bundle/resourceurl.md)
- [executableURL](foundation/bundle/executableurl.md)
- [privateFrameworksURL](foundation/bundle/privateframeworksurl.md)
- [sharedFrameworksURL](foundation/bundle/sharedframeworksurl.md)
- [builtInPlugInsURL](foundation/bundle/builtinpluginsurl.md)
- [url(forAuxiliaryExecutable:)](foundation/bundle/url(forauxiliaryexecutable:).md)
- [sharedSupportURL](foundation/bundle/sharedsupporturl.md)
- [resourcePath](foundation/bundle/resourcepath.md)
- [executablePath](foundation/bundle/executablepath.md)
- [privateFrameworksPath](foundation/bundle/privateframeworkspath.md)
- [sharedFrameworksPath](foundation/bundle/sharedframeworkspath.md)
- [builtInPlugInsPath](foundation/bundle/builtinpluginspath.md)
- [path(forAuxiliaryExecutable:)](foundation/bundle/path(forauxiliaryexecutable:).md)
- [sharedSupportPath](foundation/bundle/sharedsupportpath.md)
