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

# Inventory actions

> Single RPC-style endpoint. Set `action` in the JSON body:
- `health` — no auth required
- `list` — requires Bearer API key




## OpenAPI

````yaml /openapi/inventory.yaml post /inventory
openapi: 3.1.0
info:
  title: Keystone Inventory API
  version: 1.0.0
  description: Server-to-server inventory for Keystone B2B partners.
servers:
  - url: https://api.keystoneb2b.io/v1
security:
  - bearerAuth: []
paths:
  /inventory:
    post:
      summary: Inventory actions
      description: |
        Single RPC-style endpoint. Set `action` in the JSON body:
        - `health` — no auth required
        - `list` — requires Bearer API key
      operationId: inventoryAction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/HealthRequest'
                - $ref: '#/components/schemas/ListRequest'
            examples:
              health:
                summary: Health check
                value:
                  action: health
              listAll:
                summary: Paginated list
                value:
                  action: list
                  limit: 100
                  offset: 0
              listSkus:
                summary: Specific SKUs
                value:
                  action: list
                  skus:
                    - E-CC26-01
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/HealthResponse'
                  - $ref: '#/components/schemas/ListResponse'
                  - $ref: '#/components/schemas/ErrorResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security: []
components:
  schemas:
    HealthRequest:
      type: object
      required:
        - action
      properties:
        action:
          type: string
          enum:
            - health
    ListRequest:
      type: object
      required:
        - action
      properties:
        action:
          type: string
          enum:
            - list
        limit:
          type: integer
          minimum: 1
          maximum: 500
          default: 100
        offset:
          type: integer
          minimum: 0
          default: 0
        skus:
          type: array
          maxItems: 200
          items:
            type: string
    HealthResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        service:
          type: string
          example: inventory-truth-api
        timestamp:
          type: string
          format: date-time
    ListResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          type: array
          items:
            $ref: '#/components/schemas/InventorySkuRow'
        limit:
          type: integer
        offset:
          type: integer
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
    InventorySkuRow:
      type: object
      properties:
        sku:
          type: string
        immediate_inventory:
          type: object
          properties:
            usa:
              type: integer
            canada:
              type: integer
        future_inventory:
          type: object
          properties:
            usa:
              type: array
              items:
                $ref: '#/components/schemas/FutureEtaLine'
            canada:
              type: array
              items:
                $ref: '#/components/schemas/FutureEtaLine'
        refreshed_at:
          type: string
          format: date-time
    FutureEtaLine:
      type: object
      properties:
        expected_date:
          type: string
          format: date
          nullable: true
        quantity:
          type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Tenant API key issued by Keystone

````