POST /v1/authorizations/applyToken
Obtains access tokens. Supports two use cases:
- Authorization Code Exchange: Exchange an
authCodefor anaccessTokenfollowing Mini Program user authentication - Token Refresh: Use a
refreshTokento obtain a newaccessTokenindependently
Request Parameters
string
required
The type of token grant being requested.Possible values:
AUTHORIZATION_CODE— Exchange an auth code for tokensREFRESH_TOKEN— Refresh an expired access token
string
The authorization code received after user authorization.Required when:
grantType is AUTHORIZATION_CODEstring
The refresh token from a previous token response.Required when:
grantType is REFRESH_TOKENstring
Extended information for wallet and merchant configuration. Should include
customerBelongsTo field mapping to the wallet site name in Mini Program scenarios.Response Parameters
object
required
Standard result object with
resultCode, resultStatus, resultMessagestring
Token for accessing user resources within the authorized scope.
string
Access token expiration time in ISO 8601 format.
string
Token for obtaining new access tokens when the current one expires.
string
Refresh token expiration time. After this, the user must re-authorize.
string
Resource owner identifier.
string
Extended response information.