data-src=../../includes/commerce-only.md

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:

POST /V1/sharedCatalog/:sharedCatalogId/assignCompanies
POST /V1/sharedCatalog/:sharedCatalogId/unassignCompanies
GET  /V1/sharedCatalog/:sharedCatalogId/companies

Company parameters:

data-variant=info
data-slots=text
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

data-slots=heading, code
data-repeat=2
data-languages=JSON, JSON

Payload

{
  "companies": [
    {
      "id": 1
    },
    {
      "id": 2
    }
  ]
}

Response

// `true`, indicating the request 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

data-slots=heading, code
data-repeat=2
data-languages=JSON, JSON

Payload

{
  "companies": [
    {
      "id": 2
    }
  ]
}

Response

// `true`, indicating the request 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

data-slots=heading, code
data-repeat=2
data-languages=JSON, JSON

Payload

// Not applicable

Response

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