---
title: "callAsFunction(_:options:)"
framework: storekit
role: symbol
role_heading: Instance Method
path: "storekit/purchaseaction/callasfunction(_:options:)"
---

# callAsFunction(_:options:)

Starts an in-app purchase for the indicated product and purchase options.

## Declaration

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

## Parameters

- `product`: The in-app purchase doc://com.apple.storekit/documentation/StoreKit/Product the customer is purchasing.
- `options`: A set of options you may associate with the purchase (doc://com.apple.storekit/documentation/StoreKit/Product/PurchaseOption).

## Return Value

Return Value The result of the purchase, Product.PurchaseResult.

## Discussion

Discussion Don’t call this method directly. SwiftUI calls it when you call the PurchaseAction structure with the product and options as arguments. This method may throw a Product.PurchaseError or StoreKitError. For information about how Swift uses the callAsFunction(_:options:) method to simplify call site syntax, see Methods with Special Names in The Swift Programming Language.
