{
  "openapi": "3.0.1",
  "info": {
    "title": "Store Function",
    "description": "Create and administer the store functions.",
    "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": "Store Function",
      "description": "Create and administer the store functions."
    }
  ],
  "paths": {
    "/store-functions": {
      "get": {
        "summary": "Gets the store functions in a store.",
        "tags": [
          "Store Function"
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "description": "The store ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-context-data": "storeId"
            },
            "x-context-data": "storeId"
          },
          {
            "name": "offset",
            "in": "query",
            "description": "The offset.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/recordSetStartNumber"
            },
            "x-entity-path": "dataArea/get/recordSetStartNumber"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The limit.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/maxItems"
            },
            "x-entity-path": "dataArea/get/maxItems"
          }
        ],
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketingSpotCollection"
                }
              }
            },
            "x-entity-path": "dataArea/marketingSpot"
          }
        },
        "x-expression-builder-class": "com.ibm.commerce.foundation.internal.client.taglib.util.SearchExpressionBuilder",
        "x-expression-builder-method": "formatExpression",
        "x-facade-client-class": "com.ibm.commerce.marketing.facade.client.MarketingFacadeClient",
        "x-facade-client-method": "getMarketingSpot",
        "x-parameters": {
          "accessProfile": "IBM_Admin_Details",
          "searchText": "*",
          "template": "/MarketingSpot[Usage='$usage$' and search(MarketingSpotIdentifier/ExternalIdentifier/Name='$searchText$')]",
          "usage": "STOREFEATURE"
        },
        "x-request-bod-class": "com.ibm.commerce.marketing.facade.datatypes.GetMarketingSpotType"
      },
      "post": {
        "summary": "Creates a store function.",
        "tags": [
          "Store Function"
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "description": "The store ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-context-data": "storeId",
              "x-entity-path": "dataArea/marketingSpot[1]/marketingSpotIdentifier/externalIdentifier/storeIdentifier/uniqueID"
            },
            "x-context-data": "storeId",
            "x-entity-path": "dataArea/marketingSpot[1]/marketingSpotIdentifier/externalIdentifier/storeIdentifier/uniqueID"
          }
        ],
        "requestBody": {
          "description": "The request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketingSpot"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The operation is successful.",
            "headers": {
              "Location": {
                "description": "The URI of the MarketingSpot.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {},
            "x-entity-path": "dataArea/marketingSpot[1]/marketingSpotIdentifier/uniqueID",
            "links": {
              "GetStoreFunctionById": {
                "operationRef": "#/paths/~1store-functions~1{id}/get",
                "parameters": {
                  "id": "$request.body#/id",
                  "storeId": "$request.query.storeId"
                },
                "description": "The `id`& `storeId`value used in the request body can be used as the `id`& `storeId` parameter in `GET /store-functions/{id}`.\n"
              },
              "UpdateStoreFunctionById": {
                "operationRef": "#/paths/~1store-functions~1{id}/patch",
                "parameters": {
                  "id": "$request.body#/id",
                  "storeId": "$request.query.storeId"
                },
                "description": "The `id`,`storeId`value used in the request body can be used as the `id`& `storeId` parameter in `PATCH /store-functions/{id}`.\n"
              },
              "DeleteStoreFunctionById": {
                "operationRef": "#/paths/~1store-functions~1{id}/Delete",
                "parameters": {
                  "id": "$request.body#/id",
                  "storeId": "$request.query.storeId"
                },
                "description": "The `id`& `storeId`value used in the request body can be used as the `id`& `storeId` parameter in `DELETE /store-functions/{id}`.\n"
              },
              "GetStoreFunctionByName": {
                "operationRef": "#/paths/~1store-functions~1by-name~1{name}/get",
                "parameters": {
                  "name ": "$request.body#/name",
                  "storeId": "$request.query.storeId"
                },
                "description": "The `name` & `storeId` value used in the request body can be used as the `name`& `storeId` parameter in `GET /store-functions/by-name/{name}`.\n"
              },
              "GetDefaultConentOfstorefunction": {
                "operationRef": "#/paths/~1store-functions~1{id}~1contents/get",
                "parameters": {
                  "id": "$request.body#/id",
                  "storeId": "$request.query.storeId"
                },
                "description": "The`id`& `storeId` value used in the request body can be used as the `id`& `storeId`  parameter in `GET /store-functions/{id}/contents`.\n"
              },
              "UpdateDefaultConentOfstorefunction": {
                "operationRef": "#/paths/~1store-functions~1{id}~1contents/patch",
                "parameters": {
                  "id": "$request.body#/id",
                  "storeId": "$request.query.storeId"
                },
                "description": "The `id`& `storeId` value used in the request body can be used as the `id`& `storeId` parameter in `PATCH ​/store-functions/{id}/contents`.\n"
              }
            }
          }
        },
        "x-action-code": "Add",
        "x-expression-template": "/MarketingSpot[1]",
        "x-facade-client-class": "com.ibm.commerce.marketing.facade.client.MarketingFacadeClient",
        "x-facade-client-method": "processMarketingSpot",
        "x-request-bod-class": "com.ibm.commerce.marketing.facade.datatypes.ProcessMarketingSpotType",
        "x-codegen-request-body-name": "body"
      }
    },
    "/store-functions/by-name/{name}": {
      "get": {
        "summary": "Gets a store function by name.",
        "tags": [
          "Store Function"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "The store function name.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "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 is successful.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketingSpot"
                }
              }
            },
            "x-entity-path": "dataArea/marketingSpot[1]"
          }
        },
        "x-expression-template": "{_wcf.ap='{accessProfile}'}/MarketingSpot[MarketingSpotIdentifier[ExternalIdentifier[(Name='{name}')]] and Usage='{usage}']",
        "x-facade-client-class": "com.ibm.commerce.marketing.facade.client.MarketingFacadeClient",
        "x-facade-client-method": "getMarketingSpot",
        "x-parameters": {
          "accessProfile": "IBM_Admin_Details",
          "usage": "STOREFEATURE"
        },
        "x-request-bod-class": "com.ibm.commerce.marketing.facade.datatypes.GetMarketingSpotType"
      }
    },
    "/store-functions/{id}": {
      "get": {
        "summary": "Gets a store function.",
        "tags": [
          "Store Function"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The store function ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "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 is successful.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketingSpots"
                }
              }
            },
            "x-entity-path": "dataArea/marketingSpot[1]"
          }
        },
        "x-expression-template": "{_wcf.ap='{accessProfile}'}/MarketingSpot[MarketingSpotIdentifier[(UniqueID='{id}')]]",
        "x-facade-client-class": "com.ibm.commerce.marketing.facade.client.MarketingFacadeClient",
        "x-facade-client-method": "getMarketingSpot",
        "x-parameters": {
          "accessProfile": "IBM_Admin_Details"
        },
        "x-request-bod-class": "com.ibm.commerce.marketing.facade.datatypes.GetMarketingSpotType"
      },
      "delete": {
        "summary": "Deletes a store function.",
        "tags": [
          "Store Function"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The store function ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/marketingSpot[1]/marketingSpotIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/marketingSpot[1]/marketingSpotIdentifier/uniqueID"
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "The store ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-context-data": "storeId",
              "x-entity-path": "dataArea/marketingSpot[1]/marketingSpotIdentifier/externalIdentifier/storeIdentifier/uniqueID"
            },
            "x-context-data": "storeId",
            "x-entity-path": "dataArea/marketingSpot[1]/marketingSpotIdentifier/externalIdentifier/storeIdentifier/uniqueID"
          }
        ],
        "responses": {
          "204": {
            "description": "The operation is successful.",
            "content": {}
          }
        },
        "x-action-code": "Delete",
        "x-expression-template": "/MarketingSpot[1]",
        "x-facade-client-class": "com.ibm.commerce.marketing.facade.client.MarketingFacadeClient",
        "x-facade-client-method": "processMarketingSpot",
        "x-request-bod-class": "com.ibm.commerce.marketing.facade.datatypes.ProcessMarketingSpotType"
      },
      "patch": {
        "summary": "Updates a store function.",
        "tags": [
          "Store Function"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The store function ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/marketingSpot[1]/marketingSpotIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/marketingSpot[1]/marketingSpotIdentifier/uniqueID"
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "The store ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-context-data": "storeId",
              "x-entity-path": "dataArea/marketingSpot[1]/marketingSpotIdentifier/externalIdentifier/storeIdentifier/uniqueID"
            },
            "x-context-data": "storeId",
            "x-entity-path": "dataArea/marketingSpot[1]/marketingSpotIdentifier/externalIdentifier/storeIdentifier/uniqueID"
          }
        ],
        "requestBody": {
          "description": "The request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketingSpot"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {}
          }
        },
        "x-action-code": "Change",
        "x-expression-template": "/MarketingSpot[1]",
        "x-facade-client-class": "com.ibm.commerce.marketing.facade.client.MarketingFacadeClient",
        "x-facade-client-method": "changeMarketingSpot",
        "x-request-bod-class": "com.ibm.commerce.marketing.facade.datatypes.ChangeMarketingSpotType",
        "x-codegen-request-body-name": "body"
      }
    },
    "/store-functions/{id}/contents": {
      "get": {
        "summary": "Gets the default content of a store function.",
        "tags": [
          "Store Function"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The store function ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "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 is successful.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DefaultContentCollection"
                }
              }
            },
            "x-entity-path": "dataArea/marketingSpot[1]/defaultContent"
          }
        },
        "x-expression-template": "{_wcf.ap='{accessProfile}'}/MarketingSpot[MarketingSpotIdentifier[(UniqueID='{id}')]]",
        "x-facade-client-class": "com.ibm.commerce.marketing.facade.client.MarketingFacadeClient",
        "x-facade-client-method": "getMarketingSpot",
        "x-parameters": {
          "accessProfile": "IBM_Admin_Details"
        },
        "x-request-bod-class": "com.ibm.commerce.marketing.facade.datatypes.GetMarketingSpotType"
      },
      "patch": {
        "summary": "Updates the default content of a store function.",
        "tags": [
          "Store Function"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The store function ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/marketingSpot[1]/marketingSpotIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/marketingSpot[1]/marketingSpotIdentifier/uniqueID"
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "The store ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-context-data": "storeId",
              "x-entity-path": "dataArea/marketingSpot[1]/marketingSpotIdentifier/externalIdentifier/storeIdentifier/uniqueID"
            },
            "x-context-data": "storeId",
            "x-entity-path": "dataArea/marketingSpot[1]/marketingSpotIdentifier/externalIdentifier/storeIdentifier/uniqueID"
          }
        ],
        "requestBody": {
          "description": "The request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DefaultContent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {}
          }
        },
        "x-action-code": "Change",
        "x-expression-template": "/MarketingSpot[1]/DefaultContent[1]",
        "x-facade-client-class": "com.ibm.commerce.marketing.facade.client.MarketingFacadeClient",
        "x-facade-client-method": "changeMarketingSpot",
        "x-request-bod-class": "com.ibm.commerce.marketing.facade.datatypes.ChangeMarketingSpotType",
        "x-codegen-request-body-name": "body"
      }
    }
  },
  "components": {
    "schemas": {
      "DefaultContent": {
        "type": "object",
        "required": [
          "Id",
          "storeId"
        ],
        "properties": {
          "content": {
            "type": "string",
            "description": "The value of the default content.",
            "x-entity-path": "contentUniqueID"
          },
          "Id": {
            "type": "integer",
            "description": "The default content ID.",
            "format": "int32",
            "x-entity-path": "uniqueID"
          },
          "contentType": {
            "type": "string",
            "description": "The type of the default content.",
            "x-entity-path": "format"
          },
          "storeId": {
            "type": "integer",
            "description": "The store ID.",
            "format": "int32",
            "x-entity-path": "storeIdentifier/uniqueID"
          },
          "sequence": {
            "type": "integer",
            "description": "The default content ID.",
            "format": "int32",
            "x-entity-path": "uniqueID"
          }
        },
        "description": "A default content of a marketing spot.",
        "x-entity-class": "com.ibm.commerce.marketing.facade.datatypes.DefaultContentType"
      },
      "DefaultContentCollection": {
        "type": "object",
        "required": [
          "count"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DefaultContent"
            }
          }
        },
        "description": "A collection of default content of a marketing spot."
      },
      "MarketingSpot": {
        "type": "object",
        "required": [
          "id",
          "name",
          "storeId"
        ],
        "properties": {
          "defaultContent": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DefaultContent"
            }
          },
          "defaultTitle": {
            "type": "array",
            "items": {}
          },
          "description": {
            "type": "string",
            "description": "The description of the marketing spot."
          },
          "id": {
            "type": "integer",
            "description": "The marketing spot ID.",
            "format": "int32",
            "x-entity-path": "marketingSpotIdentifier/uniqueID"
          },
          "name": {
            "type": "string",
            "description": "The name of the marketing spot.",
            "x-entity-path": "marketingSpotIdentifier/externalIdentifier/name"
          },
          "storeId": {
            "type": "integer",
            "description": "The store ID.",
            "format": "int32",
            "x-entity-path": "marketingSpotIdentifier/externalIdentifier/storeIdentifier/uniqueID"
          },
          "usage": {
            "type": "string",
            "description": "The usage type of the marketing spot. MARKETING - Delivers marketing message. CONTENT - Delivers store content. LAYOUTMARKETINGSPOT - Displays Commerce Composer layouts. SEARCH - Used by search rules. STOREFEATURE - Used by store functions. STOREFILEREF - Used by store style selection."
          },
          "updatedDateTime": {
            "type": "string",
            "nullable": true
          },
          "supportsMarketingContent": {
            "type": "string",
            "nullable": true
          },
          "supportsCatalogGroup": {
            "type": "string",
            "nullable": true
          },
          "supportsCatalogEntry": {
            "type": "string",
            "nullable": true
          },
          "supportsWidget": {
            "type": "string",
            "nullable": true
          },
          "displayable": {
            "type": "integer"
          }
        },
        "description": "A marketing spot.",
        "x-entity-class": "com.ibm.commerce.marketing.facade.datatypes.MarketingSpotType"
      },
      "MarketingSpots": {
        "type": "object",
        "required": [
          "id",
          "name",
          "storeId"
        ],
        "properties": {
          "defaultContent": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DefaultContent"
            }
          },
          "defaultTitle": {
            "type": "array",
            "items": {}
          },
          "description": {
            "type": "string",
            "description": "The description of the marketing spot."
          },
          "id": {
            "type": "integer",
            "description": "The marketing spot ID.",
            "format": "int32",
            "x-entity-path": "marketingSpotIdentifier/uniqueID"
          },
          "name": {
            "type": "string",
            "description": "The name of the marketing spot.",
            "x-entity-path": "marketingSpotIdentifier/externalIdentifier/name"
          },
          "storeId": {
            "type": "integer",
            "description": "The store ID.",
            "format": "int32",
            "x-entity-path": "marketingSpotIdentifier/externalIdentifier/storeIdentifier/uniqueID"
          },
          "usage": {
            "type": "string",
            "description": "The usage type of the marketing spot. MARKETING - Delivers marketing message. CONTENT - Delivers store content. LAYOUTMARKETINGSPOT - Displays Commerce Composer layouts. SEARCH - Used by search rules. STOREFEATURE - Used by store functions. STOREFILEREF - Used by store style selection."
          },
          "updatedDateTime": {
            "type": "string",
            "nullable": true
          },
          "supportsMarketingContent": {
            "type": "string",
            "nullable": true
          },
          "supportsCatalogGroup": {
            "type": "string",
            "nullable": true
          },
          "supportsCatalogEntry": {
            "type": "string",
            "nullable": true
          },
          "supportsWidget": {
            "type": "string",
            "nullable": true
          },
          "displayable": {
            "type": "integer"
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "object",
                "properties": {
                  "href": {
                    "type": "string",
                    "description": "The URL of the link."
                  }
                },
                "description": "The self link."
              }
            }
          }
        },
        "description": "A marketing spot.",
        "x-entity-class": "com.ibm.commerce.marketing.facade.datatypes.MarketingSpotType"
      },
      "MarketingSpotCollection": {
        "type": "object",
        "required": [
          "count"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64"
          },
          "href": {
            "type": "string",
            "description": "The URL of the link.",
            "format": "uri"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketingSpots"
            }
          }
        },
        "description": "A collection of marketing spots."
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ],
  "x-components": {}
}
