swagger: '2.0'
info:
  title: Price Constant Admininistrative REST APIs
  version: '2.0'
paths:
  /price-constants:
    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/PriceConstantCollection'
          x-entity-path: dataArea/priceConstant
      summary: Get the price constants in a store.
      x-expression-template: '{_wcf.ap=''IBM_Admin_Summary''}/PriceConstant'
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: getPriceConstant
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.GetPriceConstantType
    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/priceConstant[1]/priceConstantIdentifier/externalIdentifier/storeIdentifier/uniqueID
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/PriceConstant'
          x-entity-path: 'dataArea/priceConstant[1]'
      responses:
        '201':
          description: The operation is successful.
          headers:
            Location:
              description: The URI of the price constant.
              type: string
          x-entity-path: 'dataArea/priceConstant[1]/priceConstantIdentifier/uniqueID'
      summary: Create a price constant.
      x-action-code: Create
      x-expression-template: '/PriceConstant[1]'
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: processPriceConstant
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.ProcessPriceConstantType
  /price-constants/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/PriceConstantCollection'
          x-entity-path: dataArea/priceConstant
      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: getPriceConstant
      x-parameters:
        accessProfile: IBM_Admin_Summary
        template: >-
          /PriceConstant[search(PriceConstantIdentifier/ExternalIdentifier/Name='$searchText$'
          or Description='$searchText$')]
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.GetPriceConstantType
  '/price-constants/{id}':
    delete:
      parameters:
        - description: The unique numeric ID for identifying the price constant.
          format: int64
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/priceConstant[1]/priceConstantIdentifier/uniqueID'
      responses:
        '204':
          description: The operation is successful.
      summary: Delete a price constant.
      x-action-code: Delete
      x-expression-template: '/PriceConstant[1]'
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: processPriceConstant
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.ProcessPriceConstantType
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the price constant.
          format: int64
          in: path
          name: id
          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
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/PriceConstant'
          x-entity-path: 'dataArea/priceConstant[1]'
      summary: Get a price constant.
      x-expression-template: >-
        {_wcf.ap='IBM_Admin_Details'}/PriceConstant/PriceConstantIdentifier[(UniqueID='{id}')]
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: getPriceConstant
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.GetPriceConstantType
    patch:
      consumes:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the price constant.
          format: int64
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/priceConstant[1]/priceConstantIdentifier/uniqueID'
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/PriceConstant'
          x-entity-path: 'dataArea/priceConstant[1]'
      responses:
        '200':
          description: The operation is successful.
      summary: Update a price constant.
      x-action-code: Change
      x-expression-template: '/PriceConstant[1]'
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: changePriceConstant
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.ChangePriceConstantType
  '/price-constants/{id}/currency-values':
    patch:
      consumes:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the price constant.
          format: int64
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/priceConstant[1]/priceConstantIdentifier/uniqueID'
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/MonetaryAmount'
          x-entity-path: >-
            dataArea/priceConstant[1]/values/monetaryValue/alternativeCurrencyValue[1]
      responses:
        '200':
          description: The operation is successful.
      summary: Update a currency value of a price constant.
      x-action-code: Change
      x-expression-template: '/PriceConstant[1]/Values/MonetaryValue/AlternativeCurrencyValue[1]'
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: changePriceConstant
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.ChangePriceConstantType
      x-request-verb: change
      x-response-verb: respond
    post:
      consumes:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the price constant.
          format: int64
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/priceConstant[1]/priceConstantIdentifier/uniqueID'
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/MonetaryAmount'
          x-entity-path: >-
            dataArea/priceConstant[1]/values/monetaryValue/alternativeCurrencyValue[1]
      responses:
        '201':
          description: The operation is successful.
          headers:
            Location:
              description: The URI of the price constant.
              type: string
          x-entity-path: 'dataArea/priceConstant[1]//priceConstantIdentifier/uniqueID'
      summary: Add a currency value to a price constant.
      x-action-code: Add
      x-expression-template: '/PriceConstant[1]/Values/MonetaryValue/AlternativeCurrencyValue[1]'
      x-facade-client-class: com.ibm.commerce.price.facade.client.PriceFacadeClient
      x-facade-client-method: changePriceConstant
      x-request-bod-class: com.ibm.commerce.price.facade.datatypes.ChangePriceConstantType
      x-request-verb: change
      x-response-verb: respond
definitions:
  MonetaryAmount:
    description: The monetary value of the constant entry.
    properties:
      currency:
        description: The currency of the monetary amount.
        type: string
        x-entity-path: currency
      value:
        description: The value of the monetary amount.
        format: double
        type: number
        x-entity-path: value
    type: object
    x-entity-class: com.ibm.commerce.foundation.common.datatypes.MonetaryAmountType
  MonetaryValue:
    description: The monetary value of the constant entry.
    properties:
      alternativeCurrencyValues:
        items:
          $ref: '#/definitions/MonetaryAmount'
        type: array
        x-entity-path: alternativeCurrencyValue
      defaultCurrencyValue:
        $ref: '#/definitions/MonetaryAmount'
        description: The default currency value of the constant entry.
        x-entity-path: defaultCurrencyValue
    type: object
    x-entity-class: com.ibm.commerce.price.facade.datatypes.MonetaryValueType
  PriceConstant:
    description: A price constant.
    properties:
      createdDate:
        description: Created time.
        format: date-time
        type: string
        x-entity-path: createdTime
      description:
        description: >-
          A description of the price constant, suitable for display to business
          users.
        type: string
        x-entity-path: description
      format:
        description: 'Indicates the type of the constant:Percent, Number or MonetaryAmount'
        type: string
        x-entity-path: format
      id:
        description: The unique numeric ID for identifying the price constant.
        format: int64
        type: integer
        x-entity-path: priceConstantIdentifier/uniqueID
      name:
        description: The name of the price constant.
        type: string
        x-entity-path: priceConstantIdentifier/externalIdentifier/name
      storeId:
        description: The unique numeric ID for identifying the store.
        format: int64
        type: integer
        x-entity-path: priceConstantIdentifier/externalIdentifier/storeIdentifier/uniqueID
      updatedDate:
        description: Last updated time.
        format: date-time
        type: string
        x-entity-path: lastUpdateTime
      values:
        $ref: '#/definitions/PriceConstantValue'
        x-entity-path: values
    type: object
    x-entity-class: com.ibm.commerce.price.facade.datatypes.PriceConstantType
  PriceConstantCollection:
    description: A collection of price constants.
    properties:
      count:
        format: int64
        type: integer
      items:
        items:
          $ref: '#/definitions/PriceConstant'
        type: array
    type: object
  PriceConstantValue:
    description: A price constant value.
    properties:
      monetaryValue:
        $ref: '#/definitions/MonetaryValue'
        description: The monetary value of the constant entry.
        x-entity-path: monetaryValue
      numberValue:
        description: The value of the price constant.
        format: double
        type: number
        x-entity-path: numberValue
    type: object
    x-entity-class: com.ibm.commerce.price.facade.datatypes.PriceConstantValueType
  PriceConstantValueCollection:
    description: A collection of price constant values.
    properties:
      count:
        format: int64
        type: integer
      items:
        items:
          $ref: '#/definitions/PriceConstantValue'
        type: array
    type: object
x-components: {}
