One Logo Pool Ball
StoreKit · IOS API REFERENCE

Product

struct · iOS 15.0+ · SDK 27.1

struct Product

Information about a product configured in App Store Connect.

Members (20)

get · iOS 15.0+

description

TypeScript
get description(): string
Swift declaration
let description: String

A localized description of the product.

get · iOS 15.0+

displayName

TypeScript
get displayName(): string
Swift declaration
let displayName: String

A localized display name of the product.

get · iOS 15.0+

displayPrice

TypeScript
get displayPrice(): string
Swift declaration
let displayPrice: String

A localized string representation of `price`.

get · iOS 15.0+

subscription

TypeScript
get subscription(): (Product_SubscriptionInfo) | null
Swift declaration
let subscription: Product.SubscriptionInfo?

Properties and functionality specific to auto-renewable subscriptions. This is never `nil` if `type` is `.autoRenewable`, and always `nil` for all other product types.

get · iOS 15.0+

debugDescription

TypeScript
get debugDescription(): string
Swift declaration
var debugDescription: String { get }

A textual representation of this instance, suitable for debugging. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(reflecting:)` initializer. This initializer works with any type, and uses the custom `debugDescription` property for types that conform to `CustomDebugStringConvertible`: struct Point: CustomDebugStringConvertible { let x: Int, y: Int var debugDescription: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(reflecting: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `debugDescription` property.

get · iOS 15.0+

priceFormatStyle

TypeScript
get priceFormatStyle(): _Foundation_Decimal_FormatStyle_Currency
Swift declaration
@backDeployed(before: iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, macCatalyst 16.0)
var priceFormatStyle: Decimal.FormatStyle.Currency { get }

The format style to use when formatting numbers derived from the price for the product. Use `displayPrice` when possible. Use `priceFormatStyle` only for localizing numbers derived from the `price` property, such as "2 products for $(`price * 2`)". - Important: When using `priceFormatStyle` on systems earlier than iOS 16.0, macOS 13.0, tvOS 16.0 or watchOS 9.0, the property may return a format style with a sentinel locale with identifier "xx\_XX" in some uncommon cases: (1) StoreKit Testing in Xcode (workaround: test your app on a device running a more recent OS) or (2) a critical server error.

get · iOS 15.0+

isFamilyShareable

TypeScript
get isFamilyShareable(): boolean
Swift declaration
let isFamilyShareable: Bool

Whether the product is available for family sharing.

get · iOS 15.0+

latestTransaction

TypeScript
get latestTransaction(): Promise<(VerificationResult<Transaction>) | null>
Swift declaration
var latestTransaction: VerificationResult<Transaction>? { get async }

The most recent transaction for the product, or `nil` if the user has never purchased this product.

get · iOS 15.0+ · Deprecated in iOS 18.4

currentEntitlement

TypeScript
get currentEntitlement(): Promise<(VerificationResult<Transaction>) | null>
Swift declaration
var currentEntitlement: VerificationResult<Transaction>? { get async }

The transaction that entitles the user to this product, or `nil` if the user is not currently entitled to this product. @DeprecationSummary { Use the ``currentEntitlements`` property instead. }

get · iOS 15.0+

jsonRepresentation

TypeScript
get jsonRepresentation(): ArrayBuffer
Swift declaration
var jsonRepresentation: Data { get }

The raw JSON representation of the product.

get · iOS 18.4+

currentEntitlements

TypeScript
get currentEntitlements(): Transaction_Transactions
Swift declaration
@backDeployed(before: iOS 26.0, macOS 26.0, tvOS 26.0, watchOS 26.0, visionOS 26.0)
var currentEntitlements: Transaction.Transactions { get }
get · iOS 15.0+

subscriptionPeriodFormatStyle

TypeScript
get subscriptionPeriodFormatStyle(): _Foundation_Date_ComponentsFormatStyle
Swift declaration
@backDeployed(before: iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, macCatalyst 16.0)
var subscriptionPeriodFormatStyle: Date.ComponentsFormatStyle { get }

The format style to use when formatting subscription periods for the subscription. Use the `formatted(_:referenceDate:)` method on `Product.SubscriptionPeriod` with this style to format the subscription period for the App Store locale for the subscription. - Important: When using `subscriptionPeriodFormatStyle` on systems earlier than iOS 16.0, macOS 13.0, tvOS 16.0 or watchOS 9.0, the property may return a format style with a sentinel locale with identifier "xx\_XX" in some uncommon cases: (1) StoreKit Testing in Xcode (workaround: test your app on a device running a more recent OS) or (2) a critical server error.

get · iOS 15.0+

id

TypeScript
get id(): string
Swift declaration
let id: String

The unique product identifier.

get · iOS 16.0+

subscriptionPeriodUnitFormatStyle

TypeScript
get subscriptionPeriodUnitFormatStyle(): Product_SubscriptionPeriod_Unit_FormatStyle
Swift declaration
var subscriptionPeriodUnitFormatStyle: Product.SubscriptionPeriod.Unit.FormatStyle { get }

The format style to use when formatting subscription period units for the subscription. Use the `formatted(_:)` method on `Product.SubscriptionPeriod.Unit` with this style to format the subscription period for the App Store locale for the subscription.

get · iOS 15.0+

type

TypeScript
get type(): Product_ProductType
Swift declaration
let type: Product.ProductType

The type of the product.

get · iOS 15.0+

price

TypeScript
get price(): _Foundation_Decimal
Swift declaration
let price: Decimal

The price of the product in local currency.

static · iOS 15.0+

products

TypeScript
static products(identifiers: Array<string>): Promise<Array<Product>>
Swift declaration
static func products<Identifiers>(for identifiers: Identifiers) async throws -> [Product] where Identifiers : Collection, Identifiers.Element == String

Requests product data from the App Store. - Parameter identifiers: A set of product identifiers to load from the App Store. If any identifiers are not found, they will be excluded from the return value. - Returns: An array of all the products received from the App Store. - Throws: `StoreKitError`

method · iOS 15.0+

purchase

TypeScript
purchaseOptions(options?: Array<Product_PurchaseOption>): Promise<Product_PurchaseResult>
Swift declaration
@MainActor func purchase(options: Set<Product.PurchaseOption> = []) async throws -> Product.PurchaseResult

Processes a purchase for the product. - Parameter options: A set of options to configure the purchase. - Returns: The result of the purchase. - Throws: A `PurchaseError` or `StoreKitError`.

method · iOS 18.2+

purchase

TypeScript
purchaseConfirmInOptions(viewController: _UIKit_UIViewController, options?: Array<Product_PurchaseOption>): Promise<Product_PurchaseResult>
Swift declaration
func purchase(confirmIn viewController: UIViewController, options: Set<Product.PurchaseOption> = []) async throws -> Product.PurchaseResult

Processes a purchase for the product. - Parameters: - viewController: The view controller to show purchase confirmation UI in proximity to. - options: A set of options to configure the purchase. - Returns: The result of the purchase - Throws: A `PurchaseError` or `StoreKitError`.

method · iOS 17.0+

purchase

TypeScript
purchaseConfirmInOptions44435(scene: _UIKit_UIScene, options?: Array<Product_PurchaseOption>): Promise<Product_PurchaseResult>
Swift declaration
@MainActor func purchase(confirmIn scene: some UIScene, options: Set<Product.PurchaseOption> = []) async throws -> Product.PurchaseResult

Processes a purchase for the product. - Parameters: - scene: The scene to show purchase confirmation UI in proximity to. - options: A set of options to configure the purchase. - Returns: The result of the purchase - Throws: A `PurchaseError` or `StoreKitError`.

Skipped declarations

No declarations were skipped in this snapshot.

All StoreKit types →