Use this page with AI

Copy this into your coding assistant and add your request.

Read https://openiap.dev/docs/apis and https://openiap.dev/llms.txt. Follow the reading instructions, detailed reference, and linked guides relevant to my task before making changes.
Inspect my existing project and reuse its framework and conventions. Ask me for missing product decisions. Implement the requested behavior and run the applicable checks.
Show the working result, the commands and actual test results, and any remaining limitations. Keep your explanation brief.

My request: [describe what customers should be able to do]
See an example request →

APIs

Complete function reference for OpenIAP. Every public function is listed below with a one-line description and a link to its full signature. For higher-level guides see Features.

Connection#

FunctionDescription
initConnectionInitialize the store connection. Call before any IAP API.
endConnectionClose the store connection and release resources.

Products#

FunctionDescription
fetchProductsFetch products or subscriptions from the store.
getAvailablePurchasesList active purchases for the current user.

Purchase#

FunctionDescription
requestPurchaseInitiate a purchase or subscription flow.
finishTransactionComplete a transaction after server-side verification. Required on Android within 3 days.
restorePurchasesRestore non-consumable and active subscription purchases.
openRedeemOfferCodeOpen the platform's offer/promo code redemption flow. Resolves the verified purchase only on Apple 27+ from Xcode 27+ builds; every other flow resolves null.
getStorefrontReturn the user's storefront country code.

Subscription#

FunctionDescription
getActiveSubscriptionsGet details of all currently active subscriptions.
hasActiveSubscriptionsCheck whether the user has any active subscription.
deepLinkToSubscriptionsOpen the platform's subscription management UI.

Validation#

Server-side verification helpers. Full walkthrough lives on Features → Validation — these signatures are listed here for completeness.

FunctionDescription
verifyPurchaseVerify a purchase against your own backend (returns isValid + raw store metadata).
verifyPurchaseWithProviderVerify via a managed provider without standing up your own server. The PurchaseVerificationProvider enum currently exposes only IAPKit (open source under MIT — source at packages/kit).

iOS Functions#

FunctionDescription
syncIOSForce sync transactions with the App Store.
clearTransactionIOSClear pending transactions in the queue (sandbox helper).
getPromotedProductIOSRead the App Store-promoted product, if any.
getPendingTransactionsIOSList unfinished StoreKit transactions.
getAllTransactionsIOSList every StoreKit transaction (finished + unfinished) for the current user.
isEligibleForIntroOfferIOSCheck intro-offer eligibility for a subscription group.
subscriptionStatusIOSGet subscription status objects from StoreKit 2.
currentEntitlementIOSGet the user's current entitlement for a product.
latestTransactionIOSGet the latest verified transaction for a product.
showManageSubscriptionsIOSPresent the manage-subscriptions sheet.
beginRefundRequestIOSPresent the refund request sheet (iOS 15+). See Refund.
isTransactionVerifiedIOSCheck whether a transaction's JWS verification passed.
getTransactionJwsIOSReturn the JWS string for a transaction.
getReceiptDataIOSGet base64 receipt data (legacy validation).
presentCodeRedemptionSheetIOSDeprecated — use openRedeemOfferCode; scheduled for removal in client protocol 1.0.0. Shows the App Store offer code redemption sheet.
getAppTransactionIOSFetch the app transaction (iOS 16+).
canPresentExternalPurchaseNoticeIOSCheck eligibility for the external purchase notice sheet (iOS 17.4+).
presentExternalPurchaseNoticeSheetIOSPresent the external purchase notice sheet (iOS 17.4+).
presentExternalPurchaseLinkIOSPresent an external purchase link, StoreKit External (iOS 16+).
isEligibleForExternalPurchaseCustomLinkIOSCheck eligibility for the custom-link variant of external purchase (iOS 18.1+).
getExternalPurchaseCustomLinkTokenIOSFetch a token for Apple's External Purchase Server reporting API (iOS 18.1+).
showExternalPurchaseCustomLinkNoticeIOSPresent the disclosure sheet required before linking out via ExternalPurchaseCustomLink (iOS 18.1+).

Android Functions#

FunctionDescription
acknowledgePurchaseAndroidAcknowledge a non-consumable purchase. Required within 3 days or Google auto-refunds.
consumePurchaseAndroidConsume a consumable purchase so it can be re-bought.
enableBillingProgramAndroidEnable a Play Billing Program (Play Billing 8.2.0+). Note: this is a config field of InitConnectionConfig passed to initConnection(), not a standalone mutation; the page documents the config-flow shape.
isBillingProgramAvailableAndroidCheck whether a billing program (e.g., External Payments) is available for the current user.
getBillingChoiceInfoAndroidFetch Play Billing Choice assets for developer-rendered choice screens (Play Billing 9.1.0+).
launchExternalLinkAndroidLaunch an external content / offer link from inside the Billing Programs flow (Play Billing 8.2.0+).
createBillingProgramReportingDetailsAndroidCreate the reporting payload Google requires after a Developer-Provided Billing transaction (Play Billing 8.3.0+).
showBillingProgramInformationDialogAndroidShow Google's Billing Choice information dialog (Play Billing 9.1.0+).
showInAppMessagesAndroidShow Play billing in-app messages and return subscription status updates when applicable.
openRedeemOfferCodeAndroidDeprecated — use openRedeemOfferCode; scheduled for removal in client protocol 1.0.0. Opens the Google Play offer-code redemption page.

Naming Convention#

  • Cross-platform: no suffix (e.g., fetchProducts, requestPurchase).
  • iOS-only: ends with IOS (e.g., syncIOS).
  • Android-only: ends with Android (e.g., acknowledgePurchaseAndroid).

Terminology#

Transaction vs Purchase#

These terms refer to the same concept - a completed or pending payment record from the store. The terminology differs by platform:

  • iOS (StoreKit): Uses Transaction
  • Android (Google Play Billing): Uses Purchase

OpenIAP normalizes this to Purchase in cross-platform APIs for consistency, while platform-specific APIs may use the native terminology.

Receipt vs Verify Purchase#

Receipt is a legacy term from Apple's original StoreKit API, where purchase validation involved fetching and verifying a "receipt" blob. Modern StoreKit 2 and Google Play Billing have moved away from this pattern.

OpenIAP uses verifyPurchase instead of "receipt validation" to reflect the modern approach: validating individual purchase transactions rather than parsing monolithic receipt data.