Companies
Create a Company
POST https://api-b2b.bigcommerce.com/api/v2/frontend/companiesRequest
Submit a Business Account application on the storefront to create a Company account in the Pending status. This is an anonymous operation which does not require a storefront authToken for a particular customer.
Equivalent Storefront GraphQL API Mutation: companyCreate
. For more information, see the GraphQL Playground.
If you have configured required information fields in your store’s Extra Fields settings for Company accounts or Company users, you must include the field’s name and value in the extraFields
array of the request body. For more information on extra fields, see B2B Edition Settings in the Help Center.
Authentication
- Authorization in header in the format of Bearer {{token}}
Body
companyNamestring
requiredThe name of the business associated with the Company account.Example: Great BuyscompanyPhoneNumberstring
requiredThe primary phone number for the Company account.Example: 1234567890companyFirstNamestring
requiredThe first name of the Company account administrator.Example: RobertcompanyLastNamestring
requiredThe last name of the Company account administrator.Example: RobertsoncustomerIdstring
requiredThe ID of the BigCommerce customer account for the Company account administrator.storeHashstring
requiredThe unique store hash for the BigCommerce store.Example: abc123companyEmailstring
requiredThe primary email address of the company.Example: user@example.comaddressLine1string
requiredThe first line of the addressExample: 11305 Four Points DriveaddressLine2string
requiredThe second line of the addressExample: Building 2citystring
requiredCity of the address.Example: AustinzipCodestring
requiredZip or Postal Code of the address.Example: 78726statestring
requiredState of the address.Example: Texascountrystring
requiredCountry of the address.Example: United StatesextraFieldsarray[object]
example
Response
Body
codenumber
Default: 200
dataobject
example
Get Company Extra Fields
GET https://api-b2b.bigcommerce.com/api/v2/companies/extra-fields/storefrontRequest
Returns a list of available extra fields for Company accounts.
Equivalent Storefront GraphQL API Query: companyExtraFields
. For more information, see the GraphQL Playground.
This request will only return Company extra fields that are configured to be visible on the storefront.
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- storeHash in query - stringrequiredThe unique alphanumeric store hash for the BigCommerce store.
example
Response
Body
dataarray[object]
codenumber
Default: 200
example
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
Validate a Frontend User Email
GET https://api-b2b.bigcommerce.com/api/v2/companies/validations/frontend/user-emails/{email}Request
Checks if an email address is associated with a BigCommerce customer account and a Company user account.
Equivalent Storefront GraphQL API Query: userEmailCheck
. For more information, see the GraphQL Playground.
The isValid
value in the response indicates whether or not the email address is used by an existing customer or Company user. The following values are possible:
0
— The email address is associated with a Company user account and a corresponding customer account.1
— The email address is not associated with a customer account or a Company user account.2
— The email address is associated with a customer account, but not a Company user account.
Authentication
- Authorization in header in the format of Bearer {{token}}
Parameters
- email in path - stringrequiredThe email address of the user to be validated.Example: user@example.com
- storeHash in query - stringrequiredThe unique alphanumeric store hash for the BigCommerce store.
- 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
- companyId in query - stringThe unique numeric ID of the Company account.
example
Response
Body
codenumber
Default: 200
dataobject