swagger: '2.0'
info:
  title: Store Function Admin REST APIs
  version: '2.0'
paths:
  /store-functions:
    get:
      produces:
        - application/json
      parameters:
        - description: The store ID.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: The offset.
          format: int32
          in: query
          name: offset
          required: false
          type: integer
          x-entity-path: dataArea/get/recordSetStartNumber
        - description: The limit.
          format: int32
          in: query
          name: limit
          required: false
          type: integer
          x-entity-path: dataArea/get/maxItems
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/MarketingSpotCollection'
          x-entity-path: dataArea/marketingSpot
      summary: Gets the store functions in a store.
      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:
      consumes:
        - application/json
      parameters:
        - description: The store ID.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
          x-entity-path: >-
            dataArea/marketingSpot[1]/marketingSpotIdentifier/externalIdentifier/storeIdentifier/uniqueID
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/MarketingSpot'
          x-entity-path: 'dataArea/marketingSpot[1]'
      responses:
        '201':
          description: The operation is successful.
          headers:
            Location:
              description: The URI of the store function.
              type: string
          x-entity-path: 'dataArea/marketingSpot[1]/marketingSpotIdentifier/uniqueID'
      summary: Creates a store function.
      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
  '/store-functions/by-name/{name}':
    get:
      produces:
        - application/json
      parameters:
        - description: The store function name.
          in: path
          name: name
          required: true
          type: string
        - description: The store ID.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/MarketingSpot'
          x-entity-path: 'dataArea/marketingSpot[1]'
      summary: Gets a store function by name.
      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}':
    delete:
      parameters:
        - description: The store function ID.
          format: int32
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/marketingSpot[1]/marketingSpotIdentifier/uniqueID'
        - description: The store ID.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
          x-entity-path: >-
            dataArea/marketingSpot[1]/marketingSpotIdentifier/externalIdentifier/storeIdentifier/uniqueID
      responses:
        '204':
          description: The operation is successful.
      summary: Deletes a store function.
      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
    get:
      produces:
        - application/json
      parameters:
        - description: The store function ID.
          format: int32
          in: path
          name: id
          required: true
          type: integer
        - description: The store ID.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/MarketingSpot'
          x-entity-path: 'dataArea/marketingSpot[1]'
      summary: Gets a store function.
      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:
      consumes:
        - application/json
      parameters:
        - description: The store function ID.
          format: int32
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/marketingSpot[1]/marketingSpotIdentifier/uniqueID'
        - description: The store ID.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
          x-entity-path: >-
            dataArea/marketingSpot[1]/marketingSpotIdentifier/externalIdentifier/storeIdentifier/uniqueID
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/MarketingSpot'
          x-entity-path: 'dataArea/marketingSpot[1]'
      responses:
        '200':
          description: The operation is successful.
      summary: Updates a store function.
      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
  '/store-functions/{id}/contents':
    get:
      produces:
        - application/json
      parameters:
        - description: The store function ID.
          format: int32
          in: path
          name: id
          required: true
          type: integer
        - description: The store ID.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/DefaultContentCollection'
          x-entity-path: 'dataArea/marketingSpot[1]/defaultContent'
      summary: Gets the default content of a store function.
      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:
      consumes:
        - application/json
      parameters:
        - description: The store function ID.
          format: int32
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/marketingSpot[1]/marketingSpotIdentifier/uniqueID'
        - description: The store ID.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
          x-entity-path: >-
            dataArea/marketingSpot[1]/marketingSpotIdentifier/externalIdentifier/storeIdentifier/uniqueID
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/DefaultContent'
          x-entity-path: 'dataArea/marketingSpot[1]/defaultContent[1]'
      responses:
        '200':
          description: The operation is successful.
      summary: Updates the default content of a store function.
      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
definitions:
  DefaultContent:
    description: A default content of a marketing spot.
    properties:
      content:
        description: The value of the default content.
        type: string
        x-entity-path: contentUniqueID
      contentId:
        description: The default content ID.
        format: int32
        type: integer
        x-entity-path: uniqueID
      contentType:
        description: The type of the default content.
        type: string
        x-entity-path: format
      storeId:
        description: The store ID.
        format: int32
        type: integer
        x-entity-path: storeIdentifier/uniqueID
    type: object
    x-entity-class: com.ibm.commerce.marketing.facade.datatypes.DefaultContentType
  DefaultContentCollection:
    description: A collection of default content of a marketing spot.
    properties:
      count:
        format: int64
        type: integer
      items:
        items:
          $ref: '#/definitions/DefaultContent'
        type: array
    type: object
  MarketingSpot:
    description: A marketing spot.
    properties:
      defaultContent:
        items:
          $ref: '#/definitions/DefaultContent'
        type: array
      description:
        description: The description of the marketing spot.
        type: string
      id:
        description: The marketing spot ID.
        format: int32
        type: integer
        x-entity-path: marketingSpotIdentifier/uniqueID
      name:
        description: The name of the marketing spot.
        type: string
        x-entity-path: marketingSpotIdentifier/externalIdentifier/name
      storeId:
        description: The store ID.
        format: int32
        type: integer
        x-entity-path: marketingSpotIdentifier/externalIdentifier/storeIdentifier/uniqueID
      usage:
        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.
        type: string
    type: object
    x-entity-class: com.ibm.commerce.marketing.facade.datatypes.MarketingSpotType
  MarketingSpotCollection:
    description: A collection of marketing spots.
    properties:
      count:
        format: int64
        type: integer
      items:
        items:
          $ref: '#/definitions/MarketingSpot'
        type: array
    type: object
x-components: {}
