Build in-app purchases with AI
You choose what to sell and who should get access. Your coding assistant installs the SDK, connects the purchase flow, and runs the checks. Start with your app, then inspect the result together.
1. Choose the SDK for your app#
Open the SDK list and follow your framework’s setup guide. Give the AI that guide and access to your project. It should use the existing framework, package manager, and login system.
Decide which stores you support, which products are subscriptions or one-time purchases, and what each product unlocks. The AI should explain any missing decision before building around an assumption.
2. Connect purchase to access#
Follow one purchase from payment to access. Each step compares the runnable example with IAPKit and links to the corresponding code and checks. Your app owns login and fulfillment; the commerce backend verifies evidence and keeps purchase and access records for the capabilities it supports.
For an existing product, give the AI the integration brief. To implement a backend, use the backend build guide. IAPKit is an available backend; OpenIAP SDKs do not require an IAPKit account.
3. Check the result before shipping#
Ask the AI to install and run from clean source, show the purchase flow, and provide the commands and actual test results. Then try these customer actions in your chosen store’s sandbox:
- Buy a product and receive the intended access.
- Cancel or leave a purchase pending; neither should create new access.
- Restore and repeat a purchase callback without granting the same benefit twice.
- For subscriptions, cancel renewal and retain access until the paid period expires.
- Sign in as another user and confirm the ownership policy is enforced.
Use the testing guide for store setup. The local Commerce Protocol example uses fictional purchases; its passing checks do not replace a device and store sandbox run.
References for your coding assistant#
Ask your assistant to read the relevant links. If it cannot fetch them, provide the contents directly. A URL in a prompt does not prove that its contents were loaded.
- OpenIAP quick reference — SDK installation, purchase APIs, types, and links to the implementation guides.
- OpenIAP full reference — Detailed API behavior and the normative Commerce Protocol specification.
- IAPKit reference — Hosted API configuration and product-specific behavior when you choose IAPKit.