API fundamentals
AlipayHK adopts API standards along with digital signature and data encryption, please check below information for the API structure. Below basic headers apply on both request and response, for headers information specific to request, please check the document of specific request. Name Description Type Sample Client-Id An ID provided by AlipayHK, used to identify partner and application system. String 4Q5Y8W0WSG45P907917 Content-Type The RFC 2616 media type of the request body, the charset should be as same as the one used for cryptographic operations. String application/json; charset=UTF-8 Signature A key-value pairs string separated by commas (,), which keys and values are joined by equal signs (key=value). Valid keys include: String algorithm=RSA256, keyVersion=1, signature=KEhXthj4bJ801Hqw8kaLvEKc0Rii8KsNUazw7kZgjxyGSPuOZ48058UVJUkkR21iD9JkHBGR rWiHPae8ZRPuBagh2H3qu7fxY5GxVDWayJUhUYkr9m%2FOW4UQVmXaQ9yn%2Fw2dCtzwAW0htPHYrKMyrT pMk%2BfDDmRflA%2FAMJhQ71yeyhufIA2PCJV8%2FCMOa46303A0WHhH0YPJ9%2FI0UeLVMWlJ1XcBo3Jr bRFvcowQwt0lP1XkoPmSLGpBevDE8%2FQ9WnxjPNDfrHnKgV2fp0hpMKVXNM%2BrLHNyMv3MkHg9iTMOD% 2FFYDAwSd%2B6%2FEOFo9UbdlKcmodJwjKlQoxZZIzmF8w%3D%3D Agent-Token An authorized token of current client obtained with AlipayHK. String Encrypt when message content needs to be encrypted. A key-value pairs string separated by commas (,), which keys and values are joined by equal signs (key=value). Valid keys include: String algorithm=RSA, keyVersion=1, symmetricKey=bqS8HSmdaRrpKSuPy7CqUlyd8lJurG93 Name Description Type Sample Request-Time The ISO-8601 datetime of this API request with timezone. String 2024-05-22T06:42:21+05:30 For URL data, perform URL encoding first before transmitting. Example: Before After https%3A%2F%2Fwww.merchant.com%2FauthorizationResult Please refer to the request basic headers for the general basic headers. Name Description Type Sample Response-Time The ISO-8601 datetime of this API response with timezone. String 2024-05-22T06:42:21+05:30 TracerId An unique system id for tracing. String 645864f51556420636666454470556 Name Description Type Sample result A metadata object indicates the result of the request. See example below. Name Description Type Sample resultCode The status code of this result, used for troubleshooting. String "SUCCESS" resultStatus The status of this request. String "S" resultMessage A description message of the result. String "success"1. Request
1.1 Basic Headers
General Headers
Request-only Headers
1.2 Basic Body
URL Encoding
2. Response
2.1 Basic Headers
Response-only Headers
2.2 Basic Body
Result
Example
{
"resultStatus": "S",
"resultCode":"SUCCESS",
"resultMsg": "success"
}