<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKit",
  "identifier" : "/documentation/StoreKit/PurchaseAction/callAsFunction(_:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "StoreKit",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:17_StoreKit_SwiftUI14PurchaseActionV14callAsFunction_7options0aB07ProductV0E6ResultOAH_ShyAH0E6OptionVGtYaKF"
  },
  "title" : "callAsFunction(_:options:)"
}
-->

# callAsFunction(_:options:)

Starts an Apple In-App Purchase for the indicated product and purchase options.

```
@MainActor @preconcurrency func callAsFunction(_ product: Product, options: Set<Product.PurchaseOption> = []) async throws -> Product.PurchaseResult
```

## Parameters

`product`

The Apple In-App Purchase [`Product`](/documentation/StoreKit/Product) the customer is purchasing.

`options`

A set of options you may associate with the purchase ([`Product.PurchaseOption`](/documentation/StoreKit/Product/PurchaseOption)).

## Return Value

The result of the purchase, [`Product.PurchaseResult`](/documentation/StoreKit/Product/PurchaseResult).

## Discussion

Don’t call this method directly. SwiftUI calls it when you call the [`PurchaseAction`](/documentation/StoreKit/PurchaseAction) structure with the `product` and `options` as arguments.

This method may throw a [`Product.PurchaseError`](/documentation/StoreKit/Product/PurchaseError) or [`StoreKitError`](/documentation/StoreKit/StoreKitError).

For information about how Swift uses the [`callAsFunction(_:options:)`](/documentation/StoreKit/PurchaseAction/callAsFunction(_:options:)) method to simplify call site syntax, see [Methods with Special Names](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/declarations/#Methods-with-Special-Names) in *The Swift Programming Language*.

---

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)