One Logo Pool Ball
StoreKit · IOS API REFERENCE

Product.PurchaseOption

struct · iOS 15.0+ · SDK 27.1

struct PurchaseOption

Members (14)

static · iOS 18.0+

winBackOffer

TypeScript
static winBackOffer(offer: Product_SubscriptionOffer): Product_PurchaseOption
Swift declaration
static func winBackOffer(_ offer: Product.SubscriptionOffer) -> Product.PurchaseOption

Apply a win-back offer to a purchase. - Parameters: - offer: The `SubscriptionOffer` of type win-back to apply to the purchase.

static · iOS 15.0+

appAccountToken

TypeScript
static appAccountToken(token: string): Product_PurchaseOption
Swift declaration
static func appAccountToken(_ token: UUID) -> Product.PurchaseOption

Apply an app account token to a purchase. The app account token will persist in the resulting `Transaction` from a purchase. - Parameter token: A UUID that associates the purchase with an account in your system.

static · iOS 26.4+

billingPlanType

TypeScript
static billingPlanType(type: Product_SubscriptionInfo_BillingPlanType): Product_PurchaseOption
Swift declaration
static func billingPlanType(_ type: Product.SubscriptionInfo.BillingPlanType) -> Product.PurchaseOption
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.

static · iOS 15.0+ · Deprecated in iOS 26.0

promotionalOffer

TypeScript
static promotionalOfferOfferIDKeyIDNonceSignatureTimestamp(offerID: string, keyID: string, nonce: string, signature: ArrayBuffer, timestamp: number): Product_PurchaseOption
Swift declaration
static func promotionalOffer(offerID: String, keyID: String, nonce: UUID, signature: Data, timestamp: Int) -> Product.PurchaseOption

Apply a promotional offer to a purchase. - Parameters: - offerID: The `id` property of the `SubscriptionOffer` to apply. - keyID: The key ID of the private key used to generate `signature`. The private key and key ID can be generated on App Store Connect. - nonce: The nonce used in `signature`. - signature: The cryptographic signature of the offer parameters, generated on your server. - timestamp: The time the signature was generated in milliseconds since 1970. @DeprecationSummary { Sign promotional offers with JWS and use ``promotionalOffer(_:compactJWS:)`` instead. }

static · iOS 17.4+ · Deprecated in iOS 26.0

promotionalOffer

TypeScript
static promotionalOfferOfferIDSignature(offerID: string, signature: Product_SubscriptionOffer_Signature): Product_PurchaseOption
Swift declaration
static func promotionalOffer(offerID: String, signature: Product.SubscriptionOffer.Signature) -> Product.PurchaseOption

Apply a promotional offer to a purchase. - Parameters: - offerID: The `id` property of the `SubscriptionOffer` to apply. - signature: The metadata of the signature used to validate a promotional offer. @DeprecationSummary { Sign promotional offers with JWS and use ``promotionalOffer(_:compactJWS:)`` instead. }

static · iOS 15.0+

promotionalOffer

TypeScript
static promotionalOfferCompactJWS(offerID: string, compactJWS: string): Array<Product_PurchaseOption>
Swift declaration
@backDeployed(before: iOS 26.0, macOS 26.0, tvOS 26.0, watchOS 26.0, visionOS 26.0)
static func promotionalOffer(_ offerID: String, compactJWS: String) -> [Product.PurchaseOption]

Apply a promotional offer to a purchase. - Parameters: - offerID: The `id` property of the `SubscriptionOffer` to apply. - compactJWS: The JWS signature used to validate a promotional offer.

static · iOS 15.0+

simulatesAskToBuyInSandbox

TypeScript
static simulatesAskToBuyInSandbox(simulateAskToBuy: boolean): Product_PurchaseOption
Swift declaration
static func simulatesAskToBuyInSandbox(_ simulateAskToBuy: Bool) -> Product.PurchaseOption

Toggle ask to buy when testing in the App Store Sandbox environment. The default is `false` if this option is not added. - Parameter simulateAskToBuy: Set as `true` to simulate a child's account asking permission to purchase from a family member.

static · iOS 15.0+

introductoryOfferEligibility

TypeScript
static introductoryOfferEligibility(compactJWS: string): Product_PurchaseOption
Swift declaration
@backDeployed(before: iOS 18.4, macOS 15.4, tvOS 18.4, watchOS 11.4, visionOS 2.4)
static func introductoryOfferEligibility(compactJWS: String) -> Product.PurchaseOption

Set the eligibility of an introductory offer for a purchase. - Parameters: - compactJWS: The signed JWT string with the introductory offer eligibility for the purchase.

static · iOS 15.0+

custom

TypeScript
static customKeyValue(key: string, value: ArrayBuffer): Product_PurchaseOption
Swift declaration
static func custom(key: String, value: Data) -> Product.PurchaseOption

Add a custom data option to a purchase. - Parameters: - key: The key for this custom option. - value: The value for this custom option.

static · iOS 15.0+

custom

TypeScript
static customKeyValue95246(key: string, value: string): Product_PurchaseOption
Swift declaration
static func custom(key: String, value: String) -> Product.PurchaseOption

Add a custom string option to a purchase. - Parameters: - key: The key for this custom option. - value: The value for this custom option.

static · iOS 15.0+

custom

TypeScript
static customKeyValue81115(key: string, value: boolean): Product_PurchaseOption
Swift declaration
static func custom(key: String, value: Bool) -> Product.PurchaseOption

Add a custom Boolean option to a purchase. - Parameters: - key: The key for this custom option. - value: The value for this custom option.

static · iOS 15.0+

custom

TypeScript
static customKeyValue24829(key: string, value: number): Product_PurchaseOption
Swift declaration
static func custom(key: String, value: Double) -> Product.PurchaseOption

Add a custom number option to a purchase. - Parameters: - key: The key for this custom option. - value: The value for this custom option.

static · iOS 15.0+

quantity

TypeScript
static quantity(quantity: number): Product_PurchaseOption
Swift declaration
static func quantity(_ quantity: Int) -> Product.PurchaseOption

The quantity of this product to purchase. The default is 1 if this option is not added. This option can only be applied to consumable products and non-renewing subscriptions. - Parameter quantity: The quantity to purchase.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

Product.PurchaseOption.onStorefrontChange(shouldContinuePurchase:)

callback cannot propagate synchronous failure

All StoreKit types →