Skip to main content

Alipay CN

Accept online payments from Alipay China users through your website using the Alipay CN payment method.

Overviewโ€‹

Alipay CN enables merchants to accept payments from customers with Alipay accounts in China. Customers are redirected to Alipay's secure checkout to authorize the payment, then returned to your website upon completion.

Key Features:

  • โœ… 1+ billion users - Access China's largest mobile payment platform
  • โœ… Cross-border ready - Built for international merchants
  • โœ… Secure checkout - Customers authorize on Alipay's platform
  • โœ… Instant confirmation - Real-time payment processing
  • โœ… Mobile-optimized - QR code for desktop, app redirect for mobile
Replaces Legacy Integration

Alipay CN is the current standard and replaces the legacy "Alipay (Online)" integration.

Supported Regionsโ€‹

RegionCurrencyMin AmountMax AmountAPI Version
ThailandTHBเธฟ20.00เธฟ150,000.002017-11-02
SingaporeSGD$1.00$20,000.002017-11-02

How It Worksโ€‹

Payment Flow:

  1. Customer selects Alipay CN at checkout
  2. Create source and charge
  3. Redirect customer to authorize_uri
  4. Customer authorizes in Alipay app or scans QR code
  5. Customer returns to your site
  6. Webhook confirms payment status

Typical completion time: 30 seconds - 2 minutes

Implementationโ€‹

Step 1: Create Sourceโ€‹

curl https://api.omise.co/sources \
-u $OMISE_PUBLIC_KEY: \
-d "amount=150000" \
-d "currency=SGD" \
-d "type=alipay_cn" \
-d "platform_type=WEB"

Step 2: Create Chargeโ€‹

curl https://api.omise.co/charges \
-u $OMISE_SECRET_KEY: \
-d "amount=150000" \
-d "currency=SGD" \
-d "return_uri=https://example.com/payment/complete" \
-d "source=src_test_xxx"

Step 3: Redirect Customerโ€‹

// Redirect to Alipay authorization page
window.location.href = charge.authorize_uri;

Step 4: Handle Webhookโ€‹

app.post('/webhooks/omise', (req, res) => {
const event = req.body;

if (event.key === 'charge.complete') {
const charge = event.data;
if (charge.status === 'successful') {
fulfillOrder(charge.metadata.order_id);
}
}

res.status(200).send('OK');
});

Charge Status Valuesโ€‹

StatusDescription
pendingAwaiting customer authorization
successfulPayment completed
failedPayment failed or declined
expiredAuthorization window expired

Failure Codesโ€‹

CodeDescription
payment_expiredTransaction expired
payment_rejectedPayment rejected by issuer
failed_processingGeneral processing failure
invalid_accountNo valid payment account found
insufficient_fundInsufficient funds or limit reached

Refunds & Voidingโ€‹

  • Void window: 15 minutes (GMT+8) after creation
  • Refunds: Supported via Refunds API

Best Practicesโ€‹

  1. Detect device - Use platform_type parameter appropriately
  2. Handle timeouts - Show clear expiry countdown
  3. Webhook first - Don't rely solely on return redirect
  4. Clear branding - Show Alipay logo at checkout

FAQโ€‹

What is Alipay CN?

Alipay CN is the Chinese version of Alipay, operated by Ant Group. It's China's largest mobile payment platform with over 1 billion users. Alipay CN allows you to accept payments from customers with mainland China Alipay accounts.

What's the difference between Alipay CN and Alipay+?

Alipay CN is specifically for mainland China Alipay users. Alipay+ is a cross-border network that connects multiple wallets (including Alipay CN, Alipay HK, GCash, KakaoPay, etc.). Use Alipay CN if you specifically want to target Chinese customers; use Alipay+ for broader Asian wallet coverage.

What is the platform_type parameter for?

The platform_type parameter (WEB, iOS, ANDROID) optimizes the payment flow for the customer's device. On mobile, it enables deep linking to the Alipay app. On web, it shows a QR code for scanning.

How long does the customer have to complete payment?

The authorization window is limited. If the customer doesn't complete payment within the timeout period, the charge expires. Always implement webhook handling to detect successful payments rather than relying on the return redirect.

Can I refund Alipay CN payments?

Yes, refunds are supported via the Refunds API. You can also void transactions within 15 minutes (GMT+8) of creation.

Why do I need to enable this payment method?

Alipay CN may require additional merchant verification or agreements. Contact support@omise.co to enable Alipay CN for your account.