swagger: '2.0'
info:
  version: '2.0'
  title: inventory-availabilities
consumes:
  - application/json
produces:
  - application/json
paths:
  /inventory-availabilities:
    get:
      tags:
        - inventory-availabilities
      description: Get a collection of inventory records.
      operationId: getInventoryAvailabilities
      parameters:
        - name: id
          in: query
          description: The available inventory ID.
          required: false
          type: integer
          format: int64
        - name: availableQuantity
          in: query
          description: The available quantity of the item at the location specified.
          required: false
          type: number
          format: double
        - name: availabilityDate
          in: query
          description: The availability date of the item at the location specified.
          required: false
          type: string
          format: date-time
        - name: availabilityOffset
          in: query
          description: The number of seconds from the time when the inventory checking is performed to the time when the product is available.
          required: false
          type: integer
          format: int32
        - name: updatedDate
          in: query
          description: The time this record was last updated.
          required: false
          type: string
          format: date-time
        - 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: catalogEntryId
          in: query
          description: The catalog entry ID.
          required: false
          type: integer
          format: int64
        - name: storeId
          in: query
          description: 'The online store ID. Either this or the physical store ID must be specified, but not both.'
          required: false
          type: integer
          format: int32
        - name: storeLocationId
          in: query
          description: 'The physical store ID. Either this or the online store ID must be specified, but not both.'
          required: false
          type: integer
          format: int32
        - name: quantityUnit
          in: query
          description: The unit of measure of the quantity above. Default value is C62.
          required: false
          type: string
        - name: inventoryStatus
          in: query
          description: 'The inventory status of the item at the location specified. Predefined values include, AVL = Available, BA = Backorderable, UAVL = Unavailable.'
          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 records.
          schema:
            $ref: '#/definitions/InventoryAvailabilityCollection'
        '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-availabilities
      description: Create an inventory record.
      operationId: createInventoryAvailability
      parameters:
        - in: body
          name: InventoryAvailability
          description: DOM inventory.
          required: true
          schema:
            $ref: '#/definitions/InventoryAvailability'
      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-availabilities/{id}':
    get:
      tags:
        - inventory-availabilities
      description: Get an inventory record.
      operationId: getInventoryAvailabilityById
      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.
          schema:
            $ref: '#/definitions/InventoryAvailability'
        '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-availabilities
      description: Delete an inventory record.
      operationId: deleteInventoryAvailabilityById
      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-availabilities
      description: Update an inventory record.
      operationId: updateInventoryAvailabilityById
      parameters:
        - in: body
          name: InventoryAvailability
          description: DOM inventory.
          required: true
          schema:
            $ref: '#/definitions/InventoryAvailability'
      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 available inventory 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.
  InventoryAvailability:
    type: object
    properties:
      id:
        type: integer
        format: int64
        description: The available inventory ID.
      availableQuantity:
        type: number
        format: double
        description: The available quantity of the item at the location specified.
      availabilityDate:
        type: string
        format: date-time
        description: The availability date of the item at the location specified.
      availabilityOffset:
        type: integer
        format: int32
        description: The number of seconds from the time when the inventory checking is performed to the time when the product is available.
      updatedDate:
        type: string
        format: date-time
        description: The time this record was last updated.
      field1:
        type: integer
        format: int32
        description: Customizable.
      field2:
        type: number
        format: double
        description: Customizable.
      field3:
        type: string
        description: Customizable.
      catalogEntryId:
        type: integer
        format: int64
        description: The catalog entry ID.
      storeId:
        type: integer
        format: int32
        description: 'The online store ID. Either this or the physical store ID must be specified, but not both.'
      storeLocationId:
        type: integer
        format: int32
        description: 'The physical store ID. Either this or the online store ID must be specified, but not both.'
      quantityUnit:
        type: string
        description: The unit of measure of the quantity above. Default value is C62.
      inventoryStatus:
        type: string
        description: 'The inventory status of the item at the location specified. Predefined values include, AVL = Available, BA = Backorderable, UAVL = Unavailable.'
    description: DOM inventory.
  InventoryAvailabilityCollection:
    type: object
    properties:
      count:
        type: integer
        format: int64
        description: The total number of items.
      items:
        type: array
        description: The items.
        items:
          $ref: '#/definitions/InventoryAvailability'
    description: A collection of DOM inventory records.
