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

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

# Function: resolveToInternalRole()

> **resolveToInternalRole**(`role`, `mapping`): `string`

Defined in: [packages/b2c-tooling-sdk/src/clients/am-api.ts:148](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/e7c16f1ae423da0aa47b3e10be88f9770b53619b/packages/b2c-tooling-sdk/src/clients/am-api.ts#L148)

Resolves a role to its internal `roleEnumName` using an API-fetched role mapping.
Accepts either the role `id` (e.g., `bm-admin`) or `roleEnumName` (e.g., `ECOM_ADMIN`).
Falls back to a generic transform (uppercase + replace hyphens with underscores) for unknown roles.

## Parameters

### role

`string`

### mapping

[`RoleMapping`](../interfaces/RoleMapping.md)

## Returns

`string`
