RequestPurchaseProps

Request Types#

Types used when initiating purchases via requestPurchase().

Discriminated input to requestPurchase (type: 'in-app' | 'subs'). iOS: maps to Product.purchase(options:) (Apple docs). Android: maps to BillingClient.launchBillingFlow (Google docs).

RequestPurchaseProps#

Top-level arguments for requestPurchase(). Wraps platform-specific props with a type discriminator.

NameTypeSummary
requestRequestPurchasePropsByPlatforms | RequestSubscriptionPropsByPlatformsPlatform-specific parameters matching type. Generated native types expose a purchase/subscription union (or separate requestPurchase and requestSubscription fields) so a subscription cannot be encoded as a one-time request.
type"in-app" | "subs"Purchase type discriminator

Usage Example#

swift
// Standard in-app purchase
try await OpenIapModule.shared.requestPurchase(
    RequestPurchaseProps(
        request: .purchase(RequestPurchasePropsByPlatforms(
            apple: RequestPurchaseIosProps(sku: "premium")
        )),
        type: .inApp
    )
)

// Subscription purchase
try await OpenIapModule.shared.requestPurchase(
    RequestPurchaseProps(
        request: .subscription(RequestSubscriptionPropsByPlatforms(
            apple: RequestSubscriptionIosProps(sku: "monthly_sub")
        )),
        type: .subs
    )
)

RequestPurchasePropsByPlatforms#

Platform-specific request structure for regular purchases (in-app).

NameSummary
appleApple purchase parameters (RequestPurchaseIosProps)
googleGoogle purchase parameters (RequestPurchaseAndroidProps)

RequestSubscriptionPropsByPlatforms#

Platform-specific request structure for subscriptions.

NameSummary
appleApple subscription parameters (RequestSubscriptionIosProps)
googleGoogle subscription parameters (RequestSubscriptionAndroidProps)

Platform-Specific Request Props#

RequestPurchaseIosProps#

NameSummary
skuProduct identifier to purchase (required)
andDangerouslyFinishTransactionAutomaticallyAuto-finish transaction without validation (use with caution)
appAccountTokenUUID linking purchase to your server's user. Must be a valid UUID format (e.g., 550e8400-e29b-41d4-a716-446655440000). If a non-UUID value is provided, Apple will silently return null for this field in the purchase response.
quantityNumber of items to purchase
withOfferSigned iOS subscription promotional offer input (DiscountOfferInputIOS)
advancedCommerceDataAttribution data token for StoreKit 2's Product.PurchaseOption.custom API. Used for campaign tokens, affiliate IDs, or other attribution data. (iOS 15+)

Subscription Request Props#

RequestSubscriptionIosProps#

iOS subscriptions extend RequestPurchaseIosProps with these additional subscription-only fields:

NameSummary
winBackOfferWin-back offer to re-engage churned subscribers (iOS 18+).
promotionalOfferJWSJWS-signed promotional offer (iOS 15+, WWDC 2025).
billingPlanTypeStoreKit 26.4 billing plan for auto-renewable subscriptions: monthly for monthly billing with commitment or up-front for full-period payment. Omit on older OS versions and do not pass unknown. See SubscriptionBillingPlanTypeIOS.
compactJWSCompact JWS string for overriding introductory offer eligibility (iOS 15+, WWDC 2025). Generate it on your server and omit it to let the system decide.