---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [clients](../index.md) / isInvalidScopeError

# Function: isInvalidScopeError()

> **isInvalidScopeError**(`error`): `boolean`

Defined in: [packages/b2c-tooling-sdk/src/clients/scapi-backend-utils.ts:84](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/2feab01f654eec77c6d702777ec2818472f131f1/packages/b2c-tooling-sdk/src/clients/scapi-backend-utils.ts#L84)

Detects an Account Manager `invalid_scope` error.

When a client's API client doesn't have the requested scope configured,
Account Manager returns `{"error":"invalid_scope", ...}` on the token
request. The OAuth strategy surfaces that as an Error whose message
contains `invalid_scope`.

Used by fallback wrappers to decide whether to downgrade to OCAPI.

## Parameters

### error

`unknown`

## Returns

`boolean`
