{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/frihet-io/json-schema/frihet-io-inventory-balance-schema.json",
  "title": "InventoryBalance",
  "description": "One balance row from `GET /v1/inventory/balances`. The legacy\n`stockQuantity` is the user-supplied product stock; `ledgerAtoms`\nis the projection at the receiving location; `valuation` is the\nmoving-average snapshot (null until an opening run writes it).\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/frihet-io-inventory-api-openapi.yml#/components/schemas/InventoryBalance",
  "type": "object",
  "properties": {
    "itemId": {
      "type": "string"
    },
    "locationId": {
      "type": "string"
    },
    "legacyStockQuantity": {
      "type": "integer",
      "description": "Stored on `products.stockQuantity`, NOT scaled."
    },
    "ledgerAtoms": {
      "type": "string",
      "description": "Hex-fixed-point integer at scale 6 (read with BigInt)."
    },
    "valuation": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "currency": {
          "type": [
            "string",
            "null"
          ]
        },
        "valueMinor": {
          "type": "string"
        },
        "valuedAtoms": {
          "type": "string"
        },
        "unvaluedAtoms": {
          "type": "string"
        },
        "uncoveredAtoms": {
          "type": "string"
        }
      }
    }
  }
}