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]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#
| Function | Description |
|---|---|
initConnection | Initialize the store connection. Call before any IAP API. |
endConnection | Close the store connection and release resources. |
Products#
| Function | Description |
|---|---|
fetchProducts | Fetch products or subscriptions from the store. |
getAvailablePurchases | List active purchases for the current user. |
Purchase#
| Function | Description |
|---|---|
requestPurchase | Initiate a purchase or subscription flow. |
finishTransaction | Complete a transaction after server-side verification. Required on Android within 3 days. |
restorePurchases | Restore non-consumable and active subscription purchases. |
openRedeemOfferCode | Open 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. |
getStorefront | Return the user's storefront country code. |
Subscription#
| Function | Description |
|---|---|
getActiveSubscriptions | Get details of all currently active subscriptions. |
hasActiveSubscriptions | Check whether the user has any active subscription. |
deepLinkToSubscriptions | Open the platform's subscription management UI. |
Validation#
Server-side verification helpers. Full walkthrough lives on Features → Validation — these signatures are listed here for completeness.
| Function | Description |
|---|---|
verifyPurchase | Verify a purchase against your own backend (returns isValid + raw store metadata). |
verifyPurchaseWithProvider | Verify 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#
| Function | Description |
|---|---|
syncIOS | Force sync transactions with the App Store. |
clearTransactionIOS | Clear pending transactions in the queue (sandbox helper). |
getPromotedProductIOS | Read the App Store-promoted product, if any. |
getPendingTransactionsIOS | List unfinished StoreKit transactions. |
getAllTransactionsIOS | List every StoreKit transaction (finished + unfinished) for the current user. |
isEligibleForIntroOfferIOS | Check intro-offer eligibility for a subscription group. |
subscriptionStatusIOS | Get subscription status objects from StoreKit 2. |
currentEntitlementIOS | Get the user's current entitlement for a product. |
latestTransactionIOS | Get the latest verified transaction for a product. |
showManageSubscriptionsIOS | Present the manage-subscriptions sheet. |
beginRefundRequestIOS | Present the refund request sheet (iOS 15+). See Refund. |
isTransactionVerifiedIOS | Check whether a transaction's JWS verification passed. |
getTransactionJwsIOS | Return the JWS string for a transaction. |
getReceiptDataIOS | Get base64 receipt data (legacy validation). |
presentCodeRedemptionSheetIOS | Deprecated — use openRedeemOfferCode; scheduled for removal in client protocol 1.0.0. Shows the App Store offer code redemption sheet. |
getAppTransactionIOS | Fetch the app transaction (iOS 16+). |
canPresentExternalPurchaseNoticeIOS | Check eligibility for the external purchase notice sheet (iOS 17.4+). |
presentExternalPurchaseNoticeSheetIOS | Present the external purchase notice sheet (iOS 17.4+). |
presentExternalPurchaseLinkIOS | Present an external purchase link, StoreKit External (iOS 16+). |
isEligibleForExternalPurchaseCustomLinkIOS | Check eligibility for the custom-link variant of external purchase (iOS 18.1+). |
getExternalPurchaseCustomLinkTokenIOS | Fetch a token for Apple's External Purchase Server reporting API (iOS 18.1+). |
showExternalPurchaseCustomLinkNoticeIOS | Present the disclosure sheet required before linking out via ExternalPurchaseCustomLink (iOS 18.1+). |
Android Functions#
| Function | Description |
|---|---|
acknowledgePurchaseAndroid | Acknowledge a non-consumable purchase. Required within 3 days or Google auto-refunds. |
consumePurchaseAndroid | Consume a consumable purchase so it can be re-bought. |
enableBillingProgramAndroid | Enable 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. |
isBillingProgramAvailableAndroid | Check whether a billing program (e.g., External Payments) is available for the current user. |
getBillingChoiceInfoAndroid | Fetch Play Billing Choice assets for developer-rendered choice screens (Play Billing 9.1.0+). |
launchExternalLinkAndroid | Launch an external content / offer link from inside the Billing Programs flow (Play Billing 8.2.0+). |
createBillingProgramReportingDetailsAndroid | Create the reporting payload Google requires after a Developer-Provided Billing transaction (Play Billing 8.3.0+). |
showBillingProgramInformationDialogAndroid | Show Google's Billing Choice information dialog (Play Billing 9.1.0+). |
showInAppMessagesAndroid | Show Play billing in-app messages and return subscription status updates when applicable. |
openRedeemOfferCodeAndroid | Deprecated — 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).
See: Type Definitions.
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.