Edit in GitHubLog an issue
Adobe Commerce only. Learn more

Manage company structures

B2B for Adobe Commerce allows company users to be assigned to company teams and hierarchies.

Manage company teams

Company teams allow you to group company users by location, job responsibilities, or any criteria you choose. You can assign individual company users to a team with the company hierarchy endpoints.

Service name:

companyTeamRepositoryV1

REST Endpoints:

Copied to your clipboard
POST /V1/team/:companyId
PUT /V1/team/:teamId
GET /V1/team/:teamId
DELETE /V1/team/:teamId
GET /V1/team/

Company team parameters:

NameDescriptionFormatRequirements
id
System-generated team ID
integer
Not applicable for create operations.
name
The displayed name of the team
string
Required to create or update a team.
description
An optional description of the team.
string
Optional

Create a team

A newly-created team is placed under Company Admin in the company hierarchy.

Sample Usage:

POST <host>/rest/<store_code>/V1/team/2

Copied to your clipboard
{
"team": {
"name": "Western District",
"description": "Buyers from the California office"
}
}

Update a team

You can only change the name or description of a team.

Sample Usage:

PUT <host>/rest/<store_code>/V1/team/4

Copied to your clipboard
{
"team": {
"id": 4,
"name": "Western Region"
}
}

Return all information about a team

The GET call returns the team id, name, and description.

Sample Usage:

GET <host>/rest/<store_code>/V1/team/4

Copied to your clipboard
// Not applicable

Delete a team

You cannot delete a team if members are assigned to it.

Sample Usage:

DELETE <host>/rest/<store_code>/V1/team/4

Copied to your clipboard
// Not applicable

Search for a team

The following query returns information about all teams (team_id0)

See Search using REST APIs for information about constructing a search query.

Sample Usage:

GET <host>/rest/<store_code>/V1/team?searchCriteria[filter_groups][0][filters][0][field]=team_id&searchCriteria[filter_groups][0][filters][0][value]=0&searchCriteria[filter_groups][0][filters][0][condition_type]=gteq

Copied to your clipboard
// Not applicable

Company hierarchies

In the B2B storefront, a buyer can view the company structure represented as a hierarchy tree. The tree can display multiple levels of company subdivisions (teams) as well as company users. The company hierarchy can have any number of items and levels.

You can use REST endpoints to retrieve the current structure and move teams and buyers within the hierarchy. You cannot delete teams or buyers.

Service name:

companyHierarchyV1

REST Endpoints:

Copied to your clipboard
GET /V1/hierarchy/:id
PUT /V1/hierarchy/move/:id

Return all information about the company hierarchy

In the following example, the following company hierarchy has already been established:

Copied to your clipboard
Admin (structure_id = 2)
|-- East (team, structure_id = 8)
| |-- Bryce Martin (customer, structure_id = 4)
| |-- Melanie Shaw (customer, structure_id = 3)
|
|-- West (team, structure_id = 7)
| |-- Marcus Thomas (customer, structure_id = 6)
| |-- Teresa Gomez (customer, structure_id = 5)

Sample Usage:

GET <host>/rest/<store_code>/V1/hierarchy/2

Copied to your clipboard
// Not applicable

Assign a new parent to teams and company users

The following example moves Bryce Martin (structure_id = 4) to the West team (structure_id = 7)

Sample Usage:

PUT <host>/rest/<store_code>/V1/hierarchy/move/5

Copied to your clipboard
{
"newParentId": 7
}
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.