Skip to main content
POST /v1/authorizations/applyToken Obtains access tokens. Supports two use cases:
  1. Authorization Code Exchange: Exchange an authCode for an accessToken following Mini Program user authentication
  2. Token Refresh: Use a refreshToken to obtain a new accessToken independently

Request Parameters

string
required
The type of token grant being requested.Possible values:
  • AUTHORIZATION_CODE — Exchange an auth code for tokens
  • REFRESH_TOKEN — Refresh an expired access token
string
The authorization code received after user authorization.Required when: grantType is AUTHORIZATION_CODE
string
The refresh token from a previous token response.Required when: grantType is REFRESH_TOKEN
string
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, resultMessage
string
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.

Result Codes