<!--
{
  "availability" : [
    "iOS: 16.4.0 -",
    "iPadOS: 16.4.0 -",
    "macCatalyst: 16.4.0 -",
    "macOS: 14.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKit",
  "identifier" : "/documentation/StoreKit/PurchaseIntent",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "StoreKit"
    ],
    "preciseIdentifier" : "s:8StoreKit14PurchaseIntentV"
  },
  "title" : "PurchaseIntent"
}
-->

# PurchaseIntent

An instance that emits purchase intents, which indicate that the customer initiated a purchase outside of your app, for your app to complete.

```
struct PurchaseIntent
```

## Overview

Using `PurchaseIntent` is required in the following cases:

- If you promote in-app purchases on the App Store
- If you turn off the Streamlined Purchasing setting in App Store Connect and use win-back offers or contingent pricing

You set up these offers and settings in App Store Connect. For more information, see [Promote in-app purchases](https://developer.apple.com/help/app-store-connect/configure-in-app-purchase-settings/promote-in-app-purchases), [Set up win-back offers](https://developer.apple.com/help/app-store-connect/manage-subscriptions/set-up-win-back-offers), and [Manage Streamlined Purchasing](https://developer.apple.com/help/app-store-connect/manage-subscriptions/manage-streamlined-purchasing).

> Important:
> To enable promoted in-app purchases, your app must use either ``doc://com.apple.storekit/documentation/StoreKit/PurchaseIntent`` (starting in iOS 16.4) or ``doc://com.apple.storekit/documentation/StoreKit/SKPaymentTransactionObserver/paymentQueue(_:shouldAddStorePayment:for:)`` (starting in iOS 11). Don’t use both at the same time. If necessary, use conditional compilation to identify the OS version the app is running in. For more information, see <doc://com.apple.documentation/documentation/Xcode/running-code-on-a-specific-version>.

When a customer selects a promoted product on the App Store or a win-back offer outside of your app, it initiates a purchase that they complete in your app. If they don’t have your app installed, the system prompts them to download it. After the app downloads, the transaction continues in the app, which receives a purchase intent from the [`intents`](/documentation/StoreKit/PurchaseIntent/intents) sequence.

The purchase intent identifies the [`product`](/documentation/StoreKit/PurchaseIntent/product) the customer selected. To enable customers to complete the purchase, call [`purchase(options:)`](/documentation/StoreKit/Product/purchase(options:)) on this product instance. The following example code receives the purchase intent, and calls a method to complete the purchase workflow:

```swift
func purchaseProduct(_ product: Product) async {
    // Complete the purchase workflow.
    do {
        try await product.purchase()
    }
    catch {
        // Add your error handling here.
    }
    // Add your remaining purchase workflow here.
}

for await purchaseIntent in PurchaseIntent.intents {
    // Complete the purchase workflow.
    await purchaseProduct(purchaseIntent.product)
}
```

For more information, see [Supporting promoted In-App Purchases in your app](/documentation/StoreKit/supporting-promoted-in-app-purchases-in-your-app) and [Supporting win-back offers in your app](/documentation/StoreKit/supporting-win-back-offers-in-your-app).

In Mac apps built with Mac Catalyst, this instance doesn’t emit purchase intents for promoted in-app purchases because the Mac App Store doesn’t support this feature.

> Note:
> `PurchaseIntent` and promoted in-app purchases aren’t available to compatible iPad or iPhone apps running in visionOS.

## Topics

### Identifying the product

[`id`](/documentation/StoreKit/PurchaseIntent/id)

The product identifier of the In-App Purchase that the customer selects to purchase outside of the app.

[`product`](/documentation/StoreKit/PurchaseIntent/product)

The product information of the In-App Purchase the customer selects to purchase outside of the app.

### Getting purchase intents

[`intents`](/documentation/StoreKit/PurchaseIntent/intents)

The asynchronous sequence that emits a purchase intent when customers initiate a purchase outside of the app.

[`PurchaseIntent.PurchaseIntents`](/documentation/StoreKit/PurchaseIntent/PurchaseIntents)

An asynchronous sequence of purchase intents for purchases that customers initiate outside of the app.

### Identifying the offer

[`offer`](/documentation/StoreKit/PurchaseIntent/offer)

The subscription offer that the customer redeems outside of your app.



---

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)