Alipay, China's leading third-party online payment solutionAlipay, China's leading third-party online payment solution

5. Receiving async payment result notifications

Alipay will notify merchant’s website of the result data it processed through initiative notification from server after it completes the processing of request data of merchant. These result data are asynchronous notify parameters from server.

Notification parameters

ParameterTypeDescriptionRequiredSample
Basic parameter
notify_timeDateThe time when the notification is sent. The time format is yyyy-MM-dd HHss

Y

2013-11-27 15:45:58
notify_typeStringNotification type

Y

trade_status_sync
notify_idStringNotification ID

Y

ac05099524730693a8b330c5ecf72da978
sign_typeStringThe value can be one of DSA, RSA, or MD5. Uppercase must be used

Y

MD5
signStringSign value

Y

601510b7970e52cc63db0f44997cf70e
notify_action_typeString

Notification action type: 

  • Create: createDirectPayTradeByBuyerAction
  • Pay: payByAccountAction
  • Refund: refundFPAction
  • Reverse: reverseAction Close
  • Trade: closeTradeAction
  • Finish: finishFPAction

N

payByAccountAction
Business parameter
out_trade_noStringThe merchant order number instead of the Alipay trade number. The number must be unique in merchant’s system and will be returned as is.

N

5431395578198135
subjectStringTitle of the goods/ Title of the trade/ Title of the order/Key words of the order and so on. The subject is in the first row of the Alipay transaction details and is very important for reconciliation. The subject will be returned as is.

N

test subject
trade_noStringThe serial number of the trade in Alipay system. The range of the length value: 16-64

N

2013112711001004940000394507
trade_statusStringCurrent status of the trade.

N

WAIT_BUYER_PAY
gmt_createDateThe time when the trade transaction is created. Format: yyyy-MM-dd HHss。

N

2013-11-27 15:45:57
gmt_paymentDateThe time when the payment is done. Format: yyyy-MM-dd HHss

N

2013-11-27 15:45:57
seller_emailStringSeller’s Alipay ID, can be email or phone number

N

zhuzhanghu@alitest.com
buyer_emailStringBuyer’s Alipay ID, can be email or phone number

N

13882390011
seller_idStringSeller's unique Alipay user ID consists of 16 numbers that begin with 2088.

N

2088101106499364
buyer_idStringBuyer's unique Alipay user ID consists of 16 numbers that begin with 2088.

N

2088102105236945
priceNumberCorresponding to the price in the request parameter and will be returned as is.

N

1.00
quantityNumberCorresponding to the quantity in the request parameter and will be returned as is.

N

10
total_feeNumberMoney amount of the trade transaction. Corresponding to the request parameter and will be returned as is.

N

10.00
bodyStringThe detail description of the trade transaction, including notes, description, details and so on. Corresponding to the request parameter and will be returned as is.

N

Hello
refund_feeNumberThe refund amount. The unit is Yuan.

N

1.00
out_biz_noStringMerchant’s business Id. In most cases is the serial number of the refund request in the refund notification.

N

HZRF001
paytools_pay_amountStringPayment amount information of all successful payments in various channels.

N

[{"MCARD":"7.94"},{"TMPOINT":"1.69"},{"BANKCARD":"5.55"}]
extra_common_paramStringThe passback_parameters is returned as is.

N

I'm a passback parameter
m_discount_forex_amountNumberIf coupons/vouchers are used in the transaction, the discount amount redeemed in the settlement currency will be returned. Otherwise, no return.

N

2.19

The paytools_pay_amount parameters

ParameterTypeDescriptionRequiredSample
ALIPAYACCOUNTStringThe money amount paid by the balance of Alipay account. The unit is Yuan.

N

1.23
MCARDStringThe money amount paid by the merchant's prepaid card. The unit is Yuan.

N

7.94
MDISCOUNTStringThe money amount paid by the merchant's discount coupon. The unit is Yuan.

N

1.23
TMPOINTStringThe money amount paid by the Tmall points. The unit is Yuan.

N

1.69
COUPONStringThe money amount paid by coupons. The unit is Yuan.

N

1.23
POINTStringThe money amount paid by points. The unit is Yuan.

N

1.23
DISCOUNTStringThe money amount paid by the discount. The unit is Yuan.

N

1.23
BANKCARDStringThe money amount paid by the money fund. The unit is Yuan.

N

5.55
MONEYFUNDStringThe money amount paid by the money fund. The unit is Yuan.

N

1.23
BAITIAOStringThe money amount paid by BAITIAO. The unit is Yuan.

N

1.23
PCARDStringThe money amount paid by the Alipay card. The unit is Yuan.

N

2.13
PCREDITStringThe money amount paid by the consumption credit card The unit is Yuan.

N

1.23
MCOUPONStringThe money amount paid by the merchants issued coupons. The unit is Yuan.

N

2.21

Data structure:

copy
[
{"<pay_tool_type_1>":"<amount_1>"}
,
{"<pay_tool_type_2>":"<amount_2>"}
,
…
]

Sample:

copy
paytools_pay_amount=[{"MCARD":"7.94"},{"TMPOINT":"1.69"},{"BANKCARD":"5.55"}]

Sample of asynchronous notification

copy
http://some_domain/alipay/notify_url.php?notify_id=ac05099524730693a8b330c5ecf72da978&seller_email=zhuzhanghu%40alitest.com&notify_type=trade_status_sync&buyer_email=13882390011&sign=601510b7970e52cc63db0f44997cf70e&trade_no=2013112711001004940000394507&buyer_id=2088102105236945&quantity=10&total_fee=10.00&price=1.00&gmt_create=2013-11-27+15%3A45%3A57&out_trade_no=5431395578198135&seller_id=2088101106499364&notify_time=2013-11-27+15%3A45%3A58&subject=%E5%A3%B0%E6%B3%A2%E6%94%AF%E4%BB%98-%E5%88%86%E8%B4%A6-sky&trade_status=WAIT_BUYER_PAY&sign_type=MD5