Create legacy catalogs

The administration interface supports creating independent catalogs only.

If you want to create legacy catalogs, you must use the Admin API. You can then edit these catalogs using either the Admin API or the administration interface.

This section explains how to create legacy catalogs using the Admin API. For information about editing legacy catalogs in the administration interface, see Work with legacy catalogs. For additional information about creating and editing legacy catalogs using the Admin API, see the REST API documentation in the Oracle Help Center.

Note: You can also create new legacy catalogs by using the CSV import feature. However, you must first use the API to enable support for them. See Enable support for legacy catalogs for more information. See Import catalog items and inventory to learn how to create legacy catalogs by importing.

Enable support for legacy catalogs

Before you can create legacy catalogs, you must enable support for creating them. To do this, you use the saveAdminConfiguration endpoint in the Admin API to set the value of the supportVersion1Catalogs property. If your Commerce environment has any legacy catalogs, the value of this property defaults to true, and an error is returned if you attempt to set it to false. If your Commerce environment does not have any legacy catalogs, the value of this property defaults to false, but you are free to change the value to true. The following example enables support for legacy catalogs:

PUT /ccadmin/v1/merchant/adminConfiguration  HTTP/1.1
Authorization: Bearer <access_token>
Content-Type: application/json

{
    "supportVersion1Catalogs": true
}

Create a legacy catalog

To create a catalog, you can use the createCatalog endpoint in the Admin API. The value of the supportVersion1Catalogs property determines whether an independent catalog or a legacy catalog is created:

  • If supportVersion1Catalogs is true, the createCatalog endpoint creates a legacy catalog by default. You can override the default behavior and create an independent catalog by setting the value of the catalogVersion property to 2.
  • If supportVersion1Catalogs is false, the createCatalog endpoint can create only independent catalogs. If you attempt to set the value of the catalogVersion to 1 to create a legacy catalog, the call returns an error.

The following example uses the createCatalog endpoint to create a legacy catalog:

POST /ccadmin/v1/catalogs  HTTP/1.1
Content-Type: application/json
x-ccasset-language: en

{
  "catalogVersion": 1,
  "defaultCategoryForProducts": "cat88975",
  "categoryIds": [
    "cat40013"
  ],
  "catalogId": "catalogGroceries",
  "displayName": "Groceries"
}

The response returns the properties of the catalog:

{
    "catalogVersion": 1,
    "defaultCategoryForProducts": "cat88975",
    "rootNavigationCategory": {
        "repositoryId": "rootCategory"
    },
    "displayName": "Groceries",
    "repositoryId": "catalogGroceries",
    "rootCategories": [
        {
            "repositoryId": "cat40013"
        }
    ],
    "links": [
        {
            "rel": "self",
            "href": "http://myserver.example.com:9080/ccadmin/v1/catalogs"
        }
    ],
    "id": "catalogGroceries"
}

After creating a catalog, you must publish your changes to make it available to use on your sites. See Publish Changes for more information.