{
  "openapi": "3.0.1",
  "info": {
    "title": "Folders",
    "description": "Create and administer the folders.",
    "version": "9.1.20.0",
    "x-introduced": "9.1.0.0"
  },
  "servers": [
    {
      "url": "https://{hostname}:{port}/rest/admin/v2",
      "variables": {
        "port": {
          "default": "443",
          "enum": [
            "443",
            "8000"
          ]
        },
        "hostname": {
          "default": "localhost",
          "enum": [
            "localhost",
            "test.hcl.com"
          ]
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Folders",
      "description": "Provide RESTful services to manage folders."
    }
  ],
  "paths": {
    "/folders": {
      "post": {
        "tags": [
          "Folders"
        ],
        "summary": "Create a new folder",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "description": "Store ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-context-data": "storeId"
            },
            "x-context-data": "storeId"
          }
        ],
        "requestBody": {
          "description": "The request body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Folder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The operation was successful",
            "content": {},
            "headers": {
              "Location": {
                "description": "The URI of the folders.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "links": {
              "GetFoldersByIdAndStoreId": {
                "operationRef": "#/paths/~1folders~1{id}/get",
                "parameters": {
                  "id": "$response.header.Location",
                  "storeId": "$request.query.storeId"
                },
                "description": "The `id`, `storeId` value used in the request body can be used as the `id`, `storeId` parameter in `GET /folders/{id}`.\n"
              },
              "DeleteFoldersByIdAndStoreId": {
                "operationRef": "#/paths/~1folders~1{id}/delete",
                "parameters": {
                  "id": "$response.header.Location",
                  "storeId": "$request.query.storeId"
                },
                "description": "The `id`, `storeId` value used in the request body can be used as the `id`,`storeId` parameter in `DELETE /folders/{id}`.\n"
              },
              "UpdateFoldersByIdAndStoreId": {
                "operationRef": "#/paths/~1folders~1{id}/patch",
                "parameters": {
                  "id": "$response.header.Location",
                  "storeId": "$request.query.storeId"
                },
                "description": "The `id`, `storeId` value used in the request body can be used as the `id` , vparameter in `PATCH /folders/{id}`.\n"
              },
              "CreateFolderItemsByFolderIdAndStoreId": {
                "operationRef": "#/paths/~1folders~1{folderId}~1items/post",
                "parameters": {
                  "folderId": "$response.header.Location",
                  "storeId": "$request.query.storeId"
                },
                "description": "The `folderId`, `storeId` value used in the request body can be used as the `folderId`, `storeId` parameter in `POST /folders/{folderId}/items`.\n"
              }
            },
            "x-entity-path": "dataArea/folder[1]/folderIdentifier/uniqueID"
          }
        },
        "x-action-code": "Create",
        "x-action-verb": "process",
        "x-expression-template": "/Folder[1]",
        "x-facade-client-class": "com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient",
        "x-facade-client-method": "processFolder",
        "x-request-bod-class": "com.ibm.commerce.infrastructure.facade.datatypes.ProcessFolderType",
        "x-codegen-request-body-name": "body"
      }
    },
    "/folders/by-item-type-and-reference-id": {
      "get": {
        "tags": [
          "Folders"
        ],
        "summary": "Get folders by folder item type and reference ID",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "description": "Store ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-context-data": "storeId"
            },
            "x-context-data": "storeId"
          },
          {
            "name": "folderItemType",
            "in": "query",
            "description": "Folder item type to get folder",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "referenceId",
            "in": "query",
            "description": "reference ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Offset",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/recordSetStartNumber"
            },
            "x-entity-path": "dataArea/get/recordSetStartNumber"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Limit",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/maxItems"
            },
            "x-entity-path": "dataArea/get/maxItems"
          }
        ],
        "responses": {
          "200": {
            "description": "The operation was successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderCollection"
                }
              }
            },
            "x-entity-path": "dataArea/folder"
          }
        },
        "x-expression-template": "{_wcf.ap='{accessProfile}'}/Folder[FolderItem[FolderItemType='{folderItemType}' and ReferenceID='{referenceId}']]",
        "x-facade-client-class": "com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient",
        "x-facade-client-method": "getFolder",
        "x-parameters": {
          "accessProfile": "IBM_Admin_Details"
        },
        "x-request-bod-class": "com.ibm.commerce.infrastructure.facade.datatypes.GetFolderType"
      }
    },
    "/folders/by-type": {
      "get": {
        "tags": [
          "Folders"
        ],
        "summary": "Get folders by folder type",
        "parameters": [
          {
            "name": "folderType",
            "in": "query",
            "description": "Folder type to get folders from",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "Store ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-context-data": "storeId"
            },
            "x-context-data": "storeId"
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Offset",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/recordSetStartNumber"
            },
            "x-entity-path": "dataArea/get/recordSetStartNumber"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Limit",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/maxItems"
            },
            "x-entity-path": "dataArea/get/maxItems"
          }
        ],
        "responses": {
          "200": {
            "description": "The operation was successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderCollection"
                }
              }
            },
            "x-entity-path": "dataArea/folder"
          }
        },
        "x-expression-template": "{_wcf.ap='{accessProfile}'}/Folder[(FolderUsage='{folderType}')]",
        "x-facade-client-class": "com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient",
        "x-facade-client-method": "getFolder",
        "x-parameters": {
          "accessProfile": "IBM_Admin_Details"
        },
        "x-request-bod-class": "com.ibm.commerce.infrastructure.facade.datatypes.GetFolderType"
      }
    },
    "/folders/{folderId}/child-folders": {
      "get": {
        "tags": [
          "Folders"
        ],
        "summary": "Get the child folders of a parent folder",
        "parameters": [
          {
            "name": "folderId",
            "in": "path",
            "description": "Parent folder ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "Store ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-context-data": "storeId"
            },
            "x-context-data": "storeId"
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Offset",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/recordSetStartNumber"
            },
            "x-entity-path": "dataArea/get/recordSetStartNumber"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Limit",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/maxItems"
            },
            "x-entity-path": "dataArea/get/maxItems"
          }
        ],
        "responses": {
          "200": {
            "description": "The operation was successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderCollection"
                }
              }
            },
            "x-entity-path": "dataArea/folder"
          }
        },
        "x-expression-template": "{_wcf.ap='{accessProfile}'}/Folder[ParentFolderIdentifier[(UniqueID='{folderId}')]]",
        "x-facade-client-class": "com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient",
        "x-facade-client-method": "getFolder",
        "x-parameters": {
          "accessProfile": "IBM_Admin_Details"
        },
        "x-request-bod-class": "com.ibm.commerce.infrastructure.facade.datatypes.GetFolderType"
      }
    },
    "/folders/{folderId}/items": {
      "get": {
        "tags": [
          "Folders"
        ],
        "summary": "Get the items under a folder",
        "parameters": [
          {
            "name": "folderId",
            "in": "path",
            "description": "Folder ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "Store ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-context-data": "storeId"
            },
            "x-context-data": "storeId"
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Offset",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/recordSetStartNumber"
            },
            "x-entity-path": "dataArea/get/recordSetStartNumber"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Limit",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/maxItems"
            },
            "x-entity-path": "dataArea/get/maxItems"
          }
        ],
        "responses": {
          "200": {
            "description": "The operation was successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderItemCollection"
                }
              }
            },
            "x-entity-path": "dataArea/folder/folderItem"
          }
        },
        "x-expression-template": "{_wcf.ap={accessProfile}}/Folder[FolderIdentifier[(UniqueID={folderId})]]/FolderItem",
        "x-facade-client-class": "com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient",
        "x-facade-client-method": "getFolder",
        "x-parameters": {
          "accessProfile": "IBM_Admin_ChildFolderItems"
        },
        "x-request-bod-class": "com.ibm.commerce.infrastructure.facade.datatypes.GetFolderType"
      },
      "post": {
        "tags": [
          "Folders"
        ],
        "summary": "Add an item to a folder",
        "parameters": [
          {
            "name": "folderId",
            "in": "path",
            "description": "The folder ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/folder/folderIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/folder/folderIdentifier/uniqueID"
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "The store ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-context-data": "storeId",
              "x-entity-path": "dataArea/folder[1]/folderItem[1]/folderItemIdentifier/storeIdentifier/uniqueID"
            },
            "x-context-data": "storeId",
            "x-entity-path": "dataArea/folder[1]/folderItem[1]/folderItemIdentifier/storeIdentifier/uniqueID"
          }
        ],
        "requestBody": {
          "description": "The request body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FoldersItem"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {},
            "headers": {
              "Location": {
                "description": "The URI of the folders.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "links": {
              "GetItemsByFolderIdAndStoreId": {
                "operationRef": "#/paths/~1folders~1{folderId}~1items/get",
                "parameters": {
                  "folderId": "$request.path.folderId",
                  "storeId": "$request.query.storeId"
                },
                "description": "The `folderId ,`storeId` value used in the request body can be used as the `folderId ,`storeId` parameter in `GET /folders/{folderId}/items`.\n"
              },
              "DeleteItemsByFolderIdAndStoreIdAndReferenceIdAndFolderType": {
                "operationRef": "#/paths/~1folders~1{folderId}~1items~1{referenceId}/delete",
                "parameters": {
                  "folderId": "$request.path.folderId",
                  "storeId": "$request.query.storeId",
                  "referenceId": "request.body#/referenceId",
                  "folderType": "request.body#/folderType"
                },
                "description": "The `folderId ,`storeId` and `referenceId ,`folderType` value used in the request body can be used as the `folderId ,`storeId` and `referenceId ,`folderType` parameter in `DELETE /folders/{folderId}/items/{referenceId}`.\n"
              }
            }
          }
        },
        "x-action-code": "Add",
        "x-expression-template": "/Folder[1]/FolderItem[1]",
        "x-facade-client-class": "com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient",
        "x-facade-client-method": "changeFolder",
        "x-request-bod-class": "com.ibm.commerce.infrastructure.facade.datatypes.ChangeFolderType",
        "x-request-verb": "change",
        "x-codegen-request-body-name": "body"
      }
    },
    "/folders/{folderId}/items/{referenceId}": {
      "delete": {
        "tags": [
          "Folders"
        ],
        "summary": "Delete a particular item by reference ID in a folder",
        "parameters": [
          {
            "name": "folderId",
            "in": "path",
            "description": "The folder ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/folder[1]/folderIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/folder[1]/folderIdentifier/uniqueID"
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "The store ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-context-data": "storeId"
            },
            "x-context-data": "storeId"
          },
          {
            "name": "referenceId",
            "in": "path",
            "description": "reference ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/folder[1]/folderItem[1]/referenceID"
            },
            "x-entity-path": "dataArea/folder[1]/folderItem[1]/referenceID"
          },
          {
            "name": "folderType",
            "in": "query",
            "description": "The folder type",
            "required": true,
            "schema": {
              "type": "string",
              "x-entity-path": "dataArea/folder[1]/folderItem[1]/folderItemType"
            },
            "x-entity-path": "dataArea/folder[1]/folderItem[1]/folderItemType"
          }
        ],
        "responses": {
          "204": {
            "description": "The operation was successful",
            "content": {}
          }
        },
        "x-action-code": "Delete",
        "x-expression-template": "/Folder[1]/FolderItem[1]",
        "x-facade-client-class": "com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient",
        "x-facade-client-method": "changeFolder",
        "x-request-bod-class": "com.ibm.commerce.infrastructure.facade.datatypes.ChangeFolderType",
        "x-request-verb": "change"
      }
    },
    "/folders/{id}": {
      "get": {
        "tags": [
          "Folders"
        ],
        "summary": "Get a folder by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The requested folder ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "The store ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-context-data": "storeId"
            },
            "x-context-data": "storeId"
          }
        ],
        "responses": {
          "200": {
            "description": "The operation was successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderCollection"
                }
              }
            },
            "x-entity-path": "dataArea/folder[1]"
          }
        },
        "x-expression-template": "{_wcf.ap='{accessProfile}'}/Folder[FolderIdentifier[(UniqueID='{id}')]]",
        "x-facade-client-class": "com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient",
        "x-facade-client-method": "getFolder",
        "x-parameters": {
          "accessProfile": "IBM_Admin_Details"
        },
        "x-request-bod-class": "com.ibm.commerce.infrastructure.facade.datatypes.GetFolderType"
      },
      "delete": {
        "tags": [
          "Folders"
        ],
        "summary": "Delete a particular folder by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The folder ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/folder[1]/folderIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/folder[1]/folderIdentifier/uniqueID"
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "The store ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-content-data": "storeId"
            },
            "x-content-data": "storeId"
          }
        ],
        "responses": {
          "204": {
            "description": "The operation was successful",
            "content": {}
          }
        },
        "x-action-code": "Delete",
        "x-action-verb": "process",
        "x-expression-template": "/Folder[1]",
        "x-facade-client-class": "com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient",
        "x-facade-client-method": "processFolder",
        "x-request-bod-class": "com.ibm.commerce.infrastructure.facade.datatypes.ProcessFolderType"
      },
      "patch": {
        "tags": [
          "Folders"
        ],
        "summary": "Updates a particular folder by ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The folder ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/folder/folderIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/folder/folderIdentifier/uniqueID"
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "The store ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-context-data": "storeId"
            },
            "x-context-data": "storeId"
          }
        ],
        "requestBody": {
          "description": "The request body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Folder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The operation was successful",
            "content": {}
          }
        },
        "x-action-code": "Change",
        "x-action-verb": "change",
        "x-expression-template": "/Folder[1]",
        "x-facade-client-class": "com.ibm.commerce.infrastructure.facade.client.InfrastructureFacadeClient",
        "x-facade-client-method": "changeFolder",
        "x-request-bod-class": "com.ibm.commerce.infrastructure.facade.datatypes.ChangeFolderType",
        "x-codegen-request-body-name": "body"
      }
    }
  },
  "components": {
    "schemas": {
      "Folder": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "The folder description",
            "x-entity-path": "description"
          },
          "folderItems": {
            "type": "array",
            "description": "The folder items under a folder",
            "items": {
              "$ref": "#/components/schemas/FoldersItem"
            },
            "x-entity-path": "folderItem"
          },
          "id": {
            "type": "integer",
            "description": "The folder identifier ID",
            "format": "int32",
            "readOnly": true,
            "x-entity-path": "folderIdentifier/uniqueID"
          },
          "identifier": {
            "type": "string",
            "description": "The folder identifier's identifier",
            "x-entity-path": "folderIdentifier/identifier"
          },
          "parentFolderId": {
            "type": "integer",
            "description": "The folder's parent folder's ID",
            "format": "int32",
            "x-entity-path": "folderIdentifier/parentFolderIdentifier/uniqueID"
          },
          "path": {
            "type": "string",
            "description": "The folder path",
            "readOnly": true,
            "x-entity-path": "path"
          },
          "storeId": {
            "type": "integer",
            "description": "The folder's associated store ID",
            "format": "int64",
            "x-entity-path": "folderIdentifier/storeIdentifier/uniqueID"
          },
          "storeName": {
            "type": "string",
            "description": "The folder's associated store name",
            "readOnly": true,
            "x-entity-path": "folderIdentifier/storeIdentifier/externalIdentifier/nameIdentifier"
          },
          "usage": {
            "type": "string",
            "description": "The folder usage",
            "x-entity-path": "folderUsage"
          }
        },
        "description": "A folder",
        "x-entity-class": "com.ibm.commerce.infrastructure.facade.datatypes.FolderType"
      },
      "FolderCollection": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64",
            "readOnly": true
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Folder"
            }
          }
        },
        "description": "A collection of folders"
      },
      "FolderItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The folder item identifier",
            "format": "int32",
            "x-entity-path": "folderItemIdentifier/uniqueID"
          },
          "referenceId": {
            "type": "integer",
            "description": "The folder item reference ID",
            "format": "int32",
            "x-entity-path": "referenceID"
          },
          "storeId": {
            "type": "integer",
            "description": "The folder item store ID",
            "format": "int64",
            "x-entity-path": "folderItemIdentifier/storeIdentifier/uniqueID"
          },
          "type": {
            "type": "string",
            "description": "The folder item type",
            "x-entity-path": "folderItemType"
          }
        },
        "description": "A folder item",
        "x-entity-class": "com.ibm.commerce.infrastructure.facade.datatypes.FolderItemType"
      },
      "FoldersItem": {
        "type": "object",
        "properties": {
          "referenceId": {
            "type": "integer",
            "description": "The folder item reference ID",
            "format": "int32",
            "x-entity-path": "referenceID"
          },
          "storeId": {
            "type": "integer",
            "description": "The folder item store ID",
            "format": "int64",
            "x-entity-path": "folderItemIdentifier/storeIdentifier/uniqueID"
          },
          "type": {
            "type": "string",
            "description": "The folder item type",
            "x-entity-path": "folderItemType"
          }
        },
        "description": "A folder item",
        "x-entity-class": "com.ibm.commerce.infrastructure.facade.datatypes.FolderItemType"
      },
      "FolderItemCollection": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64",
            "readOnly": true
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FolderItem"
            }
          }
        },
        "description": "A collection of folder items"
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ],
  "x-components": {}
}
