notify_verify
Call this API to validate whether a notification is from the Alipay server, and to ensure the authenticity of the response data.
Mechanism
Assemble the parameter notify ID (notify_id) into a URL according to Alipay requirement. For example:
https://intlmapi.alipay.com/gateway.do?service=notify_verify&partner=2088002396712354¬ify_id=RqPnCoPT3K9%2Fvwbh3I%2BFioE227%2BPfNMl8jwyZqMIiXQWxhOCmQ5MQO%2FWd93rvCB%2BaiGg
With this request URL, result data from the Alipay server can be obtained by simulating the HTTP request interaction with the Alipay server. If the returned data is true, the verification succeeds. Otherwise, the verification is failed.
Request
Service address
Environment | HTTPS request URL |
Production environment | |
Test environment |
Request parameters
Parameter | Description |
Basic parameter | |
service String | Interface name
|
partner String(16) | The partner ID that is assigned by Alipay to identify an Alipay account. The partner ID is composed of 16 digits and begins with 2088.
|
sign_type String | Sign type. RSA, RSA2 and MD5 are supported. Use uppercase.
|
sign String | Sign value
|
Business parameter | |
notify_id String(34) | Notification ID, used by the partner system to verify the notification |
Response
Synchronous response
The response is a string with the status.
Error codes
Business errors
Returned result | Description |
SYSTEM_EXCEPTION | Alipay system error |
ILLEGAL_ARGUMENT | Incorrect parameter |
ILLEGAL_SIGN | Illegal signature |
ILLEGAL_SERVICE | The service parameter is incorrect. |
ILLEGAL_PARTNER | Incorrect partner ID |
ILLEGAL_SIGN_TYPE | Signature is of wrong type. |
Access errors
Returned result | Description |
SYSTEM_EXCEPTION | Alipay system error |
ILLEGAL_ARGUMENT | Incorrect parameter |
ILLEGAL_SIGN | Illegal signature |
ILLEGAL_SERVICE | Service parameter is incorrect. |
ILLEGAL_PARTNER | Incorrect partner ID |
ILLEGAL_SIGN_TYPE | Signature is of wrong type. |
ILLEGAL_PARTNER_EXTERFACE | Service is not activated for this account. |
ILLEGAL_DYN_MD5_KEY | Dynamic key information is incorrect. |
ILLEGAL_ENCRYPT | Encryption is incorrect. |
ILLEGAL_USER | User ID is incorrect. |
ILLEGAL_EXTERFACE | Interface configuration is incorrect. |
ILLEGAL_AGENT | Agency ID is incorrect. |
HAS_NO_PRIVILEGE | No right to visit |
INVALID_CHARACTER_SET | The character set is invalid. |
System errors
Returned result | Description |
SYSTEM_ERROR | Alipay system error |
SESSION_TIMEOUT | Session timeout |
ILLEGAL_TARGET_SERVICE | Wrong target service |
ILLEGAL_ACCESS_SWITCH_SYSTEM | Merchant is not allowed to visit system of this type. |
EXTERFACE_IS_CLOSED | The interface has been closed. |
Samples
Request
https://intlmapi.alipay.com/gateway.do?service=notify_verify&partner=208xxxxxxxxx6931&sign_type=MD5¬ify_id=201xxxxxxxxxxxxxxxxxxxxxxxxxxx9837&sign=15e82ada70910dbaa251f69de45d662a
Response
If the input parameter is invalid, return,
Invalid
If the notification is from Alipay, and inquires in the valid time frame, (1 min)
True
If the notification is not from Alipay, or passes 1 min time frame,
False