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

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

# Function: toOrganizationId()

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

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

Ensures a tenant ID has the required f_ecom_ prefix for use as an SCAPI organizationId.
If the value already has the prefix, it's returned as-is.

## Parameters

### tenantId

`string`

The tenant ID (e.g., "zzxy_prd" or "f_ecom_zzxy_prd")

## Returns

`string`

The organization ID with the f_ecom_ prefix (e.g., "f_ecom_zzxy_prd")

## Example

```ts
toOrganizationId('zzxy_prd')        // Returns 'f_ecom_zzxy_prd'
toOrganizationId('f_ecom_zzxy_prd') // Returns 'f_ecom_zzxy_prd' (unchanged)
```
