Skip to main content
POST /v1/authorizations/cancelToken Cancels an access token at the wallet, revoking the authorization. After cancellation, the related refreshToken can no longer be used, even if it has not expired.

Request Parameters

Either accessToken or contractId must be provided (at least one is required).
string
The access token to cancel, obtained from applyToken. No special characters (@, #, ?).Max length: 128 characters
string
The agreement contract ID to cancel (agreement scenarios). Required if accessToken is not provided.
string
Extended information (JSON string). No special characters (@, #, ?). Key:
  • customerBelongsTo: the e-wallet the customer uses, corresponding to the siteName from my.getSiteInfo. Mandatory in the Mini Program scenario.
Max length: 4096 characters

Response Parameters

object
required
Standard result object with resultCode, resultStatus, resultMessage
string
Extended response information.Max length: 4096 characters

Result Handling

  • result.resultStatus is S: the authorization is cancelled. The accessToken can no longer be used to access the user’s resources, and the related refreshToken cannot be used to get a new access token.
  • result.resultStatus is F or U: cancellation failed. Guide the user to try again.

Result Codes

Sample

When the user cancels the authorization from the Mini Program, the merchant server calls /v1/authorizations/cancelToken and the wallet returns the result.

Request

Response