Create a Company user within an existing Company.
With [Independent Company behavior](/developer/api-reference/rest/b2b/management/company/companies#independent-vs-dependent-companies-behavior) enabled, B2B Edition Company accounts are the source of truth for defining a Company user’s customer group assignment.
On stores without Independent Company behavior, each Company account has a one-to-one relationship with its customer group.
If no default customer group is configured, or the set value of `customerGroupId` is 0, the B2B Company will not be associated with any customer group. The Company users will have their corresponding customer records assigned to No Group in BigCommerce.
Authentication
X-Auth-Tokenstring
### Authentication header
| Header | Argument | Description |
|:-------|:---------|:------------|
| `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts). |
### Further reading
For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts#x-auth-token-header-example-requests).
For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#oauth-scopes).
For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).
X-Store-Hashstring
### Authentication header
| Header | Argument | Description |
|:-------|:---------|:------------|
| `X-Store-Hash` | `store_hash` | The unique store hash associated with a BigCommerce store that has B2B Edition enabled. |
Request
This endpoint expects an object.
channelIdslist of integersRequired
List of numeric channel IDs the user is associated with. These represent the storefront channels the user can log in to and do business.
acceptWelcomeEmailbooleanOptional
Indicates whether the user will receive a welcome email when the account is created.
companyIdintegerOptional
The unique numeric ID associated with the user's B2B Edition Company account.
companyRoleIdintegerOptional
Numeric code representing the user’s Company-specific role. When present this field overrides the value of the role field.
emailstringOptionalformat: "email"
User's email address. This must be unique within B2B Edition.
extraFieldslist of objectsOptional
firstNamestringOptional
User's first name.
lastNamestringOptional
User's last name.
originChannelIdintegerOptional
The ID of the originating channel. A value of 0 will unset the user’s origin channel, which may result in unexpected behavior. To avoid errors, ensure all necessary channels are included in channelIds.
phoneNumberstringOptional
User's phone number.
roleenumOptional
Numeric code representing the user’s role as admin (0), senior buyer (1), or junior buyer (2).
Allowed values:
uuidstringOptional
External identifier for the user. This field may be used to represent any external user ID. Using the name uuid, B2B Edition does not require the field to be unique.
Response
SUCCESS
codeintegerDefaults to 200
Operation status code.
dataobject
metaobject
Errors
422
Unprocessable Entity Error
Create a Company user within an existing Company.
With Independent Company behavior enabled, B2B Edition Company accounts are the source of truth for defining a Company user’s customer group assignment.
On stores without Independent Company behavior, each Company account has a one-to-one relationship with its customer group.
If no default customer group is configured, or the set value of customerGroupId is 0, the B2B Company will not be associated with any customer group. The Company users will have their corresponding customer records assigned to No Group in BigCommerce.
Authentication header
Header
Argument
Description
X-Auth-Token
access_token
For more about API accounts that generate access_tokens, see our Guide to API Accounts.