Request for authorization URL
Use this interface to request the authorization URL for users to start authorizing with us.
Headers of this API are included in the HTTP body instead of the HTTP headers. |
Request Headers
Please check API Structure for basics.
The value of header function
is alipay.intl.oauth.auth.prepareForRedirect
.
Response Headers
Please check API Structure for basics.
Request parameters
authMerchantId string REQUIRED
The ID of merchant who wants to grant user authorization.
authSite string REQUIRED
The wallet which merchant wants to grant user authorization.
Valid values:
ALIPAY_HK
merchantRedirectUrl string REQUIRED
If provided, this url to redirect after user authorization, otherwise the default url configured with AlipayHK will be used.
The authorization code will parsed as parameter in the redirect url, example:
redirectURL | Redirect from AlipayHK |
https://www.alipayhk.com | https://www.alipayhk.com?authCode=1234&authResult=SUCCESS |
https://www.alipayhk.com?bar=foo | https://www.alipayhk.com?bar=foo&authCode=1234&authResult=SUCCESS |
authResult | Explanation |
SUCCESS | Authorization is successful, authCode should be returned. |
FAIL | Authorization failed, please retry again. |
ERROR | System error, i.e. timeout, unknown exception, please check with support. |
More information:
- Maximum length: 512 characters
scopes Array<string> REQUIRED
The scopes of the user authorization merchant wants to obtain.
["USER_POINTS"]
terminalType string REQUIRED
A string value Indicates the source terminal type and how the redirect will happen.
WAP
Response parameters
authSiteUrl string REQUIRED
The authorization URL to use for this flow.
resultInfo ResultInfo REQUIRED
A metadata object indicates the result of the request.
Request
Response
Result/Error codes
Code | Value | Message |
---|---|---|
SUCCESS | S | Success |
INVALID_SIGNATURE | F | Signature is invalid, verify the signature with the signing keys configured. |
OAUTH_FAILED | F | OAuth authentication failed, please retry. |
PARAM_ILLEGAL | F | Request is invalid, usually missing parameters. |
PROCESS_FAIL | F | General business failure, please check with support. |
UNKNOWN_EXCEPTION | F | Unknown exception, please check with support. |