Account Hierarchies
Get Company Subsidiaries
GET https://api-b2b.bigcommerce.com/api/v3/io/companies/{companyId}/subsidiariesRequest
Authentication
- authToken in header
Parameters
- companyId in path - integerrequiredUnique numeric ID of the Company account.
- offset in query0 - integerThe number of results to skip before returning the first result. If left blank, this defaults to
0
. - limit in query with default of 10 - integerDetermines the number of records to return per page. If left blank, this defaults to
10
.
example
Response
OK
The subsidiaries
array in the response includes nested subsidiaries
arrays if a child account has its own subsidiaries.
The array also includes nested subsidiaries
arrays for each Company with its own subsidiaries. For example, if the Company in question is above 2 layers of Account Hierarchy, its direct subsidiaries will also include subsidiaries
arrays for their child accounts.
Body
dataarray[object]
Example 1
Example 2
Delete Company Subsidiary
DELETE https://api-b2b.bigcommerce.com/api/v3/io/companies/{companyId}/subsidiaries/{childCompanyId}Request
Removes the parent-child relationship between a specified subsidiary account and its parent Company.
If the deleted subsidiary has its own subsidiary companies, this request will create a separate hierarchy with the deleted subsidiary at the top.
Authentication
- authToken in header
Parameters
- companyId in path - integerrequiredUnique numeric ID of the Company account.
- childCompanyId in path - integerrequiredThe ID of a Company account assigned as a subsidiary to the Company in question.
example
Response
Attach a Company as the Parent of a Current Company
POST https://api-b2b.bigcommerce.com/api/v3/io/companies/{companyId}/parentRequest
Assigns the Company account as the parent of a specific Company. Note that you cannot assign a Company as the parent of another Company which is already in a higher hierarchy level.
For example, if you have a client with local, national, and regional branches, their Company Account Hierarchy might look like this:
- Americas
|- North America
| |- Canada
| |- United States
|- South America
| |- Brazil
You cannot assign United States as a parent of North America, since the parent Company for United States is also a subsidiary of North America.
Authentication
- authToken in header
Parameters
- companyId in path - integerrequiredUnique numeric ID of the Company account.
Body
parentCompanyIdinteger
requiredUnique numeric ID of the parent Company account. This is a read-only field; do not set or modify its value in a POST or PUT request.Example: 654321
example
Response
Body
success
Get Company Hierarchy
GET https://api-b2b.bigcommerce.com/api/v3/io/companies/{companyId}/hierarchyRequest
Returns all parent and child accounts in the hierarchy of a particular Company.
The default rate limit for this endpoint is 15
calls/min per store.
Authentication
- authToken in header
Parameters
- companyId in path - integerrequiredUnique numeric ID of the Company account.
- offset in query0 - integerThe number of results to skip before returning the first result. If left blank, this defaults to
0
. - limit in query with default of 10 - integerDetermines the number of records to return per page. If left blank, this defaults to
10
.
example
Response
Body
dataarray[object]