For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dev Portal
DocsAPI ReferenceLearnCommunityChangelog
DocsAPI ReferenceLearnCommunityChangelog
    • About Our APIs
  • REST
    • Overview
      • Overview
      • Storefront
      • Management
        • Overview
          • Addresses
          • Authentication
          • Channels
          • Company
              • GETList Company Subsidiaries
              • DELDelete Company Subsidiary
              • POSTAttach Company as The Parent of Current Company
              • GETList Company Hierarchy
            • Companies
          • Invoice Management
          • Orders
          • Payment
          • Quotes
          • Sales Staff
          • Shopping List
          • Super Admin
          • Users
  • GraphQL
    • Overview
  • MCP
    • Overview
Dev Portal
LogoLogo
RESTB2BManagementCompanyAccount Hierarchies

Attach Company as The Parent of Current Company

POST
https://api-b2b.bigcommerce.com/api/v3/io/companies/:companyId/parent
POST
/api/v3/io/companies/:companyId/parent
$curl -X POST https://api-b2b.bigcommerce.com/api/v3/io/companies/123456/parent \
> -H "X-Auth-Token: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "parentCompanyId": 654321
>}'
1{
2 "meta": {
3 "message": "SUCCESS"
4 },
5 "data": []
6}
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*.
Was this page helpful?
Previous

Delete Company Subsidiary

Next

List Company Hierarchy

Built with

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

X-Auth-Tokenstring
HeaderArgumentDescription
X-Auth-Tokenaccess_tokenFor more about API accounts that generate access_tokens, see our Guide to API Accounts.

For example requests and more information about authenticating BigCommerce APIs, see Authentication and Example Requests.

For more about BigCommerce OAuth scopes, see our Guide to API Accounts.

For a list of API status codes, see API Status Codes.

X-Store-Hashstring
HeaderArgumentDescription
X-Store-Hashstore_hashThe unique store hash associated with a BigCommerce store that has B2B Edition enabled.

Path parameters

companyIdintegerRequired
Unique numeric ID of the Company account.

Request

This endpoint expects an object.
parentCompanyIdintegerRequired

Unique 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.

Response

OK
metaobject

Errors

400
Bad Request Error