swagger: '2.0'
info:
  version: '2.0'
  title: inventory-configurations
consumes:
  - application/json
produces:
  - application/json
paths:
  /inventory-configurations:
    get:
      tags:
        - inventory-configurations
      description: Get a collection of inventory configurations.
      operationId: getInventoryConfigurations
      parameters:
        - name: id
          in: query
          description: The inventory configuration ID.
          required: false
          type: integer
          format: int64
        - name: identifier
          in: query
          description: The external identifier of this inventory configuration.
          required: false
          type: string
        - name: description
          in: query
          description: The administrative description of this inventory configuration.
          required: false
          type: string
        - name: precedence
          in: query
          description: The precedence of this inventory configuration when an item is associated with multiple inventory configurations at the location specified.
          required: false
          type: number
          format: double
        - name: flags
          in: query
          description: 'The bit field for specifying the following inventory configuration options, 0 = The default value. None of the following flags are applicable, 1 = Cache inventory availability in a WebSphere distributed object cache, 2 = Cache inventory availability in the Commerce database, 4 = Retrieve inventory availability from DOM by making an outbound GetInventoryAvailability service request when the information is not cached locally, or when the cached information is no longer valid, 8 = Decrement the cached inventory availability records when an order/shopping cart is submitted for processing, 16 = Update the cached inventory availability records as the information is retrieved from DOM.'
          required: false
          type: integer
          format: int32
        - name: thresholdQuantity
          in: query
          description: 'The threshold quantity. It determines the expiry time used. A value of NULL is equivalent to a value of negative infinity, which means that the cached available quantity (minus the requested quantity if present) is always greater than or equal to the threshold quantity.'
          required: false
          type: number
          format: double
        - name: expiryAboveThreshold
          in: query
          description: 'The expiry time of a cached inventory availability record when the cached available quantity (minus the requested quantity if present) is greater than or equal to the threshold quantity. Such a record has expired when the number of seconds elapsed since the record was last updated is greater than this value. A value of 0 means that the record expires immediately, and a value of NULL means that the record never expires.'
          required: false
          type: integer
          format: int32
        - name: expiryBelowThreshold
          in: query
          description: 'The expiry time of a cached inventory availability record when the cached available quantity (minus the requested quantity if present) is less than the threshold quantity. Such a record has expired when the number of seconds elapsed since the record was last updated is greater than this value. A value of 0 means that the record expires immediately, and a value of NULL means that the record never expires.'
          required: false
          type: integer
          format: int32
        - name: cachePriority
          in: query
          description: The priority of a cached inventory availability record when cached in the WebSphere distributed object cache. Records with higher priorities will remain in the cache longer than those with lower priorities in the case of cache overflow.
          required: false
          type: integer
          format: int32
        - name: fallbackInventoryStatus
          in: query
          description: The fallback inventory status.
          required: false
          type: string
        - name: fallBackAvailabilityDate
          in: query
          description: The fallback availability date.
          required: false
          type: string
          format: date-time
        - name: fallBackAvailabilityOffset
          in: query
          description: The fallback availability offset in seconds.
          required: false
          type: integer
          format: int32
        - name: field1
          in: query
          description: Customizable.
          required: false
          type: integer
          format: int32
        - name: field2
          in: query
          description: Customizable.
          required: false
          type: number
          format: double
        - name: field3
          in: query
          description: Customizable.
          required: false
          type: string
        - name: quantityUnit
          in: query
          description: The unit of measure of the quantity above.
          required: false
          type: string
        - name: offset
          in: query
          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.'
          required: false
          type: integer
          format: int32
        - name: limit
          in: query
          description: The maximum number of records to return.
          required: false
          type: integer
          format: int32
        - name: fields
          in: query
          description: 'The comma-separated set of properties to be returned. If no properties are specified, all properties are returned.'
          required: false
          type: string
        - name: expand
          in: query
          description: 'The comma-separated set of related resources referenced in the links to be returned. If no related resources are specified, no related resources are returned.'
          required: false
          type: string
      responses:
        '200':
          description: A collection of DOM inventory configurations.
          schema:
            $ref: '#/definitions/InventoryConfigurationCollection'
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    post:
      tags:
        - inventory-configurations
      description: Create an inventory configuration.
      operationId: createInventoryConfiguration
      parameters:
        - in: body
          name: InventoryConfiguration
          description: DOM inventory configurations.
          required: true
          schema:
            $ref: '#/definitions/InventoryConfiguration'
      responses:
        '201':
          description: The operation was successful.
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
  '/inventory-configurations/{id}':
    get:
      tags:
        - inventory-configurations
      description: Get an inventory configuration.
      operationId: getInventoryConfigurationById
      parameters:
        - name: fields
          in: query
          description: 'The comma-separated set of properties to be returned. If no properties are specified, all properties are returned.'
          required: false
          type: string
        - name: expand
          in: query
          description: 'The comma-separated set of related resources referenced in the links to be returned. If no related resources are specified, no related resources are returned.'
          required: false
          type: string
      responses:
        '200':
          description: DOM inventory configurations.
          schema:
            $ref: '#/definitions/InventoryConfiguration'
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '404':
          description: The resource was not found.
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    delete:
      tags:
        - inventory-configurations
      description: Delete an inventory configuration.
      operationId: deleteInventoryConfigurationById
      parameters: []
      responses:
        '204':
          description: The operation was successful.
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '404':
          description: The resource was not found.
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    patch:
      tags:
        - inventory-configurations
      description: Update an inventory configuration.
      operationId: updateInventoryConfigurationById
      parameters:
        - in: body
          name: InventoryConfiguration
          description: DOM inventory configurations.
          required: true
          schema:
            $ref: '#/definitions/InventoryConfiguration'
      responses:
        '200':
          description: The operation was successful.
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '404':
          description: The resource was not found.
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    parameters:
      - name: id
        in: path
        description: The inventory configuration ID.
        required: true
        type: integer
        format: int64
definitions:
  Link:
    type: object
    properties:
      href:
        type: string
        format: uri
        description: The URL of the link.
    description: Links to related resources.
  Error:
    type: object
    properties:
      code:
        type: string
        description: The error message code.
      message:
        type: string
        description: The error message.
      messageKey:
        type: string
        description: The error message key.
      messageArguments:
        type: array
        description: The arguments used to construct the error message.
        items:
          type: object
      correlationId:
        type: string
        description: The unique identifier for the request.
      locale:
        type: string
        description: The locale of the error message.
    description: The error message item model.
  ErrorResponseContainer:
    type: object
    properties:
      requestId:
        type: string
        description: The request identifier.
      errors:
        type: array
        description: The errors.
        items:
          $ref: '#/definitions/Error'
    description: The error message model.
  InventoryConfiguration:
    type: object
    properties:
      id:
        type: integer
        format: int64
        description: The inventory configuration ID.
      identifier:
        type: string
        description: The external identifier of this inventory configuration.
      description:
        type: string
        description: The administrative description of this inventory configuration.
      precedence:
        type: number
        format: double
        description: The precedence of this inventory configuration when an item is associated with multiple inventory configurations at the location specified.
      flags:
        type: integer
        format: int32
        description: 'The bit field for specifying the following inventory configuration options, 0 = The default value. None of the following flags are applicable, 1 = Cache inventory availability in a WebSphere distributed object cache, 2 = Cache inventory availability in the Commerce database, 4 = Retrieve inventory availability from DOM by making an outbound GetInventoryAvailability service request when the information is not cached locally, or when the cached information is no longer valid, 8 = Decrement the cached inventory availability records when an order/shopping cart is submitted for processing, 16 = Update the cached inventory availability records as the information is retrieved from DOM.'
      thresholdQuantity:
        type: number
        format: double
        description: 'The threshold quantity. It determines the expiry time used. A value of NULL is equivalent to a value of negative infinity, which means that the cached available quantity (minus the requested quantity if present) is always greater than or equal to the threshold quantity.'
      expiryAboveThreshold:
        type: integer
        format: int32
        description: 'The expiry time of a cached inventory availability record when the cached available quantity (minus the requested quantity if present) is greater than or equal to the threshold quantity. Such a record has expired when the number of seconds elapsed since the record was last updated is greater than this value. A value of 0 means that the record expires immediately, and a value of NULL means that the record never expires.'
      expiryBelowThreshold:
        type: integer
        format: int32
        description: 'The expiry time of a cached inventory availability record when the cached available quantity (minus the requested quantity if present) is less than the threshold quantity. Such a record has expired when the number of seconds elapsed since the record was last updated is greater than this value. A value of 0 means that the record expires immediately, and a value of NULL means that the record never expires.'
      cachePriority:
        type: integer
        format: int32
        description: The priority of a cached inventory availability record when cached in the WebSphere distributed object cache. Records with higher priorities will remain in the cache longer than those with lower priorities in the case of cache overflow.
      fallbackInventoryStatus:
        type: string
        description: The fallback inventory status.
      fallBackAvailabilityDate:
        type: string
        format: date-time
        description: The fallback availability date.
      fallBackAvailabilityOffset:
        type: integer
        format: int32
        description: The fallback availability offset in seconds.
      field1:
        type: integer
        format: int32
        description: Customizable.
      field2:
        type: number
        format: double
        description: Customizable.
      field3:
        type: string
        description: Customizable.
      quantityUnit:
        type: string
        description: The unit of measure of the quantity above.
    description: DOM inventory configurations.
  InventoryConfigurationCollection:
    type: object
    properties:
      count:
        type: integer
        format: int64
        description: The total number of items.
      items:
        type: array
        description: The items.
        items:
          $ref: '#/definitions/InventoryConfiguration'
    description: A collection of DOM inventory configurations.
