Start Here: Integrate AppInChina IAP
This is the entry point for integrating AppInChina's payment services. It sets the scope, the client/AppInChina ownership boundary, the prerequisites, and the required reading path.
A payment marked PAID in AppInChina's system is not, by itself, proof that your app has granted access. Payment acceptance is complete only when the full path — payment, server-side verification, entitlement, and refreshed access — works in your release candidate. See the Release Checklist / Definition of Done.
Scope and ownership
AppInChina's SDK/API initiates and processes supported payment transactions through the configured payment methods (WeChat Pay and Alipay). Your app and backend must implement the user-account, payment-result, order-verification, entitlement, purchase-history, and refund-reconciliation logic appropriate to your product.
| Capability | Client responsibility | AppInChina responsibility |
|---|---|---|
| Product and user account | Define products, authenticate the user, supply a stable client identity, and determine access rules. | Provide configured IAP credentials / product support as agreed. |
| Payment initiation | Call the SDK/API with validated parameters and handle platform requirements. | Process the payment request and expose order status. |
| Post-payment return | Implement and package app-side callback/result handling; update UI only from authoritative entitlement state. | Return the payment result through the SDK/API contract. |
| Order verification | Query/verify through the client backend; implement idempotent state transitions. | Expose the documented order-status interface. |
| Entitlement and restore | Grant, revoke, and restore access based on your own rules and verified order data. | No ownership of the client's account or content-access system. |
| Refunds | Reconcile status and revoke/adjust access according to product policy. | Process supported refunds and expose updated transaction state; no refund webhook unless separately documented. |
For the detailed boundary and worked patterns, see Capabilities and Limitations.
Required reading path
Before beginning implementation, assign an Android owner, a backend owner, a product/entitlement owner, and one designated tester for each wallet you plan to offer. Then complete the following path in order:
- Start Here and prerequisites (this page) → Prerequisites & Setup
- Platform SDK guide → Android SDK Integration (or PC & H5 for web)
- Server verification and entitlements → Server Verification and Entitlements
- Purchase history and refunds → Purchase History & Refund Workflows
- Client payment preflight and acceptance testing → Client Payment Preflight and Acceptance Testing
- The release checklist → Release Checklist / Definition of Done
Owners and required outcomes before handoff
| Role | Required page(s) | Required outcome before handoff |
|---|---|---|
| Technical lead | Start Here; Release Checklist | Confirms named owners, supported payment methods, product model, and release plan. |
| Android developer | Android SDK guide; Troubleshooting | Build can start a payment, return safely to the app, and emit usable logs. |
| Backend developer | Server Verification & Entitlements; Purchase History & Refunds; API Reference | Backend verifies payment state, updates entitlements idempotently, and supports history/refund reconciliation. |
| Product / membership owner | Server Verification & Entitlements; Release Checklist | Entitlement rules, restore behavior, and post-payment UX are defined. |
| Designated tester | Client Payment Preflight & Acceptance Testing | Wallet account and eligible card are ready for the first in-app low-value purchase. |
Reading paths by role
The required path above is sequential. If you want a role-focused starting point, use these:
For Product Managers
If you are defining the feature set, sales model, or integration strategy:
- Choose an integration strategy: Read Integration Options to decide between the unified SDK (recommended) or direct integration.
- Understand the scope: Read Capabilities & Limitations to understand what the system handles (payments) vs what your backend must handle (users, products, entitlements).
- Define your sales model: Read Sales Models & Architecture to understand how to implement subscriptions, one-time purchases, and cross-device entitlements in China.
For Developers
If you are implementing the solution:
- Start with the flow: Read Understanding the IAP Flow to see how the SDK wraps Alipay and WeChat Pay.
- Check prerequisites: Read Prerequisites & Setup to get your credentials (
APP_ID,APP_SECRET) and prepare your environment. - Handle user identity: Read Login & Identity to understand how to link payments to your user accounts using
customerIdentity. - Implement the client:
- Android: Follow the Android SDK Guide.
- Web/H5: Follow the PC & H5 Guide.
- Verify on the server: Use Server Verification and Entitlements and the API Reference to verify orders and grant access.
- Preflight and ship: Run the Client Payment Preflight and complete the Release Checklist.
Documentation Index
Concepts & Architecture
- Choosing an integration option: Integration Options Guide
- Understanding the flow: IAP SDK/API Flow
- Scope & boundaries: Capabilities & Limitations
- Sales models: Sales Models & Architecture
SDKs & Implementation
- Prerequisites: Environment setup & credentials
- Android: Android SDK Integration
- Web / H5: PC & H5 Integration
Backend & Guides
- Server verification & entitlements: Backend verification, idempotency, and the first-purchase recipe
- Login & identity: Mapping users with
customerIdentity - Purchase restore: Implementing restore & SMS auth
- History & refunds: Purchase History & Refund Workflows
Testing, Support & Sign-off
- Preflight & acceptance: Client Payment Preflight and Acceptance Testing
- Troubleshooting: Troubleshooting and Support Evidence
- Release checklist: Release Checklist / Definition of Done
References
- API Reference: Endpoints & Parameters
- Error Codes: Error Reference
Getting started
Before you begin, make sure you have obtained your AppInChina App ID (APP_ID) and APP_SECRET. These credentials are required for SDK initialization and all API requests, and are distinct from your WeChat App ID (the WeChat Open Platform AppID used to initialize the WeChat SDK, shared with WeChat Login).
Start with the Prerequisites and environment setup.