Alipay Mini Program Login
Call this API when logging in with an Alipay Mini Program.
Request Description
POST https://{your_domain}/api/v2/sdk/login/alipay-miniprogram
Request Headers
| Parameter Name | Name | Required | Type | Example |
|---|---|---|---|---|
| X-operating-sys-version | Caller client OS version | Yes | String | windows10.1.1 |
| X-device-fingerprint | Caller client device fingerprint | Yes | String | 156aysdna213sc50 |
| X-device-ip | Caller client IP | No | String | 192.168.1.2 |
| X-agent | User-Agent information | Yes | String | Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) |
| X-L | Used for international language settings | No | String | zh |
| X-client-id | Application authorization ID | Yes | String | nTo1eRIub60vPb54WeE6aojPwYwImtl4 |
| content-type | Content format type | Yes | String | application/json |
Request Example
json
{
"code":" 091zQTFa1i6qMC02AWFa1Vzt0O0zQTF8"
}Request Parameters
| Parameter Name | Name | Required | Type | Description |
|---|---|---|---|---|
| code | Alipay Mini Program login code | Yes | String | Login code returned by Alipay Mini Program login |
Response Examples
Success Example 1 (Successful user match returns session_token)
HTTP/1.1 200 OK
json
{
"session_token": "btsiBjx85prcZu6I6Ki057Tmw3nSF2VO",
"expire": 432000,
"status": "SUCCESS"
}Success Example 2 (Returns auto-registration and binding flow)
HTTP/1.1 200 OK
json
{
"state_token": "eyJhbGcCJ9.eyJzdWMCJ9…tL2VPS8",
"data": "{\"socialBindOrRegisterFlow\":[\"VERIFY_PHONE\",\"VERIFY_EMAIL\"]}",
"status": "USER_REGISTER"
}Success Example 3 (Returns binding flow)
HTTP/1.1 200 OK
json
{
"state_token": "eyJhbGcCJ9.eyJzdWMCJ9…tL2VPS8",
"data": "{\"socialBindOrRegisterFlow\":[\"VERIFY_PHONE\",\"VERIFY_EMAIL\"]}",
"status": " SOCIAL_BIND"
}Response Parameters
| Parameter Name | Name | Type | Description |
|---|---|---|---|
| status | Login flow status identifier | String | SUCCES: Login successful SOCIAL_BIND: Binding flow USER_REGISTER: Auto-registration and binding flow ACCESS_DENIED: Access denied MFA_AUTH: Secondary authentication |
| expire | session_token validity period | Number | session_token validity period |
| session_token | User session_token | String | User session_token |
| data | Return description | String | Tenant social registration and binding flow configuration information. The socialBindOrRegisterFlow field contains the verification methods supported by the tenant.VERIFY_PHONE: Mobile number + SMS verification code VERIFY_EMAIL: Email + email verification code |
| state_token | Login state token | String | Token with state, used in the flow of binding Alipay useid to the user's mobile number or username |