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

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

# Function: buildTenantScope()

> **buildTenantScope**(`tenantId`): `string`

Defined in: [packages/b2c-tooling-sdk/src/clients/custom-apis.ts:236](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/e7c16f1ae423da0aa47b3e10be88f9770b53619b/packages/b2c-tooling-sdk/src/clients/custom-apis.ts#L236)

Builds the tenant-specific OAuth scope required for SCAPI APIs.

## Parameters

### tenantId

`string`

The tenant ID (with or without f_ecom_ prefix)

## Returns

`string`

The tenant-specific scope (e.g., "SALESFORCE_COMMERCE_API:zzxy_prd")

## Example

```ts
buildTenantScope('zzxy_prd')        // Returns 'SALESFORCE_COMMERCE_API:zzxy_prd'
buildTenantScope('f_ecom_zzxy_prd') // Returns 'SALESFORCE_COMMERCE_API:zzxy_prd'
```
