REST API - Company Management
REST API - Company Management
REST API - Company Management
Example request:
Example request:
Example body:
You will need to know the companyId, which can be found by running a GET all companies request. You will also need to know the account’s new status and the correct status code which can be found below:
Example request:
Example body:
Required fields:
companyNamecompanyPhonecompanyEmailcountry - full name of the country or ISO2 country codeadminFirstNameadminLastNameadminEmailYou can use the customerGroupId field to assign a customer group to the new company. If the customerGroupId field is not provided, the company will be associated with the default customer group you have configured. If there is no default customer group, the customerGroupId value will be set to 0 and the company will not be associated with any customer group.
There are more fields that can be filled in when creating a company account if you have the correct information, see B2B Edition Create a Company reference.
You can also create multiple companies in one API call by using the bulk endpoint. For more information, see the B2B Edition Bulk Company Creation API reference.
If you are on an older version of B2B Edition, Companies will already have an assigned customerGroupId.
Example request:
Example body:
The request will return a confirmation of the companyId.
The following request will return a list of addresses.
Example request:
This request can be filtered to narrow the results. The following filters are applicable for this request:
companyIdisBillingisShippingaddresscitystatecountryzipcodeThe query below is an example of how you can filter a list of addresses by companyId and shipping address.
Example request:
The following request will create a new address.
Example request:
For the request body, there are several fields required to create a new address such as:
addressLine1cityfirstNamelastNamecompanyIdcountryNamecountryCodeBelow is an example of the request body. You will need to include company-specific information for each of the required fields.
Example body:
The following request URL will return a list of users that have accounts on your B2B Edition storefront.
Example request:
This is another request that allows you to use filters to narrow the results. Some common filters include:
companyIdroles: 0 = admin user, 1 = senior buyer, 2 = junior buyerThe example below shows a request URL for company users for a specific company.
Example request:
The following request URL can be used to create a new user. If the user is an existing BigCommerce customer, the customer group, company, and name will be overridden.
Example request:
The required fields for the request body include:
companyIdemailfirstNamelastNamerole: 0 = admin, 1 = senior buyer, 2 = junior buyercompanyRoleIdWhile the role field utilizes static integer values, the companyRoleId field supports all possible roles, expecting an ID value corresponding to a role. The built-in Admin, Senior Buyer, and Junior Buyer roles also have IDs compatible with companyRoleId as well, so it’s possible to use this field instead of role to manage built-in roles. You can find role IDs with the Company Roles endpoint.
Example using companyRoleId:
B2B Edition company accounts are the source of truth for defining a company user’s customer group assignment. If there is no default customer group, the company will not be associated with any customer group.
Company users can also be created in bulk when needed. See the Bulk User Creation API reference for more information.