v1

latestOpenAPI 3.0.0Apache 2.02026-07-143281,4552.1 MB
OAuth

RevokeToken

Revokes an access token generated with the OAuth flow.

If an account has more than one OAuth access token for your application, this endpoint revokes all of them, regardless of which token you specify.

Important: The Authorization header for this endpoint must have the following format:

Authorization: Client APPLICATION_SECRET

Replace APPLICATION_SECRET with the application secret on the OAuth page for your application in the Developer Dashboard.

post/oauth2/revoke

Request body

client_idstring nullable

The Square-issued ID for your application, which is available on the OAuth page in the Developer Dashboard.

access_tokenstring nullable

The access token of the merchant whose token you want to revoke. Do not provide a value for merchant_id if you provide this parameter.

merchant_idstring nullable

The ID of the merchant whose token you want to revoke. Do not provide a value for access_token if you provide this parameter.

revoke_only_access_tokenboolean nullable

If true, terminate the given single access token, but do not terminate the entire authorization. Default: false

Example request

{
  "access_token": "ACCESS_TOKEN",
  "client_id": "CLIENT_ID"
}

Response

Success

successboolean

If the request is successful, this is true.

Example response

{
  "success": true
}