alipay.intl.merchant.common.monitor
Use this interface to track transaction status and performance data, and detect problems of the network, machines, payment codes, and so on.
Request
Service address
Environment | URL |
Production | https://open-sea.alipay.com/api/alipay/intl/merchant/common/monitor.htm |
Request head
Parameter | Description |
version String(8) | API version
|
function String(128) | API name
|
clientId String(32) | A unique ID assigned by Alipay to identify a client that makes API calls
|
reqTime Date time(/) | Request time. The date time with timezone, see RFC 3339 Section 5.6 for details.
|
reqMsgId String(64) | Request message ID. A unique ID assigned by the client to identify a request message. This ID identifies a unique system request rather than business request.
|
reserve String(256) | Reserved parameter. Key-value formatted parameter for future use. This parameter is required for system integrator. If you are a system integrator, you must provide the isvAccesstoken value.
|
signType String(64) | Sign type
|
Request body
Parameter | Description |
merchantId String(64) | The user ID of the partner, assigned by Alipay
|
sellerId String(32) | The user ID of the secondary merchant, assigned by the partner
|
storeId String(32) | The store ID assigned by the partner
|
partnerId String(64) | The unique partner ID assigned by Alipay
|
productCode enum<ProductCode>(64) | The payment product code. See ProductCode for details.
|
sceneCode Enum<SceneCode>(64) | The business scene code. See SceneCode for details.
|
sysServiceProviderId String(16) | The service provider ID
|
equipmentType Enum<EquipmentType>(32) | The equipment type. See EquipmentType for details.
|
equipmentId String(64) | The unique equipment ID of the merchant. If the transaction is requested by an ECR, use the ECR ID. If no equipment ID is available, use the MAC address.
|
networkType enum<NetworkType>(8) | The network type. See NetworkType for details.
|
clientNetworkTime String(8) | The indicator of the client terminal network latency, with a unit in second and accurate to millisecond. For example, the time it costs for the client terminal to send a request to the service end.
|
mac String(64) | The MAC address
|
tradePerformInfo list<TradePerformInfo>(/) | The trade performance data during two heartbeats, including all the transaction ID, total time cost, request time cost and the transaction status, listed chronologically in the JSON format. See TradePerformInfo for details.Note: If the sending of a heartbeat packet fails due to network errors or other reasons, the transaction data is stored locally until the heartbeat packet is sent successfully.This parameter is required when transactions exist.
|
extendInfo String(2048) | Extended information. The key-value formatted parameter reserved for future use.
|
Response
Response head
Parameter | Description |
version String(8) | API version
|
function String(128) | API name
|
clientId String(32) | Client ID. The unique ID assigned by Alipay to identify a client that makes API calls
|
respTime Date time(/) | Response time. The date time with timezone, see RFC 3339 Section 5.6 for details.
|
reqMsgId String(64) | Request message ID. The unique ID assigned by client to identify a request message.
|
reserve String(256) | Reserved parameter. The key-value formatted parameter reserved for future use.
|
signType String(8) | Sign type
|
Response body
Parameter | Description |
resultInfo ResultInfo(/) | Result info. See resultInfo for details.
|
Sub-parameters
resultInfo
Parameter | Description |
resultStatus String(2) | The request status can be:
|
resultCodeId String(8) | Result ID. An 8-digit code that is used to identify a result. When
|
resultCode String(64) | The result code
|
resultMsg String(256) | When
|
ProductCode
Name | Type | Description |
OFFLINE_PAY | String | Offline payment |
SceneCode
Name | Type | Description |
PAYMENT_QRCODE | String | Cross-border in-store payment |
TRANSACTION_QRCODE | String | Cross-border transaction QR code payment |
EquipmentType
Name | Type | Description |
ECR | String | Electronic cash register |
STORE | String | Store |
VM | String | Vending machine |
POS | String | POS machine of a bank, or other casher devices with Linux system, such as an INSPIRY smart box |
APP | String | Smart devices, phones, mPOSs with Android/IOS systems |
IOT | String | IoT products |
OTHER | String | Other devices |
NetworkType
Name | Type | Description |
2G | String | 2G network |
3G | String | 3G network |
4G | String | 4G network |
5G+ | String | 5G network |
WIFI | String | WI-FI network |
LAN | String | Local area network |
TradePerformInfo
Parameter | Description |
merchantTransId String(64) | Merchant transaction ID. The unique ID assigned by the merchant to identify a transaction
|
merchantTransTime String(8) | Merchant transaction time. Total transaction time costed at the merchant end: from the time that the code is scanned to the time that the payment result is returned by Alipay. The transaction time is in a unit of second and accurate to millisecond.This parameter is required when
|
merchantReqTime String(8) | Merchant request time. Total request time: from the time that the request is sent by the merchant to the time that the merchant receives the response. The request time is in a unit of second and accurate to millisecond.This parameter is required when
|
merchantTransStat enum<MerchantTransStat>(1) | The merchant transaction status. See MerchantTransStat for details
|
start Date time(/) | The start time of the transaction. Date time with timezone, see RFC 3339 Section 5.6 for details.
|
extendInfo String(2048) | Extended information. Reserved parameter for extended information, in JSON format
|
MerchantTransStat
Name | Type | Description |
S | String | The transaction succeeded, which is shown directly by a transaction successful result returned for the payment request |
I | String | The transaction succeeded, which is not shown by a successful result returned for the payment request but is shown by a query result or by an asynchronous response. This situation usually occurs when a payment password is needed instead of password free payment, a system error occurs, or the payment API times out |
F | String | The transaction failed, which is shown directly by a transaction failed result returned for the payment request |
P | String | The transaction failed, which is not shown by a transaction failed result returned for the payment request but is caused by cancelling the transaction after querying the transaction several times without getting a succesful transaction result. This situation usually occurs when a payment password is needed instead of password free payment, a system error occurs, or the payment API times out |
E | String | The transaction failed, caused by the device (for example, if an error occurred when the device scanning a payment code and initiating a payment request, the transaction failed because an external transaction ID might not be created yet) |
X | String | The transaction failed, caused by an error occurred when establishing the connection between the device and the merchant back end (for example, the device has an instable internet connection) |
Y | String | The transaction failed, caused by a merchant server problem |
Z | String | The transaction failed, caused by a failed and abandoned cancel request |
Result code
Basic result code
resultCodeId | resultCode | resultStatus | Remarks |
00000000 | SUCCESS | S | Success |
00000019 | PROCESS_FAIL | F | General business failure |
00000901 | UNKNOWN_EXCEPTION | U | API failed because of unknown reasons |
00000004 | PARAM_ILLEGAL | F | The parameter is incorrect. |
00000007 | INVALID_SIGNATURE | F | The signature is invalid. |
00000008 | KEY_NO_FOUND | F | The key is not found. |
00000013 | NO_INTERFACE_DEF | F | The API is undefined. |
00000014 | API_IS_INVALID | F | The API is invalid or nonactivated. |
00000016 | OAUTH_FAILED | F | The oAuth authentication failed. |
00000021 | ACCESS_DENIED | F | Access denied |
00000024 | REQUEST_TRAFFIC_EXCEED_LIMIT | F | The request traffic exceeds the limit. |
12003001 | MERCHANT_NOT_EXIST | F | The merchant doesn't exist. |
12003011 | MERCHANT_HAS_REGISTER | F | The merchant has already registered. |
12014152 | CLIENT_FORBIDDEN_ACCESS_API | F | The Client is not authorized to use this API. |
12014155 | UNKNOWN_CLIENT | F | Unknown client |
12014156 | INVALID_CLIENT_STATUS | F | Invalid client status |
Sample
Sample request
{
"request": {
"head": {
"version": "2.0.4",
"function": "alipay.intl.merchant.common.monitor",
"clientId": "385xxxxxxxxx0001",
"reqTime": "2001-07-04T12:08:56+05:30",
"reqMsgId": "123xxxxxxxxxxxxxxx3fda",
"signType": "RSA2"
},
"body": {
"merchantId": "211xxxxxxxxxxxxxx2999",
"partnerId": "208xxxxxxxxxx353",
"sellerId": "123456",
"storeId": "112",
"productCode": "OFFLINE_PAY",
"sceneCode": "PAYMENT_QRCODE",
"sysServiceProviderId": "218xxxxxxxxx6645",
"equipmentType": "ECR",
"equipmentId": "10xx023",
"networkType": "4G",
"clientNetworkTime": "3.234",
"mac": "01-23-45-67-89-AB",
"tradePerformInfo": [
{
"merchantTransId": "510xxxxxxxxxxxxx0002",
"merchantTransTime": "5.315",
"merchantReqTime": "3.315",
"merchantTransStat": "S",
"start": "2001-07-04T12:08:36+05:30",
"extendInfo": "{\"T1\":\"value1\",\"T2\":\"value2\"}"
}
],
"extendInfo": "{\"SHOP_ID\":\"BJ_ZZ_001\",\"TERMINAL_ID\":\"1234\"}"
}
},
"signature": "signature string"
}
Sample response
{
"response":{
"head":{
"version":"2.0.4",
"function":"alipay.intl.merchant.common.monitor",
"clientId":"385xxxxxxxxx0001",
"respTime":"2001-07-04T12:08:56+05:30",
"reqMsgId":"123xxxxxxxxxxxxxxx3fda",
"reserve":"{}"
},
"body":{
"resultInfo":{
"resultStatus":"S",
"resultCodeId":"00000000",
"resultCode":"SUCCESS",
"resultMsg":"success"
}
}
},
"signature":"signature string"
}