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

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

# Function: fetchRoleMapping()

> **fetchRoleMapping**(`rolesClient`): `Promise`\<[`RoleMapping`](../interfaces/RoleMapping.md)\>

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

Fetches all roles from the Account Manager roles API and builds a mapping
between role `id` and `roleEnumName`.

## Parameters

### rolesClient

[`AccountManagerRolesClient`](../type-aliases/AccountManagerRolesClient.md)

Account Manager Roles client

## Returns

`Promise`\<[`RoleMapping`](../interfaces/RoleMapping.md)\>

Role mapping
