swagger: '2.0'
info:
  title: Price Equation Admininistrative REST APIs
  version: '2.0'
paths:
  /price-equations:
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: >-
            The position within the resulting dataset where the query begins
            returning item records. If the offset is "5", the records that
            returned begin with the sixth record that matches the query
            parameters. If the offset is "0", the records that are returned
            begin with the first record that matches the query parameters.
          format: int32
          in: query
          name: offset
          required: false
          type: integer
          x-entity-path: dataArea/get/recordSetStartNumber
        - description: The maximum number of records to return.
          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/PriceEquationCollection'
          x-entity-path: dataArea/priceEquation
      summary: Get the price equations in a store.
      x-expression-template: '{_wcf.ap=IBM_Admin_Summary}/PriceEquation'
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: getPriceEquation
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.GetPriceEquationType
    post:
      consumes:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
          x-entity-path: >-
            dataArea/priceEquation[1]/formulaIdentifier/externalIdentifier/storeIdentifier/uniqueID
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/PriceEquation'
          x-entity-path: 'dataArea/priceEquation[1]'
      responses:
        '201':
          description: The operation is successful.
          headers:
            Location:
              description: The URI of the price equation.
              type: string
          x-entity-path: 'dataArea/priceEquation[1]/formulaIdentifier/uniqueID'
      summary: Create a price equation.
      x-action-code: Create
      x-expression-template: '/PriceEquation[1]'
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: processPriceEquation
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.ProcessPriceEquationType
  /price-equations/by-name-or-description:
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: The name pattern to search.
          in: query
          name: searchText
          required: true
          type: string
        - description: >-
            The position within the resulting dataset where the query begins
            returning item records. If the offset is "5", the records that
            returned begin with the sixth record that matches the query
            parameters. If the offset is "0", the records that are returned
            begin with the first record that matches the query parameters.
          format: int32
          in: query
          name: offset
          required: false
          type: integer
          x-entity-path: dataArea/get/recordSetStartNumber
        - description: The maximum number of records to return.
          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/PriceEquationCollection'
          x-entity-path: dataArea/priceEquation
      summary: Search price rules by name or description.
      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.price.facade.client.PriceFacadeClient
      x-facade-client-method: getPriceEquation
      x-parameters:
        accessProfile: IBM_Admin_Summary
        template: >-
          /PriceEquation[search(FormulaIdentifier/ExternalIdentifier/Name='$searchText$'
          or Description='$searchText$')]
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.GetPriceEquationType
  '/price-equations/by-price-constant-id/{priceConstantId}':
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the price constant.
          format: int64
          in: path
          name: priceConstantId
          required: true
          type: integer
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: >-
            The position within the resulting dataset where the query begins
            returning item records. If the offset is "5", the records that
            returned begin with the sixth record that matches the query
            parameters. If the offset is "0", the records that are returned
            begin with the first record that matches the query parameters.
          format: int32
          in: query
          name: offset
          required: false
          type: integer
          x-entity-path: dataArea/get/recordSetStartNumber
        - description: The maximum number of records to return.
          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/PriceEquationCollection'
          x-entity-path: dataArea/priceEquation
          x-support-paging: false
      summary: Get all price equations which reference the price constant.
      x-expression-template: >-
        {_wcf.ap=IBM_Admin_Details}/PriceEquation[PriceEquationEntry[PriceEquationEntryFormat='PriceConstant'
        and Value='{priceConstantId}']]
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: getPriceEquation
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.GetPriceEquationType
  '/price-equations/by-price-list-id/{priceListId}':
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the price list.
          format: int64
          in: path
          name: priceListId
          required: true
          type: integer
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: >-
            The position within the resulting dataset where the query begins
            returning item records. If the offset is "5", the records that
            returned begin with the sixth record that matches the query
            parameters. If the offset is "0", the records that are returned
            begin with the first record that matches the query parameters.
          format: int32
          in: query
          name: offset
          required: false
          type: integer
          x-entity-path: dataArea/get/recordSetStartNumber
        - description: The maximum number of records to return.
          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/PriceEquationCollection'
          x-entity-path: dataArea/priceEquation
          x-support-paging: false
      summary: Get all price equations which reference the price constant.
      x-expression-template: >-
        {_wcf.ap=IBM_Admin_Details}/PriceEquation[PriceEquationEntry[PriceEquationEntryFormat='PriceList'
        and Value='{priceListId}']]
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: getPriceEquation
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.GetPriceEquationType
  '/price-equations/{id}':
    delete:
      parameters:
        - description: The unique numeric ID for identifying the price equation.
          format: int64
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/priceEquation[1]/formulaIdentifier/uniqueID'
      responses:
        '204':
          description: The operation is successful.
      summary: Deletes a price equation.
      x-action-code: Delete
      x-expression-template: '/PriceEquation[1]'
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: processPriceEquation
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.ProcessPriceEquationType
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the price equation.
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/PriceEquation'
          x-entity-path: 'dataArea/priceEquation[1]'
      summary: Get a price equation.
      x-expression-template: >-
        {_wcf.ap='IBM_Admin_Details'}/PriceEquation/FormulaIdentifier[(UniqueID='{id}')]
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: getPriceEquation
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.GetPriceEquationType
    patch:
      consumes:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the price equation.
          format: int64
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/priceEquation[1]/formulaIdentifier/uniqueID'
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/PriceEquation'
          x-entity-path: 'dataArea/priceEquation[1]'
      responses:
        '200':
          description: The operation is successful.
      summary: Updates a price equation.
      x-action-code: Change
      x-expression-template: '/PriceEquation[1]'
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: changePriceEquation
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.ChangePriceEquationType
  '/price-equations/{id}/compose':
    post:
      parameters:
        - description: The unique numeric ID for identifying the price equation.
          format: int64
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/priceEquation[1]/formulaIdentifier/uniqueID'
      responses:
        '200':
          description: The operation is successful.
      summary: Composes a price equation.
      x-action-code: Compose
      x-expression-template: '/PriceEquation[1]'
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: processPriceEquation
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.ProcessPriceEquationType
  '/price-equations/{id}/entries':
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the price equation.
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        '200':
          schema:
            $ref: '#/definitions/PriceEquationCollection'
          x-entity-path: 'dataArea/priceEquation[1]/priceEquationEntry'
          x-support-paging: false
      summary: Get entries of a price equation.
      x-expression-template: >-
        {_wcf.ap='IBM_Admin_PriceEquationEntryDetails'}/PriceEquation/FormulaIdentifier[(UniqueID='{id}')]
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: getPriceEquation
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.GetPriceEquationType
    post:
      consumes:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the price equation.
          format: int64
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/priceEquation[1]/formulaIdentifier/uniqueID'
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/PriceEquationEntry'
          x-entity-path: 'dataArea/priceEquation[1]/priceEquationEntry[1]'
      responses:
        '201':
          description: The operation is successful.
          headers:
            Location:
              description: The URI of the price equation entry.
              type: string
          x-entity-path: >-
            dataArea/priceEquation[1]/priceEquationEntry[1]/priceEquationEntryIdentifier/uniqueID
      summary: Adds an entry to a price equation.
      x-action-code: Add
      x-expression-template: '/PriceEquation[1]/PriceEquationEntry[1]'
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: changePriceEquation
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.ChangePriceEquationType
      x-request-verb: change
      x-response-verb: respond
  '/price-equations/{id}/entries/{entryId}':
    delete:
      parameters:
        - description: The unique numeric ID for identifying the price equation.
          format: int64
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/priceEquation[1]/formulaIdentifier/uniqueID'
        - description: The unique numeric ID for identifying the price equation entry.
          in: path
          name: entryId
          required: true
          type: string
          x-entity-path: >-
            dataArea/priceEquation[1]/priceEquationEntry[1]/priceEquationEntryIdentifier/uniqueID
      responses:
        '204':
          description: The operation is successful.
      summary: Deletes a price equation entry.
      x-action-code: Delete
      x-expression-template: '/PriceEquation[1]/PriceEquationEntry[1]'
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: changePriceEquation
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.ChangePriceEquationType
      x-request-verb: change
      x-response-verb: respond
    patch:
      consumes:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the price equation.
          format: int64
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/priceEquation[1]/formulaIdentifier/uniqueID'
        - description: The unique numeric ID for identifying the price equation entry.
          in: path
          name: entryId
          required: true
          type: string
          x-entity-path: >-
            dataArea/priceEquation[1]/priceEquationEntry/priceEquationEntryIdentifier/uniqueID
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/PriceEquationEntry'
          x-entity-path: 'dataArea/priceEquation[1]/priceEquationEntry[1]'
      responses:
        '200':
          description: The operation is successful.
      summary: Updates a price equation entry.
      x-action-code: Change
      x-expression-template: '/PriceEquation[1]/PriceEquationEntry[1]'
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: changePriceEquation
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.ChangePriceEquationType
definitions:
  PriceEquation:
    description: A price equation.
    properties:
      createdDate:
        description: Created time.
        format: date-time
        type: string
        x-entity-path: createdTime
      description:
        description: >-
          A description of the price equation, suitable for display to business
          users.
        type: string
        x-entity-path: description
      entries:
        items:
          $ref: '#/definitions/PriceEquationEntry'
        type: array
        x-entity-path: priceEquationEntry
      id:
        description: The unique numeric ID for identifying the price equation.
        format: int64
        type: integer
        x-entity-path: formulaIdentifier/uniqueID
      name:
        description: The name of the price equation.
        type: string
        x-entity-path: formulaIdentifier/externalIdentifier/name
      storeId:
        description: The unique numeric ID for identifying the store.
        format: int64
        type: integer
        x-entity-path: formulaIdentifier/externalIdentifier/storeIdentifier/uniqueID
      updatedDate:
        description: Last updated time.
        format: date-time
        type: string
        x-entity-path: lastUpdateTime
      value:
        description: The value of the price equation.
        type: string
        x-entity-path: value
    type: object
    x-entity-class: com.ibm.commerce.price.facade.datatypes.PriceEquationType
  PriceEquationCollection:
    description: A collection of price equations.
    properties:
      count:
        format: int64
        type: integer
      items:
        items:
          $ref: '#/definitions/PriceEquation'
        type: array
    type: object
  PriceEquationEntry:
    description: A price equation entry.
    properties:
      format:
        description: The format of the price equation entry
        type: string
        x-entity-path: priceEquationEntryFormat
      id:
        description: The unique numeric ID for identifying the price equation entry.
        format: int64
        type: integer
        x-entity-path: priceEquationEntryIdentifier/uniqueID
      sequence:
        description: The sequence of this equation entry for the same equation.
        format: double
        type: number
        x-entity-path: priceEquationEntrySequence
      value:
        description: The value of the equation entry.
        type: string
        x-entity-path: value
    type: object
    x-entity-class: com.ibm.commerce.price.facade.datatypes.PriceEquationEntryType
  PriceEquationEntryCollection:
    description: A collection of price equation entries.
    properties:
      count:
        format: int64
        type: integer
      items:
        items:
          $ref: '#/definitions/PriceEquationEntry'
        type: array
    type: object
x-components: {}
