Skip to main content
HaiPay subscription payment supports membership, recurring services, auto-renewal, and other periodic billing scenarios. This page covers integration modes, key business rules, and launch requirements. For detailed API fields and debugging, refer to the corresponding API Reference.

Quick Start

Review integration steps, prerequisites, and recommended reading path.

Integration Modes

Compare Checkout Mode and Front-End Component.

Core APIs

Jump to subscription apply, query, cancel, and refund endpoints.
  • Provide clear subscription entry, billing cycle description, and unsubscribe entry.
  • Notify users via email or other off-site channels before and after each charge.
  • Provide a confirmable subscription agreement and only initiate after explicit user authorization.
  • Maintain customer support availability, at least covering service hours in primary operating regions.
  • Consumers may initiate a dispute within 180 days after a credit card charge.
  • Each dispute incurs a $20 dispute handling fee.
  • If you choose to contest, an additional $20 representment fee applies.
  • If the representment is successful, HaiPay refunds the representment fee; the original dispute handling fee is non-refundable.
PCI DSS strictly prohibits embedding credit card input pages in WebView or iframe. Always complete card information collection and payment authorization in a trusted browser environment to avoid compliance risks and sensitive data exposure.

Quick Start

1

Confirm Business Model and Prerequisites

First read the API Description Guide and Subscription Flow to confirm your scenario is recurring billing, not one-time payment.
2

Choose Integration Mode

Subscription payment offers two integration modes: PayUrl Redirect Mode (server obtains authorization link, redirects to HaiPay hosted page) and Front-End Component Mode (embed payment components in your own page using a client token). Choose based on your checkout design and frontend capabilities.
3

Integrate APIs, Notifications, and Cancellation

After completing the subscription apply, you need to query subscription status, handle charge callbacks, and provide a cancellation entry for users. Detailed fields and debugging entry points are in the API Reference cards below.

Integration Modes

Subscription payment offers two integration modes. The core difference is who hosts the payment page:
ComparisonCheckout ModeFront-End Component
Payment PageRedirect to HaiPay hosted pageEmbed payment components in merchant page
Frontend WorkMinimal, just handle redirectsRequires JS script and event listeners
UI ControlLow, styled by HaiPayHigh, fully customizable
Key Return FieldpayUrl from responseclientToken from response
Best ForQuick integration, no custom UI needsCustom checkout, immersive payment
The simplest integration method. After the merchant server calls the subscription apply API, use the returned payUrl to redirect the user to the HaiPay hosted page for authorization and first payment.Integration Flow
1

Server calls subscription apply API

The merchant server sends a subscription apply request to HaiPay, including subscription amount, cycle, Callback URL, and other required parameters.
2

Get payUrl and redirect

The response includes a payUrl field. Redirect the user’s browser to this URL.
3

User completes payment

The user completes credit card entry and payment authorization on the HaiPay hosted page. After payment, HaiPay redirects the user back to the merchant’s callBackUrl and sends an async notification to notifyUrl.
Example code (frontend redirect after server obtains payUrl)
// Assume your server has called the subscription apply API and returned payUrl
const payUrl = response.data.payUrl;

// Redirect in current window
window.location.href = payUrl;

// Or open in new window
// window.open(payUrl, '_blank');
Recommendations
  • Fastest subscription integration with minimal frontend changes.
  • No strong custom UI requirements for the payment page.
  • Redirect experience usually works well for mobile H5 scenarios.

Core APIs

For detailed request fields, response structures, and online debugging, go directly to the API Reference:

Subscription Apply

Create a subscription order, initiate user authorization, and complete the first payment.

Subscription Query

Query subscription status, platform subscription number, and charge records.

Subscription Cancel

Merchant-initiated cancellation to stop future recurring charges.

Async Notifications

When subscription status changes or a recurring charge completes, HaiPay pushes async notifications to the notifyUrl provided during subscription apply.
To ensure API extensibility and compatibility, follow these callback parameter receiving practices:
  1. Do NOT declare specific POJO objects to receive callback parameters.
  2. MUST use generic data structures (e.g. JSONObject, Map) for parameter parsing.
  3. This design ensures that future callback field extensions will not affect signature verification.
After receiving a notification, return SUCCESS (uppercase) in the response body.
Triggered when subscription status changes (e.g. success, cancel, failure).
ParameterTypeDescription
typeStringNotification type, fixed as SUBSCRIPTION
appIdLongBusiness ID
currencyStringCurrency
subscriptionOrderIdStringMerchant subscription order ID
subscriptionNoStringPlatform subscription number
amountStringSubscription amount
statusIntegerSubscription status (1: processing, 2: success, 3: failed, 4: cancelled, 5: completed)
recurringIntervalStringRecurring interval type (D/W/M/Y)
recurringIntervalCountIntegerRecurring interval count
subjectStringSubscription title
signStringSignature (use the business key corresponding to the currency for verification)

Key Business Rules

ItemDescription
Transaction LimitSubscription amount range: 0.99 - 1000 USD
Max DurationMaximum subscription duration is 3 years regardless of interval unit
Interval UnitApple Pay does not support W; use D + 7 days for weekly
Payment TypeFixed as SUBSCRIPTION for subscription scenarios
User NotificationRecommended to send off-site notifications after subscription success, before and after charges
UnsubscribeProduction must provide a clear, accessible cancellation entry
Payment Method ParameterPass either inBankCode or paymentMethods in the Subscription Apply API: inBankCode for a single payment method, paymentMethods for a comma-separated list. paymentMethods currently only supports the Front-End Component Mode
For test card numbers, see Test Card Numbers

Frequently Asked Questions

When should I use this page vs. the API Reference?

This page helps you understand product capabilities, choose integration modes, and learn business rules. For development and debugging, go directly to the Subscription API Reference for complete fields, sample payloads, and debugging tools.
Subscription transactions are more prone to user disputes. Clear authorization, notification, and cancellation capabilities significantly reduce chargebacks, complaints, and risk control issues — key prerequisites for stable subscription operations.
This usually means the production environment does not support the region, or the test configuration does not match the target region. Verify merchant configuration, target market, and payment method combination, then contact HaiPay support to confirm production availability.
For fastest launch with minimal frontend changes, choose Checkout Mode. For custom checkout UI where users stay on your page, choose Front-End Component Mode. Both modes use the same Subscription Apply API — the only difference is whether you use the returned payUrl or clientToken.
Choose one — they cannot be passed together or both empty. For a single payment method, pass inBankCode. For multiple payment methods (e.g. Front-End Component Mode), pass paymentMethods. Note: paymentMethods currently only supports the Front-End Component Mode; other modes should continue using inBankCode.
Last modified on July 9, 2026