alipay.intl.acquiring.common.payCancel
You can call this interface to cancel only transactions of the day in Beijing time. For transactions made around the cutoff time, a 15-minute buffer is provided to cancel the transaction.
The cancel interface returns SUCCESS in following scenarios:
- The transaction is not created successfully.
- The transaction is created but not paid. In this case, the transaction will be forced to close, and customers cannot continue to pay.
- The transaction is paid. In this case, the transaction will be refunded, and the transaction status will be changed to TRADE_CLOSED.
Request parameters
Header
No | Name | Description | Type | Length | Required | Remarks | Sample |
1 | version | API version | string | 8 | Y | As per the respective API reference | 2.0.0 |
2 | function | API interface | string | 128 | Y | According to specifications defined by each business domain | alipay.intl.function |
3 | clientId | Client ID | string | 32 | Y | Provided by AlipayHK, used to identify partner and application system | 4Q5XPV504B0A5302 |
4 | reqTime | Request time | datetime | / | Y | DateTime with timezone, which follows the ISO-8601 standard. | 2001-07-04T12:08:56+05:30 |
5 | reqMsgId | Request message ID | string | 64 | Y | Each request will be assigned with a unique id (uuid). | 1234567asdfasdf1123fda |
6 | reserve | Reserved for future implementation | string | 256 | N | Key/Value | {} |
Body
No | Name | Description | Type | Length | Required | Remarks | Sample |
1 | merchantId | The merchant id, which identifies the settlement target that AlipayHK would settle to. | string | 64 | Y | 2160400000002012 | |
2 | acquirementId | Unique AlipayHK transaction id. Note: This parameter is required when merchantTransId = NULL | string | 64 | N | The AlipayHK transaction id, identifying the transaction to be cancelled. | 20181210194010800100160960000444145 |
Response parameters
Header
No | Name | Description | Type | Length | Required | Remarks | Sample |
1 | version | API version | string | 8 | Y | As per the respective API reference | 2.0.0 |
2 | function | API interface | string | 128 | Y | According to specifications defined by each business domain | alipay.intl.function |
3 | clientId | Client ID | string | 32 | Y | Provided by AlipayHK, used to identify partner and application system | 4Q5XPV504B0A5302 |
4 | respTime | Response time | datetime | / | Y | DateTime with timezone, which follows the ISO-8601 standard. | 2001-07-04T12:08:56+05:30 |
5 | reqMsgId | Request message ID | string | 64 | Y | Each request will be assigned with a unique id (uuid). | 1234567asdfasdf1123fda |
6 | reserve | Reserved for future implementation | string | 256 | N | Key/Value | {} |
Body
No | Name | Description | Type | Length | Required | Remarks | Sample |
1 | resultInfo | Result info | / | Y | { | ||
2 | acquirementId | Unique AlipayHK transaction id. This field is requiredwhen resultInfo.resultCode = SUCCESS. | string | 64 | N | 20181210194010800100160960000444145 | |
4 | cancelTime | The cancel time of the transaction | datetime | / | N | DateTime with timezone, which follows the ISO-8601 standard. | 2018-12-11T01:25:50-08:00 |
Request sample
{
"request":{
"head":{
"version":"2.0.0",
"function":"alipay.intl.acquiring.common.payCancel",
"clientId":"4Q5XPV504B0A5302",
"reqTime":"2001-07-04T12:08:56+05:30",
"reqMsgId":"1234567asdfasdf1123fde",
"reserve":"{}"
},
"body":{
"merchantId":"2160400000002012",
"acquirementId":"20181210194010800100160960000444145"
}
},
"signature":"testing_signature"
}
Response sample
{
"response": {
"body": {
"acquirementId": "20181210194010800100160960000444145",
"cancelTime": "2018-12-11T01:25:50-08:00",
"resultInfo": {
"resultCode": "SUCCESS",
"resultCodeId": "00000000",
"resultMsg": "Success",
"resultStatus": "S"
}
},
"head": {
"clientId": "4Q5XPV504B0A5302",
"function": "alipay.intl.acquiring.common.payCancel",
"reqMsgId": "1234567asdfasdf1123fde",
"reserve": "{}",
"respTime": "2018-12-11T01:25:50-08:00",
"version": "2.0.0"
}
},
"signature": "test signature"
}
Business Error code
Functional Logic Result Code
No | ResultCodeId | ResultCode | ResultStatus | Remarks |
1 | 12005004 | ORDER_NOT_EXIST | F | Order does not exist |
2 | 12005003 | ORDER_STATUS_INVALID | F | Invalid order status |