OAuth operations authenticated with the client's merchant access token.
Code exchange, refresh and revocation use application credentials instead. They live on SquareOAuthClient (createSquareOAuthClient).
createSquareOAuthClient
const square = createSquareClient({ accessToken: tenant.accessToken });const status = await square.oauth.tokenStatus(); Copy
const square = createSquareClient({ accessToken: tenant.accessToken });const status = await square.oauth.tokenStatus();
Get the scopes, expiry and merchant of this client's access token. Use it as a connection health check, or to confirm a required scope was granted.
Token status
If the token is invalid, expired or revoked
const { scopes, expiresAt } = await square.oauth.tokenStatus();if (!scopes.includes('MERCHANT_PROFILE_READ')) { // ask the seller to reconnect with the missing permission} Copy
const { scopes, expiresAt } = await square.oauth.tokenStatus();if (!scopes.includes('MERCHANT_PROFILE_READ')) { // ask the seller to reconnect with the missing permission}
OAuth operations authenticated with the client's merchant access token.
Code exchange, refresh and revocation use application credentials instead. They live on SquareOAuthClient (
createSquareOAuthClient).Example