User
Get a Company by User ID
GET https://api-b2b.bigcommerce.com/api/v2/customers/{userId}/companiesRequest
Returns information for the Company account that corresponds to the provided user ID.
Equivalent Storefront GraphQL API Query: userCompany
. For more information, see the GraphQL Playground.
You must use the userId
value for the Company user to return the correct Company; the customerId
value of the corresponding BigCommerce customer account is not supported.
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- userId in path - stringrequiredThe unique ID for the customer account.
example
Response
Body
codenumber
Default: 200
dataobject
example
Get a Company User List
GET https://api-b2b.bigcommerce.com/api/v2/companies/{companyId}/usersRequest
Returns a list of users associated with a Company account.
Equivalent Storefront GraphQL API Query: users
. For more information, see the GraphQL Playground.
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- companyId in path - stringrequiredThe unique numeric ID of the Company account.
- role[] in query - stringThe ID of the role assigned to the Company user account as defined at Specifying User Role.
Allowed: 0 | 1 | 2
- limit in query with default of 10 - stringThe total number of items per page of the response.
- offset in query - stringThe number of items to skip before the current page of the response.
- q in query - stringThe search string for the request.
- minLastModifiedTime in query - stringThe earliest Unix timestamp for when the Company account was modified that can be returned.
- maxLastModifiedTime in query - stringThe latest Unix timestamp for when the Company account was modified that can be returned.
- minLastCreatedTime in query - stringThe earliest Unix timestamp for when the Company account was created that can be returned.
- maxLastCreatedTime in query - stringThe earliest Unix timestamp for when the Company account was created that can be returned.
example
Response
Body
codenumber
Default: 200
dataobject
example
Create a Company User
POST https://api-b2b.bigcommerce.com/api/v2/companies/{companyId}/usersRequest
Creates a user associated with a particular Company account.
Equivalent Storefront GraphQL API Mutation: userCreate
. For more information, see the GraphQL Playground.
If you enter an email address in the email
field that is associated with a BigCommerce customer account, and the customer account does not already have a corresponding Company user account, it will link the existing customer account with the new Company user. If the email is not associated with a customer account, a new one will be created with the Company user.
You can confirm if a particular email address is associated with a BigCommerce customer account by using the Validate a Frontend User Email endpoint.
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- companyId in path - stringrequiredThe unique numeric ID of the Company account.
Body
firstNamestring
requiredThe user's first name.Example: MarielastNamestring
requiredThe user's last name.Example: Curieemailstring
requiredThe email address associated with the user's account.Example: m.curie@greatbuys.comuserRolenumber
requiredThe ID of the role assigned to the Company user account as defined at Specifying User Role.Allowed: 0 | 1 | 2
Example: 1phonestring
requiredThe phone number associated with the user's account.Example: 8001234567
example
Response
Body
codenumber
Default: 200
dataobject
example
Check Existence of a Customer Email
GET https://api-b2b.bigcommerce.com/api/v2/users/validations/existenceRequest
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- storeHash in query - stringrequiredThe unique alphanumeric store hash for the BigCommerce store.
- email in query - stringrequiredThe email of the customer to be validated.
- extraFieldName in query - stringThe name of the extra field.
- extraFieldValue in query - stringThe value of the extra field.
example
Response
Body
codenumber
Default: 200
dataobject
SUCCESS
Get User List
GET https://api-b2b.bigcommerce.com/api/v2/usersRequest
Returns a list of a Company’s users by role.
Equivalent Storefront GraphQL API Query: users
. For more information, see the GraphQL Playground.
The role
parameter allows you to filter for users that have a predefined Company role. You can also view all users in a Company, or users with an unknown role.
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- q in query - stringThe search string for the request.
- role in query - stringrequired
The ID of the role assigned to the Company user account as given below.
Value Code 0 Admin 1 Senior Buyer 2 Junior Buyer 3 Super Admin 4 Unknown Allowed: 0 | 1 | 2 | 3 | 4
- limit in query with default of 10 - stringThe total number of items per page of the response.
- offset in query - stringThe number of items to skip before the current page of the response.
example
Response
Body
codenumber
Default: 200
dataobject
example
Create a User
POST https://api-b2b.bigcommerce.com/api/v2/usersRequest
Creates a new user in a Company account.
Equivalent Storefront GraphQL API Mutation: userCreate
. For more information, see the GraphQL Playground.
If you enter an email address in the email
field that is associated with a BigCommerce customer account, and the customer account does not already have a corresponding Company user account, it will link the existing customer account with the new Company user. If the email is not associated with a customer account, a new one will be created with the Company user.
This endpoint will send a welcome email to the new user as if they had created their account via the Storefront UI.
When you create an account this way, the user must reset their password to log in to the storefront unless they already have an existing BigCommerce customer account.
Authentication
- Authorization in header in the format of Bearer {{token}}
Body
firstNamestring
requiredThe user's first name.Example: MarielastNamestring
requiredThe user's last name.Example: Curieemailstring
requiredThe email address associated with the user's account.Example: m.curie@greatbuys.comcompanyIdstring
requiredUnique numeric ID of the Company account.Example: 123456phoneNumberstring
requiredThe phone number associated with the user's account.Example: 8001234567rolestring
requiredThe ID of the role assigned to the Company user account as defined at Specifying User Role.Allowed: 0 | 1 | 2
Example: 1
example
Response
Body
codenumber
Default: 200
dataobject
example
Get User Information
GET https://api-b2b.bigcommerce.com/api/v2/users/{userId}Request
Returns Company user information. The userId
parameter accepts both the Company user ID and the BigCommerce customer account ID.
Equivalent Storefront GraphQL API Query: user
. For more information, see the GraphQL Playground.
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- userId in path - stringrequiredThe unique ID for the customer account.
- isBcId in query - stringIndicates whether the
userId
parameter is the BigCommerce Customer ID. A value of1
indicates that it is.
example
Response
Body
codenumber
Default: 200
dataobject
example
Update User Information
PUT https://api-b2b.bigcommerce.com/api/v2/users/{userId}Request
Updates information about an existing Company user. The userId
parameter accepts both the Company user ID and the BigCommerce customer account ID.
Equivalent Storefront GraphQL API Mutation: userUpdate
. For more information, see the GraphQL Playground.
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- userId in path - stringrequiredThe unique ID for the customer account.
Body
firstNamestring
requiredThe user's first name.Example: MarielastNamestring
requiredThe user's last name.Example: Curieemailstring
requiredThe email address associated with the user's account.Example: m.curie@greatbuys.comphoneNumberstring
requiredThe phone number associated with the user's account.Example: 8001234567rolestring
requiredThe ID of the role assigned to the Company user account as defined at Specifying User Role.Allowed: 0 | 1 | 2
Example: 1
example
Response
Body
codenumber
Default: 200
dataobject
SUCCESS
Delete a User
DELETE https://api-b2b.bigcommerce.com/api/v2/users/{userId}Request
Deletes a Company user.
Equivalent Storefront GraphQL API Mutation: userDelete
. For more information, see the GraphQL Playground.
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- userId in path - stringrequiredThe unique ID for the customer account.
example
Response
Body
codenumber
Default: 200
dataobject