Alipay Online

In this flow, the consumer shops and pays in a desktop browser or on a mobile device.

Payment Method Properties

Available country codes Country where the consumer's wallet is domiciledCN
Processing (Presentation) currenciesAUD, CAD, CHF, CNY, EUR, GBP, HKD, JPY, NZD, SGD, USD
Settlement currenciesAUD, CAD, CHF, EUR, GBP, HKD, JPY, NZD, SGD, USD
Consumer currenciesCNY
Channel member tagalipay
Scheme name in the settlement fileAlipay
Minimum transaction amountCNY 0.1
Maximum transaction amountBank card: CNY 50,000/bank or lower
Wallet balance: CNY 300,000/transaction
Total transaction limit in a day: CNY 300,000
Session timeout3 mins to 12 hours, depending on the flow
RefundFull, partial and multiple partial refunds are available.
Refund Validity360 days
ChargebackNo
Integration TypeAsynchronous
SandboxScheme-hosted

Transaction flow

  1. On the merchant checkout page, the consumer selects paying with Alipay.
  2. The merchant sends a transaction request to Alipay.
  3. If the consumer is paying from a desktop browser:
    1. The consumer is redirected to an Alipay page
    2. The page will display a QR code if the mobileview is not set to yes
    3. The consumer scans the QR code. Alternatively, they can log in to the Alipay website to make the payment.
  4. If the consumer is paying from a mobile device:
    1. Alipay returns a payment link to the merchant's mobile website.
    2. The merchant's mobile website redirects the consumer to the Alipay in-app payment page.
    3. The consumer completes the payment in the Alipay app.

Merchant business type

There are certain specins that are only required when a partner has a determined merchant business type. The boarding team will confirm your merchant's business type during the onboarding process

Alipay Online Integration

Specific input parameters

Field NameM/O/CTypeRegexDescription
specin.mobileviewOasciiN/ASet to no to display a QR code on Alipay’s payment page. The consumer can scan the code to proceed with the payment on their mobile device.
specin.hotelnameCasciiN/AThe name of the hotel for which the reservation was made.

Mandatory in case the merchant’s business type is Hotel.
specin.checkintimeCascii[0-9]{4}-[0-9]{2}-[0-9]{2}The date of the check-in in GMT+8 offset. Separate multiple entries by a |.

Mandatory in case the merchant’s business type is Hotel.

Example: 2019-03-23|2019-03-25.

The number of entries in specin.checkintime must match the number of entries in specin.checkouttime.
specin.checkouttimeCascii[0-9]{4}-[0-9]{2}-[0-9]{2}The date of the check-in in GMT+8 offset. Separate multiple entries by a |.

Mandatory in case the merchant’s business type is Hotel.

Example: 2019-03-25|2019-03-29.

The number of entries in specin.checkouttime must match the number of entries in specin.checkintime.
specin.flightnumberCasciiN/AThe number of the flight.

Mandatory in case the merchant’s business type is Aviation.

Separate multiple entries by a |.

Example: LH 2041|AZ 436.

The number of entries in specin.flightnumber must match the number of entries in specin.departuretime.
specin.departuretimeCascii[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}The date and time of departure of the flight in GMT+8 offset.

Mandatory in case the merchant’s business type is Aviation.

Separate multiple entries by a |.

Example: 2019-04-28 17:50|2019-04-29 10:30

The number of entries in specin.departuretime must match the number of entries in specin.flightnumber.
specin.admissionnoticeurlCasciihttps?://.+{1,248}The URL of the admission notice.

Mandatory in case the merchant’s business type is Overseas Education.
specin.goodsinfoCascii.+^[1-9][0-9]\* The part before the ^ is the description of the item. The part after indicates how many copies of this item are being sold.Information about the goods being sold.

Mandatory in case the merchant’s business type is Retailing.

Separate multiple entries by a |.

Example: Laptop^1|Socks^12.

For standard input parameters, see Input parameters for the TRANSACTION call.

Specific output parameters

Field NameDescriptionType
SPECOUT.OUTTRADENOA unique value that’s assigned to each transaction.ascii
SPECOUT.SETTLEMENTCURRENCYThe settlement currency of the transaction.ascii
SPECOUT.SETTLEMENTAMOUNTThe amount in the settlement currency of the transaction.ascii
SPECOUT.FXRATEThe exchange rate.

For example: USD/CNY = 6.59430000
ascii
SPECOUT.CNYAMOUNTThe transaction amount in CNY, in major units.ascii
SPECOUT.ALIPAYCUSTOMSURLAlipay customs declaration service URL.ascii
SPECOUT.SRCCURRENCYHardcoded to CNY, as consumer wallet is in CNY.ascii
SPECOUT.SRCAMOUNTThe transaction amount in CNY.ascii

For standard output parameters, see Output parameters for the TRANSACTION call.

Specific output parameters for the REFUND call

Field NameTypeDescription
SPECOUT.SETTLEMENTCURRENCYasciiThe settlement currency of the refund.
SPECOUT.SETTLEMENTAMOUNTasciiThe amount in the settlement currency of the refund.
SPECOUT.FXRATEasciiThe refund exchange rate. The same exchange rate used for the transaction.

For example: USD/CNY = 6.59430000
SPECOUT.DSTAMOUNTasciiThe refund amount in CNY.
SPECOUT.DSTCURRENCYasciiHardcoded to CNY, as consumer wallet is in CNY.

👍

Note

The refund uses the same exchange rate as the transaction. The total refund amount to be settled will be the same as the original total transaction amount that was settled. In the case of partial refunds, the refund amount will also be calculated with the same exchange rate, so the refund amount will never exceed the original amount.

TRANSACTION call input

tag=alipay
&txtype=TRANSACTION
&countrycode=CN
&currency=CNY
&amount=1055
&merchanttxid=mCYaU22CeZWh
&login=johndoe
&password=wXBrpVporFVjGO4R
&contractid=JOHNDOECONTRACT
&channel=testchannel
&merchantredirecturl=https%3A%2F%2Fmerchant.com%2Fwork%2Fppro2%2Flanding.php
&notificationurl=https%3A%2F%2Fmerchant.com%2Fwork%2Fppro2%2Fnotification.php
&specin.dynamicdescriptor=DynDescriptor
&accountholdername=John%20Doe
&returnmode=urlencodeext

TRANSACTION call output

REQUESTSTATUS=SUCCEEDED
&STATUS=SUCCEEDED
&TXID=844612929
&ERRMSG=
&CHANNEL=testchannel
&TAG=alipay
&REDIRECTSECRET=OTzp0pFUOGPMsW3KQSPhzrgHEa4h1DNw
&SPECOUT.OUTTRADENO=1111111
&SPECOUT.FXRATE=6.59430000
&SPECOUT.SETTLEMENTAMOUNT=15
&SPECOUT.SETTLEMENTCURRENCY=USD
&SPECOUT.CNYAMOUNT=97
&SPECOUT.ALIPAYCUSTOMSURL=https://svc-alipaycustoms.public.k8s.prod.ppro.com/alipay-customs?
sign=vVf3Eo8v1ytd%2BOf9Uy6UcZ8JppF1JCj1Wz%2Fa9r3yXo4%3D&txId=2020051422001336121451470631&amount=0.07
&SPECOUT.SRCCURRENCY=CNY
&SPECOUT.SRCAMOUNT=97

Additional Information

Notes on CNY Processing

All transactions processed in CNY are settled in USD or EUR. Alipay applies a foreign exchange rate per transaction and settles to us the converted amount in the predetermined settlement currency (USD or EUR). We also settle with you the converted amounts. This means you must track the foreign exchange rate per transaction for reconciliation purposes into the settlement currency (USD or EUR). We provide the foreign exchange rate between CNY and the settlement currency in SPECOUT.FXRATE.

Refunds are handled similarly. The SPECOUT.FXRATE parameter tracks the amount that will be deducted from your settlement. The consumer never pays any foreign exchange costs in none of the cases above. In both cases, you handle the cost through the USD or EUR settlement.

The table below shows the differences between CNY versus like-for-like processing currency.

ParameterCNY (settlement only available in EUR and USD)Like-for-like (processing and settlement in the same currency)
currency value in Transaction callCNYNon-CNY.

E.g: GBP
currency value in Refund callCNY

The same value as the currency value in Transaction call
GBP

The same value as the currency value in Transaction call
SPECOUT.SETTLEMENTCURRENCY in Transaction call when STATUS=SUCCEEDEDThe predetermined non-CNY settlement currency

E.g. USD or EUR
The same value as the currency value in Transaction call

E.g. GBP
SPECOUT.SETTLEMENTCURRENCY in Refund API response upon STATUS=SUCCEEDEDThe predetermined non-CNY settlement currency

E.g. USD or EUR
The same value as the currency value in Transaction call

E.g. GBP
CURRENCY in settlement filesThe predetermined non-CNY settlement currency

E.g. USD or EUR

Our settlement files will not show or track foreign exchange rates
The same value as the currency value in Transaction API request

E.g. GBP

Examples

The example used below shows an Alipay transaction with USD as the settlement currency.

Table 1. Transaction call example (only key parameters)

ParameterValue
tagalipay
currencyCNY
countrycodeCN
amount1000

Table 2. Succeeded Transaction response example (only key parameters)

ParameterDescriptionValue
SPECOUT.FXRATEExchange rate (used by Alipay)

This exchange rate is guaranteed for potential refunds
6.44145000
SPECOUT.CNYAMOUNTThe amount deducted from the consumer’s wallet

In CNY major units
10.00
SPECOUT.SRCCURRENCYThe currency of the consumer’s walletCNY
SPECOUT.SRCAMOUNTThe amount deducted from the consumer’s wallet

In minor units, according to ISO 4217
1000
SPECOUT.SETTLEMENTCURRENCYThe settlement currency of the transactionUSD
SPECOUT.SETTLEMENTAMOUNTThe amount in the settlement currency of the transaction (amount calculated by Alipay and to be settled to you)

In minor units according to ISO 4217
160

In the example above, the consumer will be billed CNY 10.00 and you will be settled USD 1.60.

Table 3. Refund call example (only key parameters)

ParameterValue
tagalipay
currencyCNY
countrycodeCN
amount1000

Table 4. Succeeded Refund response example (only key parameters)

ParameterDescriptionValue
SPECOUT.FXRATEExchange rate (used by Alipay)

This is the guaranteed rate from the initial transaction
6.44145000
SPECOUT.DSTCURRENCYThe currency of the consumer’s walletCNY
SPECOUT.DSTAMOUNTThe amount deducted from the consumer’s wallet

In minor units, according to ISO 4217
1000
SPECOUT.SETTLEMENTCURRENCYThe settlement currency of the transactionUSD
SPECOUT.SETTLEMENTAMOUNTSPECOUT.SETTLEMENTAMOUNT

The amount in the settlement currency of the refund (amount calculated by Alipay and to be settled to you)

In minor units according to ISO 4217
160

In the sample above, the consumer will be refunded CNY 10.00; you will be debited USD 1.60.

Settlement file examples

Table 5. Volume-per-transaction settlement file

MERCHANT_TX_IDTX_IDPAYMENT_REFERENCEEVENT_TYPEEVENT_TIMESTAMPMERCHANT_IDPAYMENT_METHODAMOUNTCURRENCYCOUNTRY
2021061519991112223CPCKRASUCCEEDED2021-06-15T11:37:01ZTESTCONTRACTAlipay1.60USDCN

Only the converted amount (USD or EUR) will show in this file.

Table 6. Volume-per-refund settlement file

MERCHANT_TX_IDRF_IDPAYMENT_REFERENCEEVENT_TYPEEVENT_TIMESTAMPMERCHANT_IDPAYMENT_METHODAMOUNTCURRENCYCOUNTRYREFERENCE_TX_ID
2021061519991112223PZ0FWASUCCEEDED2021-06-15T15:16:02ZTESTCONTRACTAlipay-1.60USDCN999111222

Only the converted amount (USD or EUR) will show in this file.

Table 7. Aggregate settlement file

MERCHANT_IDPAYMENT_METHODEVENT_TYPEEVENT-COUNTAGGREGATE_AMOUNTCURRENCY
TESTCONTRACTAlipayTRANSACTION11.60USD
TESTCONTRACTAlipayREFUND1-1.60USD
TESTCONTRACTAlipayACQUIRING_FEE2-0.20USD
TESTCONTRACTAlipaySUCCEEDED_FEE2-0.20USD

Only the converted amount (USD or EUR) will show in this file.