2. Receiving async payment result notifications

Last updated: 2019-4-25

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

Parameter Type Description Required Sample
Basic parameters
notify_time Date The time when the notification is sent. The time format is yyyy-MM-dd HHss Y 2013-11-27 15:45:58
notify_type String Notification type Y trade_status_sync
notify_id String Notification ID Y ac05099524730693a8b330c5ecf72da978
sign_type String The value can be one of DSA, RSA, or MD5. Uppercase must be used Y MD5
sign String Sign value Y 601510b7970e52cc63db0f44997cf70e
notify_action_type String Notification action type:
creat:createDirectPayTradeByBuyerAction
Pay: payByAccountAction Refund: refundFPAction
Reverse: reverseAction
Close trade: closeTradeAction Finish: finishFPAction
N payByAccountAction
Business parameters
out_trade_no String The 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
subject String Title 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_no String The serial number of the trade in Alipay system. The range of the length value: 16-64 N 2013112711001004940000394507
trade_status String Current status of the trade. N WAIT_BUYER_PAY
gmt_create Date The time when the trade transaction is created. Format: yyyy-MM-dd HHss。 N 2013-11-27 15:45:57
gmt_payment Date The time when the payment is done. Format: yyyy-MM-dd HHss N 2013-11-27 15:45:57
seller_email String Seller’s Alipay ID, can be email or phone number N zhuzhanghu@alitest.com
buyer_email String Buyer’s Alipay ID, can be email or phone number N 13882390011
seller_id String Seller's unique Alipay user ID consists of 16 numbers that begin with 2088. N 2088101106499364
buyer_id String Buyer's unique Alipay user ID consists of 16 numbers that begin with 2088. N 2088102105236945
price Number Corresponding to the price in the request parameter and will be returned as is. N 1.00
quantity Number Corresponding to the quantity in the request parameter and will be returned as is. N 10
total_fee Number Money amount of the trade transaction. Corresponding to the request parameter and will be returned as is. N 10.00
body String The 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_fee Number The refund amount. The unit is Yuan. N 1.00
out_biz_no String Merchant’s business Id. In most cases is the serial number of the refund request in the refund notification. N HZRF001
paytools_pay_amount String Payment amount information of all successful payments in various channels. N [{"MCARD":"7.94"},{"TMPOINT":"1.69"},{"BANKCARD":"5.55"}]
extra_common_param String The passback_parameters is returned as is. N I'm a passback parameter
m_discount_forex_amount Number If coupons/vouchers are used in the transaction, the discount amount redeemed in the settlement currency will be returned. Otherwise, no return. N 2.19

paytools_pay_amount

Parameter Type Description Required Sample
ALIPAYACCOUNT String The money amount paid by the balance of Alipay account. The unit is Yuan. N 1.23
MCARD String The money amount paid by the merchant's prepaid card. The unit is Yuan. N 7.94
MDISCOUNT String The money amount paid by the merchant's discount coupon. The unit is Yuan. N 1.23
TMPOINT String The money amount paid by the Tmall points. The unit is Yuan. N 1.69
COUPON String The money amount paid by coupons. The unit is Yuan. N 1.23
POINT String The money amount paid by points. The unit is Yuan. N 1.23
DISCOUNT String The money amount paid by the discount. The unit is Yuan. N 1.23
BANKCARD String The money amount paid by the money fund. The unit is Yuan. N 5.55
MONEYFUND String The money amount paid by the money fund. The unit is Yuan. N 1.23
BAITIAO String The money amount paid by BAITIAO. The unit is Yuan. N 1.23
PCARD String The money amount paid by the Alipay card. The unit is Yuan. N 2.13
PCREDIT String The money amount paid by the consumption credit card The unit is Yuan. N 1.23
MCOUPON String The money amount paid by the merchants issued coupons. The unit is Yuan. N 2.21

Data structure:

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

Sample:

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

Sample of asynchronous notification

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

If you have any question, please contact us