Quick Start
Review the integration path, required product capabilities, and reading order.
Integration Modes
Choose between Checkout Mode (
payUrl) and Component Mode (mode: 'subscription').Core APIs
Jump directly to subscription create, query, and cancel endpoints.
- PCI Compliance: Directly violates PCI DSS (Payment Card Industry Data Security Standard) requirements.
- Insufficient Isolation: Third-party
WebViewor wrapperiframecontainers may fail to provide adequate security isolation. - Man-in-the-Middle Risk: Malicious host apps may intercept or tamper with sensitive cardholder data.
- Phishing Risk: Users cannot verify that they are entering sensitive credentials in a trusted environment.
Quick Start
1
Confirm the business model and prerequisites
Start with the API Description Guide, CIT vs. MIT Guide, and the Subscription Flowchart to confirm your scenario fits fixed-cycle recurring billing.
2
Choose your frontend integration mode
When you call Subscription Apply
/subscription/apply, the response returns both payUrl and clientToken:- Checkout Mode (
payUrlredirect): Redirect the user to HaiPay’s hosted checkout page. - Component Mode (
clientTokenembed): Mount the Component on your own page withmode: 'subscription'.
3
Connect webhooks, queries, and cancellation
Handle both
SUBSCRIPTION status webhooks and SUBSCRIPTIONS_DEDUCT recurring charge webhooks on your backend, and provide a user-facing cancellation button mapped to /subscription/cancel.Integration Modes
Subscriptions share the same frontend integration architecture as one-time payments. Full component parameters, events, and code samples are maintained in the dedicated integration guides:Core APIs
For full request fields, response schemas, and live debugging, go directly to the API Reference pages:Subscription Create
POST /subscription/apply — Create a subscription order, launch user authorization, and complete the first charge.Subscription Query
POST /subscription/query — Check subscription status, platform subscription number, and recurring order number.Subscription Cancel
POST /subscription/cancel — Cancel an active subscription and stop future recurring charges.Asynchronous Notifications
When the subscription status changes or a recurring deduction completes, HaiPay pushes an asynchronous notification to thenotifyUrl provided in the subscription create request.
After receiving a notification, return HTTP Status Code 200 (200 OK) when business processing succeeds to acknowledge receipt (returning an uppercase SUCCESS body is no longer required). Otherwise, the system treats the delivery as failed and retries.
- Subscription Status Notification (SUBSCRIPTION)
- Deduction Notification (SUBSCRIPTIONS_DEDUCT)
Triggered when the subscription status changes (e.g., subscription activated, canceled, failed, etc.).
Key Business Rules
Common Questions
When should I use Subscription Payment vs. MIT Payment?
When should I use Subscription Payment vs. MIT Payment?
Use Subscription Payment (
/subscription/apply, component mode: 'subscription') when you have a fixed billing interval and defined plan duration, and want HaiPay to automatically schedule recurring charges. Use MIT Payment (/usd/mit/apply) (component mode: 'payment') when charges are usage-based, unscheduled, or triggered by your own billing scheduler.Should I pass inBankCode or paymentMethods?
Should I pass inBankCode or paymentMethods?
The two parameters are mutually exclusive (when
inBankCode is omitted, paymentMethods is required, and vice versa). Pass inBankCode for a single payment method, or pass paymentMethods (e.g., "GOOGLE_PAY,CREDIT_CARD") to dynamically control which payment methods are displayed and their top-to-bottom order.Why are cancellation and off-platform notifications mandatory for subscriptions?
Why are cancellation and off-platform notifications mandatory for subscriptions?
Recurring off-session charges carry a higher risk of customer disputes if users forget about renewals. Clear terms, pre/post-deduction notifications, and an accessible cancellation entry significantly reduce chargebacks.
How should I handle Unsupported region: CN in production?
How should I handle Unsupported region: CN in production?
Verify that your target market is included in the Supported & Unsupported Regions List and check your merchant account configuration.