alipay.intl.acquiring.common.payCancel
Use this API to cancel a transaction when the PAY API call did NOT return a clear result. For example, when the 'pay' API call times out or an UNKNOWN_EXCEPTION
is returned. Upon the success of payCancel API call, the merchant can cancel the transaction.
Request
Service address
Environment | URL |
Production | https://open-sea.alipay.com/api/alipay/intl/acquiring/common/paycancel.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 unique merchant ID assigned by Alipay. This parameter identifies the settlement target that Alipay settles to.
|
acquirementId String(64) | The unique Alipay transaction ID that identifies the transaction to be cancelled. This parameter is required when
|
merchantTransId String(64) | The unique ID assigned by the merchant to identify a transaction to be cancelled. If both
|
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(/) | See resultInfo for details.
|
acquirementId String(64) | The unique Alipay transaction ID. Note: This parameter is required when
|
merchantTransId String(64) | The unique ID assigned by the merchant to identify a transaction. Note: This parameter is required when
|
cancelTime Date time(/) | Date time with timezone, see RFC 3339 Section 5.6 for details.
|
Sub-parameters
resultInfo
Parameter | Description |
resultStatus String(2) | The request status can be:
|
resultCodeId String(8) | An 8-digit code that is used to identify a result. When
|
resultCode String(64) | The result code
|
resultMsg String(256) | When
|
Result code
Functional logic result code
resultCodeId | resultCode | resultStatus | Remarks |
12002005 | USER_NOT_EXIST | F | The user does not exist. |
12002006 | USER_STATUS_ABNORMAL | F | Abnormal user status |
12005003 | ORDER_STATUS_INVALID | F | The transaction status is invalid. |
12005004 | ORDER_NOT_EXIST | F | The transaction does not exist. |
12006009 | MERCHANT_BALANCE_NOT_ENOUGH | F | Insufficient balance of the merchant |
12002018 | ORDER_CANCEL_WINDOW_EXPIRED | F | Expired to cancel the transaction. |
12005134 | SIGN_TYPE_INVALID | F | The signature type is invalid. |
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. |
00000021 | ACCESS_DENIED | F | Access denied |
12014155 | UNKNOWN_CLIENT | F | Unknown client |
12014156 | INVALID_CLIENT_STATUS | F | Invalid client status |
00000024 | REQUEST_TRAFFIC_EXCEED_LIMIT | F | The request traffic exceeds the limit. |
12003001 | MERCHANT_NOT_EXIST | F | The merchant doesn't exist. |
Sample
Sample request
{
"request":{
"head":{
"version":"2.0.4",
"function":"alipay.intl.acquiring.common.payCancel",
"clientId":"385xxxxxxxxx0001",
"reqTime":"2001-07-04T12:08:56+05:30",
"reqMsgId":"123xxxxxxxxxxxxxxx3fda",
"signType":"RSA2"
},
"body":{
"merchantId":"211xxxxxxxxxxxxxx2999",
"acquirementId":"201xxxxxxxxxxxxxxxxxxxxx2747"
}
},
"signature":"signature string"
}
Sample response
{
"response":{
"head":{
"version":"2.0.4",
"function":"alipay.intl.acquiring.common.payCancel",
"clientId":"385xxxxxxxxx0001",
"respTime":"2001-07-04T12:08:56+05:30",
"reqMsgId":"123xxxxxxxxxxxxxxx3fda",
"reserve":"{}",
"signType":"RSA2"
},
"body":{
"resultInfo":{
"resultStatus":"S",
"resultCodeId":"00000000",
"resultCode":"SUCCESS",
"resultMsg":"success"
},
"acquirementId":"201xxxxxxxxxxxxxxxxxxxxx2747",
"merchantTransId":"510xxxxxxxxxxxxx0002",
"cancelTime":"2001-07-04T12:08:56+05:30"
}
},
"signature":"signature string"
}