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

# Create inventory



## OpenAPI

````yaml https://app.buylo.ai/api/documentation/swagger/openapi.yaml post /api/inventory
openapi: 3.1.1
info:
  title: Buylo - company external API
  version: 1.0.0
  description: >-
    API endpoints for managing products and EPCs in the Buylo system. Use
    company token for authentication.
servers:
  - url: https://app.buylo.ai/
security:
  - bearerAuth: []
paths:
  /api/inventory:
    post:
      tags:
        - Inventories
      summary: Create inventory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InventoryCreateRequest'
      responses:
        '200':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Inventory'
                required:
                  - data
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidResponse'
        '403':
          description: Invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    InventoryCreateRequest:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
          example: Monthly stock check
        type:
          type: string
          description: Must be one of the server enum values
          example: WAREHOUSE
        statuses:
          type: array
          items:
            type: string
          nullable: true
          example:
            - in_stock
            - lost
        warehouse_node_id:
          type: integer
          nullable: true
          description: Required when type=WAREHOUSE
          example: 44
        location_id:
          type: integer
          nullable: true
          description: Required when type=LOCATION
          example: 21
        epcs:
          type: array
          nullable: true
          items:
            type: string
          description: Optional list of EPC IDs to include
      required:
        - name
        - type
    Inventory:
      type: object
      properties:
        id:
          type: integer
          example: 12
        name:
          type: string
          example: Monthly stock check
        type:
          type: string
          description: Inventory type
          example: WAREHOUSE
        warehouse_node_id:
          type: integer
          nullable: true
          example: 44
        warehouse_node_path:
          type: string
          nullable: true
          example: WH/ZoneA/Rack-03
        location_id:
          type: integer
          nullable: true
          example: 21
        location_name:
          type: string
          nullable: true
          example: Showroom
        statuses:
          type: array
          items:
            type: string
          nullable: true
          example:
            - in_stock
            - lost
        created_at:
          type: string
          format: date-time
          example: '2025-10-22T08:12:34Z'
        total_epcs:
          type: integer
          example: 57
        unique_products:
          type: integer
          example: 12
        items:
          type: array
          items:
            $ref: '#/components/schemas/InventoryItem'
    InvalidResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message describing the issue
      required:
        - message
    InventoryItem:
      type: object
      properties:
        id:
          type: integer
          example: 17
        product_id:
          type: integer
          nullable: true
          example: 501
        product_name:
          type: string
          nullable: true
          example: ACME Mug
        ean:
          type: string
          nullable: true
          example: '8591234567890'
        count:
          type: integer
          description: Distinct EPC group count for the item
          example: 3
        epc_hashes:
          type: array
          items:
            type: object
            properties:
              hash:
                type: string
                example: 8aaedfc3559d0ce545ca55bcea31aad2
              warehouse_location:
                type: string
                nullable: true
                example: WH/ZoneA/Rack-03/Shelf-2
        created_at:
          type: string
          format: date-time
          example: '2025-10-22T08:12:34Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````