createCatalog
post
/ccadmin/v1/catalogs
Create Catalog. Create a catalog based on request parameters. **Requires the x-ccasset-language header so translated content can be set for a specific language.**
Commerce Cloud lets you create three types of catalogs:
* Independent catalogs are catalogs that are not dependent on any other catalog in your environment. Collections and products you add to an independent catalog can be exclusive to that catalog, or can be linked to a number of different catalogs. The Product Catalog that Commerce Cloud includes by default is structured as an independent catalog.
* Filtered View catalogs are catalogs that reference an independent catalog as a base for their collection hierarchy but can have their own product membership which will be a subset of the base catalog's set of products.
* Legacy catalogs are secondary catalogs that provide custom views into the Product Catalog. Unlike independent catalogs, which can contain different collections and products, legacy catalogs reference only products and collections that are already in the Product Catalog. Prior to 18D release, all additional catalogs created in Commerce Cloud were legacy catalogs. If you upgraded to this release from Commerce Cloud 18C-MP or earlier, any additional catalogs you already created in previous releases remain in your instance as legacy catalogs.
Before you can create legacy catalogs, you must enable support for creating them. To do this, you use the **saveAdminConfiguration** in the Admin REST API to set the value of the supportVersion1Catalogs property.
If your Commerce Cloud environment has any legacy catalogs, the value of supportVersion1Catalogs property defaults to true. If your Commerce Cloud 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.
* If supportVersion1Catalogs is false, the createCatalog endpoint can create only independent catalogs. If you attempt to set catalogVersion to 1 to create a legacy catalog, the call returns an error.
* 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 catalogVersion property to 2.
Refer to Manage Your Catalog section in the Using Oracle Commerce Cloud documentation for additional details about creating Independent and Legacy catalogs.
Request
Supported Media Types
- application/json
Header Parameters
-
X-CCAsset-Language: string
The asset language of the request
Root Schema : createCatalog_request
Type:
Show Source
object
-
baseCatalog(optional):
object baseCatalog
(Only used for filtered view catalogs) This references the independent catalog that will be the base catalog for the filtered view.
-
catalogId:
string
ID of the catalog.
-
catalogVersion(optional):
integer
Type of catalog to create. 1 = legacy catalog (only allowed if legacy catalog support is enabled), 2 = new style catalog, 3 = filtered view catalog.
-
categoryIds(optional):
array categoryIds
(Not used for filtered view catalogs) List of category ids to be associated with this catalog. Categories are set as children of the root navigation category.
-
defaultCategoryForProducts(optional):
string
Default category parent to link to new products created in this catalog if no other parents are specified.
-
displayName:
string
display name of the catalog.
Example:
{
"catalogVersion":"2",
"defaultCategoryForProducts":"defaultAppleCategory",
"categoryIds":[
"defaultAppleCategory"
],
"catalogId":"appleCatalog",
"displayName":"Apple Catalog"
}
Nested Schema : baseCatalog
Type:
object
(Only used for filtered view catalogs) This references the independent catalog that will be the base catalog for the filtered view.
Show Source
-
catalogVersion(optional):
integer
Type of base catalog. For base catalog this will always be 2 - independent catalog.
-
defaultCategoryForProducts(optional):
string
Default category parent to link to new products created in this base catalog if no other parents are specified.
-
displayName(optional):
string
Display name of the base catalog.
-
repositoryId(optional):
string
Repository ID.
-
rootCategories(optional):
array rootCategories
Array of root categories of the base catalog
- rootNavigationCategory(optional): object rootNavigationCategory
Nested Schema : categoryIds
Type:
array
(Not used for filtered view catalogs) List of category ids to be associated with this catalog. Categories are set as children of the root navigation category.
Show Source
Nested Schema : items
Type:
Show Source
object
-
repositoryId(optional):
string
Repository id of category/collection
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Root Schema : createCatalog_response
Type:
Show Source
object
-
baseCatalog(optional):
object baseCatalog
(Only present for filtered view catalogs) This references the independent catalog that is the base catalog for the filtered view.
-
catalogVersion(optional):
integer
Type of catalog. 1 = legacy catalog, 2 = new style catalog, 3 = filtered view catalog.
-
defaultCategoryForProducts(optional):
string
Default category to link to new products created in this catalog if no other parents are specified. If it is not set then the new products would instead be created unassigned.
-
displayName(optional):
string
Display name of the catalog.
-
id(optional):
string
Catalog ID.
-
repositoryId(optional):
string
Repository ID.
-
rootCategories(optional):
array rootCategories
Array of categories associated with the catalog.
- rootNavigationCategory(optional): object rootNavigationCategory
Nested Schema : baseCatalog
Type:
object
(Only present for filtered view catalogs) This references the independent catalog that is the base catalog for the filtered view.
Show Source
-
catalogVersion(optional):
integer
Type of base catalog. For base catalog this will always be 2 - independent catalog.
-
defaultCategoryForProducts(optional):
string
Default category parent to link to new products created in this base catalog if no other parents are specified.
-
displayName(optional):
string
Display name of the base catalog.
-
repositoryId(optional):
string
Repository ID.
-
rootCategories(optional):
array rootCategories
Array of root categories of the base catalog
- rootNavigationCategory(optional): object rootNavigationCategory
Nested Schema : rootCategories
Type:
array
Array of categories associated with the catalog.
Show Source
Nested Schema : items
Type:
Show Source
object
-
repositoryId(optional):
string
Repository id of category/collection
Nested Schema : items
Type:
Show Source
object
-
repositoryId(optional):
string
Repository id of category/collection
Example Response (application/json)
{
"catalogVersion":2,
"defaultCategoryForProducts":"appleDefaultCategory",
"rootNavigationCategory":"cat10098",
"displayName":"Apple Catalog",
"repositoryId":"appleCatalog",
"rootCategories":[
{
"repositoryId":"cat10098"
},
{
"repositoryId":"cat10099"
}
],
"id":"appleCatalog"
}
Default Response
The error response.
The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud:
|Error Code|Description|
|------------------|------------------|
|200100|Catalog name missing.|
|200102|Catalog repository error.|
|200101|Catalog name is blank.|
|200104|Invalid catalog ID.|
|200229|Invalid catalog version|
|200231|It is not allowed to set the default category for products to be a root category|
|200245|Creation of a filtered view catalog requires a base catalog.|
|200246|Specified base catalog {0} is not a version 2 catalog.|
|200247|Category input fields are invalid for filtered view catalogs.|
Root Schema : errorModel
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
errors(optional):
array errors
An optional list of errors if multiple errors were encountered
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code
-
type(optional):
string
The URI to the HTTP state code definition
Nested Schema : errors
Type:
array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code