PHP 7.3 reaches end of support in December 2021 and Adobe Commerce 2.3.x reaches end of support in April 2022. You may want to consider planning your upgrade now to Adobe Commerce 2.4.x and PHP 7.4.x to help maintain PCI compliance.
Adobe Commerce only. Learn more.

Assign companies to a shared catalog

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 companies 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 companies 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\"]"