<!--
{
  "availability" : [
    "iOS: 11.0.0 - 18.0.0",
    "iPadOS: 11.0.0 - 18.0.0",
    "macCatalyst: 14.0.0 - 18.0.0",
    "macOS: 11.0.0 - 15.0.0",
    "tvOS: 11.0.0 - 18.0.0",
    "visionOS: 1.0.0 - 2.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKit",
  "identifier" : "/documentation/StoreKit/SKPaymentTransactionObserver/paymentQueue(_:shouldAddStorePayment:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "StoreKit"
    ],
    "preciseIdentifier" : "c:objc(pl)SKPaymentTransactionObserver(im)paymentQueue:shouldAddStorePayment:forProduct:"
  },
  "title" : "paymentQueue(_:shouldAddStorePayment:for:)"
}
-->

# paymentQueue(_:shouldAddStorePayment:for:)

Tells the observer when a user initiates an in-app purchase from the App Store.

```
optional func paymentQueue(_ queue: SKPaymentQueue, shouldAddStorePayment payment: SKPayment, for product: SKProduct) -> Bool
```

## Parameters

`queue`

The payment queue the app uses to make the payment request.

`payment`

The payment request.

`product`

The in-app purchase product.

## Return Value

Return `true` to continue the transaction in your app.

## Discussion

Return `false` to defer or cancel the transaction.

If you return `false`, you can continue the transaction later by manually adding the [`SKPayment`](/documentation/StoreKit/SKPayment) `payment` to the [`SKPaymentQueue`](/documentation/StoreKit/SKPaymentQueue) `queue`.

## Discussion

The system calls this delegate method when the user starts an in-app purchase in the App Store, and the transaction continues in your app. Specifically, if your app is already installed, StoreKit calls this method automatically.

If your app isn’t installed when the user starts the in-app purchase in the App Store, the user receives a notification when the app installation is complete. StoreKit calls this method when the user taps the notification. Otherwise, if the user opens the app manually, StoreKit calls this method only if they open the app soon after they initiate the purchase.

> Important:
> To enable promoted in-app purchases, your app needs to 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>.

For more information, see [Promoting In-App Purchases](/documentation/StoreKit/promoting-in-app-purchases).

---

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)