> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kibocommerce.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Aggregate

> Aggregates inventory.



## OpenAPI

````yaml /openapi/openapi_inventory.json post /commerce/inventory/v5/inventory/aggregate
openapi: 3.0.0
info:
  description: |-
    <div id="overview_INVENTORY">
                <h2>INVENTORY</h2>
                <p>Use the Inventory API to retrieve the inventory levels of requested products, refresh and adjust current
                    stock levels at fulfillment locations, and tag segmented inventory for different channels. When using tags for inventory segmentation, inventory records are separated into categories to identify
                    which portions of its
                    total quantity are intended for different channels, customer groups, fulfillment methods, or other
                    needs.
                    This allows for setting a percentage of the quantity that would be available for each category and
                    setting discrete units at the location level as available for each category. For example, tags could
                    define how much of each
                    inventory record is set aside for a certain sales channel: the Kibo storefront, Walmart, or Amazon. The
                    percentages of the
                    inventory allotted for each channel would add up to 100% - the Kibo storefront could have 80% of the
                    inventory, Amazon 10%, and Walmart 10%. For more information, see the <a href="/developer-guides/inventory">Inventory guides</a>.</p>
                <p>Use the <strong>Inventory</strong>, <strong>Inventory Allocation</strong>, and <strong>Modify Inventory</strong> resources to retrieve and update inventory levels.</p>  
                <p>Use the <strong>Inventory Job</strong> resource to retrieve information about your pending inventory update processing jobs.</p> 
                <p>Use the <strong>Inventory Tag</strong> and <strong>Tag Category</strong> resources to segment your inventory records.</p> 
            </div>
  title: Inventory
  version: 0.0.1
servers:
  - description: Kibo Base URL
    url: '{baseUrl}/api'
    variables:
      baseUrl:
        default: https://t1000000.sb.usc1.gcp.kibocommerce.com
        description: Base URL
security:
  - bearerAuth: []
paths:
  /commerce/inventory/v5/inventory/aggregate:
    post:
      tags:
        - Inventory
      summary: Aggregate
      description: Aggregates inventory.
      parameters:
        - description: Site ID
          in: query
          name: x-vol-site
          required: false
          schema:
            type: integer
      requestBody:
        $ref: '#/components/requestBodies/AggregateRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/AggregateResponse'
                type: array
          description: Success
        '400':
          description: Bad Request
components:
  requestBodies:
    AggregateRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AggregateRequest'
      description: Request to aggregate inventory
      required: true
  schemas:
    AggregateResponse:
      description: Response for aggregating Inventory
      properties:
        available:
          description: The quantity the location has that are available for purchase
          type: integer
        floor:
          description: >-
            Absolute minimum quantity of this item that should be in stock at
            any time
          type: integer
        messages:
          description: List of messages
          items:
            type: string
          type: array
        numResults:
          description: Number of results
          type: integer
        onHand:
          description: The quantity the location has in its possession
          type: integer
        partNumber:
          description: Part/Product Number
          type: string
        sku:
          description: Stock Keeping Unit
          type: string
        success:
          description: Flag for success
          type: boolean
        tags:
          $ref: '#/components/schemas/tags'
        tenantID:
          description: Manufacturer Identifier
          type: integer
        upc:
          description: Universal Product Code
          type: string
      title: Aggregate Response
      type: object
    AggregateRequest:
      description: Request for aggregating inventory
      properties:
        directShip:
          description: Whether to limit results to locations that are shipping enabled
          type: boolean
        forceDefaultsForUnspecifiedTagCategories:
          description: >-
            Whether to force populate default tags onto the request if they are
            unspecified for any tag category
          type: boolean
        futureEndDate:
          description: Future end Date at which the inventory should be allocated against.
          format: date-time
          type: string
        futureStartDate:
          description: >-
            Future start Date at which the inventory should be allocated
            against.
          format: date-time
          type: string
        ignoreSafetyStock:
          description: Whether to ignore the safety stock buffer put in place
          type: boolean
        includeFutureInventory:
          description: 'Enum for including future inventory: [futureOnly, futureAndCurrent]'
          enum:
            - futureOnly
            - futureAndCurrent
          type: string
        includeNegativeFutureInventory:
          description: Whether to allow items with negative future inventory in the results
          type: boolean
        includeNegativeInventory:
          description: Whether to allow items with negative inventory in the results
          type: boolean
        items:
          description: List of Items to search on
          items:
            $ref: '#/components/schemas/InventoryItem'
          type: array
        locationCode:
          description: Location Code
          title: location code
          type: string
        pageNum:
          description: which page to show
          type: integer
        pageSize:
          description: how many results to show per page
          type: integer
        pickup:
          description: Filter results by pickup enabled (true) or not (false)
          type: boolean
        sortBy:
          description: index to sort results by
          type: string
        tags:
          $ref: '#/components/schemas/tags'
        transferEnabled:
          description: >-
            Filter results by locations that have transfer enabled (true) or
            don't (false)
          type: boolean
        userID:
          description: user id
          type: integer
      title: Aggregate Request
      type: object
    tags:
      additionalProperties:
        type: string
      description: Associative Map of <String, String> for tagCategoryName => tagName
      type: object
    InventoryItem:
      description: Item
      properties:
        condition:
          type: string
        date:
          format: date-time
          type: string
        lotCode:
          type: string
        partNumber:
          description: Part/Product Number
          type: string
        serialNumber:
          type: string
        sku:
          description: Stock Keeping Unit
          type: string
        tags:
          $ref: '#/components/schemas/tags'
        upc:
          description: Universal Product Code
          type: string
      title: Item
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: JWT Authorization header using the Bearer scheme.
      scheme: bearer
      type: http

````