---
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:124](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/e7c16f1ae423da0aa47b3e10be88f9770b53619b/packages/b2c-tooling-sdk/src/clients/am-api.ts#L124)

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
