Alipay
Alipay is a digital wallet payment method widely used in China with over a billion active users worldwide. With Alipay, consumers can enjoy a seamless checkout experience by paying on the web or on a mobile device using their Alipay account credentials, eliminating the need to enter payment information manually.
Introduction
Alipay is the leading digital wallet payment method in China and one of the most popular payment platforms globally. Integrating Alipay with Payrails allows you to provide a fast, easy-to-use payment option for your customers while leveraging our platform to route the payment via Stripe as a Payment Service Provider (PSP).
Alipay uses a redirect-based payment flow. When a customer selects Alipay at checkout, they are redirected to Alipay to log in and confirm their payment, then redirected back to your website or app upon completion. Alipay is a single-use payment method where customers are required to authenticate each payment.
This guide will explain the process of integrating Alipay into your app or website using Payrails.
Pre-requisites
Before you start accepting Alipay payments with Payrails, there are a few requirements you must meet:
- Integrate with Payrails using one of our SDKs or our API
- Configure a new integration account for Alipay via Stripe as a Payment Service Provider. If you do not have a Stripe integration already configured in your workspace, please follow the Stripe integration setup guide first.
- Enable Alipay as a payment method in your Stripe integration configuration. In the Payrails portal, navigate to Settings → Integrations, select your Stripe integration instance, and enable the Alipay checkbox under Payment methods, then save the account.
- Enable Alipay as a payment option in your workflow.
- Make sure you're sending the Alipay specific meta fields (found under Merchant configurations → Meta fields on your Payrails dashboard and in the examples below) in your requests.
Ways to integrate Alipay
Payrails SDK
The simplest way to use AliPay with Payrails is to use our drop-in in your checkout flow. With this integration type, no additional work is required to accept payments with AliPay except for handling success/failure screens for your users.
For a more flexible implementation using our SDK, you can use our (genericRedirectButton) element. See special instructions here for your client-side implementation.
Server-to-server integration
You can integrate Alipay by completely managing your own client-side implementation, and using Payrails APIs with a server-to-server integration to process Alipay payments. With this approach, follow the documentation below to build Alipay into your applications:
Parse Alipay from lookup response
With a server-to-server integration, you can call our lookup payment options endpoint to get available payment options and relevant configurations for each payment method. As the example below, you can see alipay returned as an option of the paymentCompositionOptions. You can use this value later to authorize payments with Payrails as you can see in the next sections.
{
"name": "lookup",
"actionId": "0bb6413e-cabb-4074-99e6-9e815c69f25b",
"executedAt": "2026-03-25T12:00:00.000000000Z",
"data": {
"paymentCompositionOptions": [
{
"integrationType": "api",
"paymentMethodCode": "alipay",
"description": "Alipay"
}
]
},
"links": {
"execution": "https://payrails-api.staging.payrails.io/merchant/workflows/payment-acceptance/executions/83c534ac-13b7-43e6-b04b-f3e8b4eb4424",
"authorize": {
"method": "POST",
"href": "https://payrails-api.staging.payrails.io/merchant/workflows/payment-acceptance/executions/83c534ac-13b7-43e6-b04b-f3e8b4eb4424/authorize"
}
}
}Pass Alipay payment method in request to authorize payment with Payrails
You can then make a request to our authorize a payment endpoint with alipay as the paymentMethodCode. See an example below:
{
"executionId": "c0fd1c51-e709-47e5-bfd1-5d1c98f7d990",
"amount": {
"value": "10.00",
"currency": "CNY"
},
"paymentComposition": [
{
"integrationType": "api",
"paymentMethodCode": "alipay",
"amount": {
"value": "10.00",
"currency": "CNY"
}
}
],
"meta": {
"customer": {
"email": "[email protected]",
"country": {
"code": "CN"
}
}
},
"returnInfo": {
"success": "https://mysuccessurl.com",
"error": "https://myerrorurl.com"
}
}Note: Alipay is a redirect-based, single-use payment method. After calling the authorize endpoint, the customer will be redirected to Alipay to log in and confirm the payment. Once the payment is confirmed, the customer will be redirected back to the
returnInfo.successURL. Make sure to provide validreturnInfoURLs in your authorization request.
Handle the redirect response
After the customer completes the payment on Alipay's side, they will be redirected back to your success or error URL. You should then verify the payment status by checking the workflow execution status via the Payrails API or by listening to webhook notifications.
Supported currencies
Alipay via Stripe supports the following presentment currencies:
- AUD, CAD, CNY, EUR, GBP, HKD, JPY, MYR, NZD, SGD, USD
Supported regions / countries
| Region(s) | Countries |
|---|---|
| Americas | 🇺🇸 United States, 🇨🇦 Canada |
| Europe | 🇦🇹 Austria, 🇧🇪 Belgium, 🇧🇬 Bulgaria, 🇨🇾 Cyprus, 🇨🇿 Czech Republic, 🇩🇰 Denmark, 🇪🇪 Estonia, 🇫🇮 Finland, 🇫🇷 France, 🇩🇪 Germany, 🇬🇷 Greece, 🇭🇺 Hungary, 🇮🇪 Ireland, 🇮🇹 Italy, 🇱🇻 Latvia, 🇱🇹 Lithuania, 🇱🇺 Luxembourg, 🇲🇹 Malta, 🇳🇱 Netherlands, 🇵🇱 Poland, 🇵🇹 Portugal, 🇷🇴 Romania, 🇸🇰 Slovakia, 🇸🇮 Slovenia, 🇪🇸 Spain, 🇸🇪 Sweden, 🇬🇧 United Kingdom |
| Asia Pacific | 🇨🇳 China, 🇭🇰 Hong Kong, 🇯🇵 Japan, 🇲🇾 Malaysia, 🇳🇿 New Zealand, 🇸🇬 Singapore, 🇦🇺 Australia |
Supported workflows and services
| Workflow | Supported |
|---|---|
| Available via Payrails SDK | ✔️ |
| Available via Payrails API | ✔️ |
| Delayed / Manual Capture | ✖️ |
| Instant Capture | ✔️ |
| Cancel / Void | ✔️ |
| Refund / Reverse | ✔️ |
| Save Instruments | ✖️ |
| Merchant Initiated Transaction (MIT) | ✖️ |
| Interoperability | N/A |