<!--
{
  "availability" : [
    "iOS: 15.4.0 -",
    "iPadOS: 15.4.0 -",
    "macCatalyst: 15.4.0 -",
    "macOS: 14.4.0 -",
    "tvOS: 17.4.0 -",
    "visionOS: 1.1.0 -",
    "watchOS: 10.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKit",
  "identifier" : "/documentation/StoreKit/ExternalPurchaseLink/open()",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "StoreKit"
    ],
    "preciseIdentifier" : "s:8StoreKit20ExternalPurchaseLinkO4openyyYaKFZ"
  },
  "title" : "open()"
}
-->

# open()

Presents a continuation sheet that enables people to choose whether your app shows its link for external purchases.

```
static func open() async throws
```

## Discussion

Use this method if your app configures the <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/SKExternalPurchaseLink> property list key.

Call this asynchronous method to have the system attempt to open the external purchase link, as shown below:

```swift
try await ExternalPurchaseLink.open()
```

To use this method, follow these steps:

1. Call [`canOpen`](/documentation/StoreKit/ExternalPurchaseLink/canOpen) to determine whether to display a button or other user-interface controls that enable you to call [`open()`](/documentation/StoreKit/ExternalPurchaseLink/open()). If it returns `true`, your app can display the user-interface controls to enable deliberate user interaction.
2. In response to deliberate user interaction, such as tapping a button, call [`open()`](/documentation/StoreKit/ExternalPurchaseLink/open()). The system displays the continuation sheet that enables the user to choose whether to continue to view your app’s external purchase URL. This asynchronous method returns before the system presents the continuation sheet, and throws an error if [`canOpen`](/documentation/StoreKit/ExternalPurchaseLink/canOpen) is `false`.

If the person chooses to continue, this method opens the current storefront’s destination URL that you configure in the <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/SKExternalPurchaseLink> property list key and appends an external purchase token and the app’s bundleID to the URL. For example, StoreKit opens the following URL on the default browser if your destination URL is `https://site.example.com`:

```http
https://site.example.com?externalPurchaseToken=ewoJImFwcEFwcGxlSWQiOjEyMzQ1Njc4OTAsCgkiYnVuZGxlSWQiOiJjb20uZXhhbXBsZSIsCgkidG9rZW5DcmVhdGlvbkRhdGUiOjE3MDYxNjk2MDAwMDAsCgkiZXh0ZXJuYWxQdXJjaGFzZUlkIjoiMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwIgp9&bundleId=com.example
```

> Important:
> Record and use the external purchase token to report the customer’s external purchases to Apple. For more information, see <doc://com.apple.documentation/documentation/ExternalPurchaseServerAPI>.

### Handle errors

This method throws a [`StoreKitError`](/documentation/StoreKit/StoreKitError) if any of the following are true:

- Your app doesn’t have the <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.developer.storekit.external-purchase-link> entitlement.
- You haven’t configured external purchases for the current App Store storefront in <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/SKExternalPurchaseLink>.
- The current App Store storefront doesn’t support external purchases.
- The person is ineligible to make external purchases.
- A network or system error occurs.

For more information about App Store storefronts, see [`Storefront`](/documentation/StoreKit/Storefront).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)