This is a beta release of documentation for Magento 2.4, published for previewing soon-to-be-released functionality. Content in this version is subject to change. Links to the v2.4 code base may not properly resolve until the code is officially released.

Assign companies to a shared catalog

Magento Commerce only

The content on this page is for Magento Commerce only. Learn more

A shared catalog must be assigned to one or more companies before it can be accessed by the company users.

Service name:

sharedCatalogCompanyManagementV1

REST endpoints:

1
2
3
POST /V1/sharedCatalog/:sharedCatalogId/assignCompanies
POST /V1/sharedCatalog/:sharedCatalogId/unassignCompanies
GET  /V1/sharedCatalog/:sharedCatalogId/companies

Company parameters:

Although you can specify other parameters defined within a categories object, the id is the only one used to assign or unassign a category to a shared catalog.

Name Description Format Requirements
id The company ID number integer Required to assign or unassign a company to a shared catalog

Assign categories to shared catalog

This action works as an update. It does not replace companies that have already been assigned.

If a specified company is already assigned to a different shared catalog, this request unassigns the company from the previous catalog and assigns to the new one.

Sample usage:

POST <host>/rest/<store_code>/V1/sharedCatalog/2/assignCompanies

Payload:

1
2
3
4
5
6
7
8
9
10
{
  "companies": [
    {
      "id": 1
    },
    {
      "id": 2
    }
  ]
}

Response:

true, indicating the operation was successful

Unassign categories from a shared catalog

When you unassign a company from a custom catalog, the system automatically assigns this company to the public shared catalog. You cannot unassign a company from the public catalog.

Sample usage:

POST <host>/rest/<store_code>/V1/sharedCatalog/2/unassignCompanies

Payload:

1
2
3
4
5
6
7
{
  "companies": [
    {
      "id": 2
    }
  ]
}

Response:

true, indicating the operation was successful

List the shared catalog companies

The GET call returns an array of company IDs.

Sample Usage:

GET <host>/rest/<store_code>/V1/sharedCatalog/2/companies

Payload:

Not applicable

Response:

"[\"1\",\"2\"]"