{"openapi":"3.1.0","info":{"title":"Inventory Intelligence API","version":"1.0.0","description":"Read supplied sales, stock, and lead-time records to calculate reorder points, safety stock, and demand forecasts without creating purchase orders. Paid with x402 exact USDC on Base. No account is required.","contact":{"email":"support@brainiac.software"},"x-guidance":"BRAINIAC.software is a pay-per-call API for software agents. No account or API key is required.\nPayment uses the x402 protocol with exact USDC on Base (chain id 8453). Each POST operation has a fixed USD price.\nHow to call an operation:\n1. POST a JSON body matching the operation's requestBody schema to the operation path. Include an Idempotency-Key header (64 hex characters, 32 random bytes).\n2. If you have not paid, the server responds 402 with payment requirements in the body. Pay the exact amount to the payTo address on Base.\n3. Retry the identical request with the same Idempotency-Key and add a payment-signature header containing the x402 payment payload. On success (200) the operation result is returned.\n4. Reuse the same Idempotency-Key only for retries of the same operation and request body; it will not be charged twice.\nAll outputs are compliance prechecks, drafts, or data lookups for human review. They are not official determinations, legal advice, identity confirmation, or certified filings. Verify time-sensitive or official data with the cited source before acting."},"servers":[{"url":"https://www.brainiac.software"}],"paths":{"/api/v1/inventory-intelligence/data-normalize":{"post":{"operationId":"normalize_inventory_data","summary":"Normalize inventory data","description":"Copy supplied products, sales, supplier lead times, and purchases into a consistent inventory packet. Missing lead times and prices are not invented.","tags":["inventory-intelligence"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","maxLength":200000},"json":{"type":"string","maxLength":200000},"csv":{"type":"string","maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/plain","text/csv","application/json"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"products":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"onHand":{"type":"number","minimum":0,"maximum":1000000000},"onOrder":{"type":"number","minimum":0,"maximum":1000000000},"unitCost":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"sales":{"maxItems":2000,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"date":{"type":"string","maxLength":40},"units":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"suppliers":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"supplierId":{"type":"string","maxLength":80},"leadTimeDays":{"type":"number","minimum":0,"maximum":3650},"moq":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"purchases":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"date":{"type":"string","maxLength":40},"units":{"type":"number","minimum":0,"maximum":1000000000},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"asOf":{"type":"string","maxLength":40},"serviceLevelZ":{"type":"number","minimum":0,"maximum":5},"reviewDays":{"type":"number","minimum":0,"maximum":365},"excessDaysCover":{"type":"number","minimum":1,"maximum":3650},"slowUnits":{"type":"number","minimum":0,"maximum":1000000000},"slowDays":{"type":"number","minimum":1,"maximum":3650},"forecastDays":{"type":"integer","minimum":1,"maximum":365},"historyDays":{"type":"integer","minimum":1,"maximum":3650}},"additionalProperties":false},"example":{"text":"Product: SKU-1 | Widget | 40 | 10 | 2.5\nSale: SKU-1 | 2026-11-01 | 8\nSupplier: SKU-1 | SUP-1 | 7 | 20\nPurchase: SKU-1 | 2026-10-20 | 50 | 2.1\nCreate a purchase order now.\n"}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"status":{"type":"string"},"products":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"onHand":{"type":"number"},"onHandSupplied":{"type":"boolean"},"onOrder":{"type":"number"},"onOrderSupplied":{"type":"boolean"},"unitCost":{"type":"number"},"unitCostSupplied":{"type":"boolean"},"saleCount":{"type":"number"},"purchaseCount":{"type":"number"},"leadTimeDaysSupplied":{"type":"boolean"}},"additionalProperties":true}},"sales":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"date":{"type":"string"},"units":{"type":"number"},"unitsSupplied":{"type":"boolean"}},"additionalProperties":true}},"suppliers":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"supplierId":{"type":"string"},"leadTimeDays":{"type":"number"},"leadTimeDaysSupplied":{"type":"boolean"},"moq":{"type":"number"},"moqSupplied":{"type":"boolean"}},"additionalProperties":true}},"purchases":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"date":{"type":"string"},"units":{"type":"number"},"unitsSupplied":{"type":"boolean"},"unitPrice":{"type":"number"},"unitPriceSupplied":{"type":"boolean"}},"additionalProperties":true}},"assumptions":{"type":"array","items":{"type":"string"}},"purchaseOrderCreated":{"type":"boolean"},"inventorySystemAccessed":{"type":"boolean"},"leadTimeInvented":{"type":"boolean"},"demandInvented":{"type":"boolean"},"priceInvented":{"type":"boolean"},"findings":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"code":{"type":"string"},"subject":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-04T19:00:00.000Z","status":"normalized","products":[{"sku":"SKU-1","name":"Widget","onHand":40,"onHandSupplied":true,"onOrder":10,"onOrderSupplied":true,"unitCost":2.5,"unitCostSupplied":true,"saleCount":1,"purchaseCount":1,"leadTimeDaysSupplied":true}],"sales":[{"sku":"SKU-1","date":"2026-11-01","units":8,"unitsSupplied":true}],"suppliers":[{"sku":"SKU-1","supplierId":"SUP-1","leadTimeDays":7,"leadTimeDaysSupplied":true,"moq":20,"moqSupplied":true}],"purchases":[{"sku":"SKU-1","date":"2026-10-20","units":50,"unitsSupplied":true,"unitPrice":2.1,"unitPriceSupplied":true}],"assumptions":["serviceLevelZ=1.65 (explicit normal z factor for safety stock)","reviewDays=0","historyDays=90","forecastDays=30","excessDaysCover=90","slowUnits=5 over slowDays=90","Daily demand average fills missing days in the history window with zero when a history end date exists.","Seasonality is not added. Only variation already present in the supplied history affects the standard deviation."],"purchaseOrderCreated":false,"inventorySystemAccessed":false,"leadTimeInvented":false,"demandInvented":false,"priceInvented":false,"findings":[{"kind":"ignored","code":"unlabeled_line","subject":"","detail":"Lines without a recognized label were not read and their text was not copied."}],"limitations":["Products, sales, supplier lead times, and purchases are copied only from labeled fields supplied by the caller.","Reorder point = average daily demand × (lead time days + review days) + safety stock.","Safety stock = service-level z × daily demand standard deviation × square root of lead time days.","Demand forecasts use a simple average of available history only. Seasonality is not modeled unless present in that history.","Lead times, demand, and purchase prices are never invented. No purchase order is created and no inventory system is accessed."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{}}]}}},"/api/v1/inventory-intelligence/stockout-risk-calculate":{"post":{"operationId":"calculate_stockout_risk","summary":"Calculate stockout risk","description":"Compare available stock with the calculated reorder point from supplied demand and lead times. Risk is not calculated when lead time or demand history is missing.","tags":["inventory-intelligence"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","maxLength":200000},"json":{"type":"string","maxLength":200000},"csv":{"type":"string","maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/plain","text/csv","application/json"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"products":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"onHand":{"type":"number","minimum":0,"maximum":1000000000},"onOrder":{"type":"number","minimum":0,"maximum":1000000000},"unitCost":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"sales":{"maxItems":2000,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"date":{"type":"string","maxLength":40},"units":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"suppliers":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"supplierId":{"type":"string","maxLength":80},"leadTimeDays":{"type":"number","minimum":0,"maximum":3650},"moq":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"purchases":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"date":{"type":"string","maxLength":40},"units":{"type":"number","minimum":0,"maximum":1000000000},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"asOf":{"type":"string","maxLength":40},"serviceLevelZ":{"type":"number","minimum":0,"maximum":5},"reviewDays":{"type":"number","minimum":0,"maximum":365},"excessDaysCover":{"type":"number","minimum":1,"maximum":3650},"slowUnits":{"type":"number","minimum":0,"maximum":1000000000},"slowDays":{"type":"number","minimum":1,"maximum":3650},"forecastDays":{"type":"integer","minimum":1,"maximum":365},"historyDays":{"type":"integer","minimum":1,"maximum":3650}},"additionalProperties":false},"example":{"asOf":"2026-11-10","historyDays":5,"serviceLevelZ":1.65,"reviewDays":0,"products":[{"sku":"SKU-1","name":"Widget","onHand":20,"onOrder":0}],"suppliers":[{"sku":"SKU-1","supplierId":"SUP-1","leadTimeDays":4}],"sales":[{"sku":"SKU-1","date":"2026-11-06","units":8},{"sku":"SKU-1","date":"2026-11-07","units":12},{"sku":"SKU-1","date":"2026-11-08","units":8},{"sku":"SKU-1","date":"2026-11-09","units":12},{"sku":"SKU-1","date":"2026-11-10","units":10}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"status":{"type":"string"},"atRiskCount":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"available":{"type":"number"},"availableSupplied":{"type":"boolean"},"reorderPoint":{"type":"number"},"reorderPointSupplied":{"type":"boolean"},"belowReorderPoint":{"type":"boolean"},"stockoutRiskCalculated":{"type":"boolean"},"averageDailyDemand":{"type":"number"},"demandSupplied":{"type":"boolean"},"leadTimeDays":{"type":"number"},"leadTimeDaysSupplied":{"type":"boolean"},"daysCover":{"type":"number"},"daysCoverSupplied":{"type":"boolean"},"riskLevel":{"type":"string"}},"additionalProperties":true}},"assumptions":{"type":"array","items":{"type":"string"}},"purchaseOrderCreated":{"type":"boolean"},"inventorySystemAccessed":{"type":"boolean"},"leadTimeInvented":{"type":"boolean"},"demandInvented":{"type":"boolean"},"priceInvented":{"type":"boolean"},"findings":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-04T19:00:00.000Z","status":"calculated","atRiskCount":1,"items":[{"sku":"SKU-1","name":"Widget","available":20,"availableSupplied":true,"reorderPoint":45.9,"reorderPointSupplied":true,"belowReorderPoint":true,"stockoutRiskCalculated":true,"averageDailyDemand":10,"demandSupplied":true,"leadTimeDays":4,"leadTimeDaysSupplied":true,"daysCover":2,"daysCoverSupplied":true,"riskLevel":"elevated"}],"assumptions":["serviceLevelZ=1.65 (explicit normal z factor for safety stock)","reviewDays=0","historyDays=5","forecastDays=30","excessDaysCover=90","slowUnits=5 over slowDays=90","Daily demand average fills missing days in the history window with zero when a history end date exists.","Seasonality is not added. Only variation already present in the supplied history affects the standard deviation."],"purchaseOrderCreated":false,"inventorySystemAccessed":false,"leadTimeInvented":false,"demandInvented":false,"priceInvented":false,"findings":[],"limitations":["Products, sales, supplier lead times, and purchases are copied only from labeled fields supplied by the caller.","Reorder point = average daily demand × (lead time days + review days) + safety stock.","Safety stock = service-level z × daily demand standard deviation × square root of lead time days.","Demand forecasts use a simple average of available history only. Seasonality is not modeled unless present in that history.","Lead times, demand, and purchase prices are never invented. No purchase order is created and no inventory system is accessed."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"protocols":[{"x402":{}}]}}},"/api/v1/inventory-intelligence/reorder-point-calculate":{"post":{"operationId":"calculate_reorder_points","summary":"Calculate reorder points","description":"Calculate reorderPoint = averageDailyDemand × (leadTimeDays + reviewDays) + safetyStock from supplied history and lead times. No purchase order is created.","tags":["inventory-intelligence"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","maxLength":200000},"json":{"type":"string","maxLength":200000},"csv":{"type":"string","maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/plain","text/csv","application/json"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"products":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"onHand":{"type":"number","minimum":0,"maximum":1000000000},"onOrder":{"type":"number","minimum":0,"maximum":1000000000},"unitCost":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"sales":{"maxItems":2000,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"date":{"type":"string","maxLength":40},"units":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"suppliers":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"supplierId":{"type":"string","maxLength":80},"leadTimeDays":{"type":"number","minimum":0,"maximum":3650},"moq":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"purchases":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"date":{"type":"string","maxLength":40},"units":{"type":"number","minimum":0,"maximum":1000000000},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"asOf":{"type":"string","maxLength":40},"serviceLevelZ":{"type":"number","minimum":0,"maximum":5},"reviewDays":{"type":"number","minimum":0,"maximum":365},"excessDaysCover":{"type":"number","minimum":1,"maximum":3650},"slowUnits":{"type":"number","minimum":0,"maximum":1000000000},"slowDays":{"type":"number","minimum":1,"maximum":3650},"forecastDays":{"type":"integer","minimum":1,"maximum":365},"historyDays":{"type":"integer","minimum":1,"maximum":3650}},"additionalProperties":false},"example":{"asOf":"2026-11-10","historyDays":5,"serviceLevelZ":1.65,"reviewDays":1,"products":[{"sku":"SKU-1","name":"Widget","onHand":30,"onOrder":0}],"suppliers":[{"sku":"SKU-1","supplierId":"SUP-1","leadTimeDays":4,"moq":20}],"sales":[{"sku":"SKU-1","date":"2026-11-06","units":8},{"sku":"SKU-1","date":"2026-11-07","units":12},{"sku":"SKU-1","date":"2026-11-08","units":8},{"sku":"SKU-1","date":"2026-11-09","units":12},{"sku":"SKU-1","date":"2026-11-10","units":10}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"status":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"averageDailyDemand":{"type":"number"},"demandStdev":{"type":"number"},"demandSupplied":{"type":"boolean"},"leadTimeDays":{"type":"number"},"leadTimeDaysSupplied":{"type":"boolean"},"reviewDays":{"type":"number"},"serviceLevelZ":{"type":"number"},"safetyStock":{"type":"number"},"safetyStockSupplied":{"type":"boolean"},"demandDuringLead":{"type":"number"},"demandDuringLeadSupplied":{"type":"boolean"},"reorderPoint":{"type":"number"},"reorderPointSupplied":{"type":"boolean"},"available":{"type":"number"},"availableSupplied":{"type":"boolean"},"suggestedOrder":{"type":"number"},"suggestedOrderSupplied":{"type":"boolean"},"moq":{"type":"number"},"moqSupplied":{"type":"boolean"},"formula":{"type":"string"},"purchaseOrderCreated":{"type":"boolean"}},"additionalProperties":true}},"assumptions":{"type":"array","items":{"type":"string"}},"purchaseOrderCreated":{"type":"boolean"},"inventorySystemAccessed":{"type":"boolean"},"leadTimeInvented":{"type":"boolean"},"demandInvented":{"type":"boolean"},"priceInvented":{"type":"boolean"},"findings":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-04T19:00:00.000Z","status":"calculated","items":[{"sku":"SKU-1","name":"Widget","averageDailyDemand":10,"demandStdev":1.7889,"demandSupplied":true,"leadTimeDays":4,"leadTimeDaysSupplied":true,"reviewDays":1,"serviceLevelZ":1.65,"safetyStock":5.9,"safetyStockSupplied":true,"demandDuringLead":50,"demandDuringLeadSupplied":true,"reorderPoint":55.9,"reorderPointSupplied":true,"available":30,"availableSupplied":true,"suggestedOrder":25.9,"suggestedOrderSupplied":true,"moq":20,"moqSupplied":true,"formula":"reorderPoint = averageDailyDemand × (leadTimeDays + reviewDays) + safetyStock","purchaseOrderCreated":false}],"assumptions":["serviceLevelZ=1.65 (explicit normal z factor for safety stock)","reviewDays=1","historyDays=5","forecastDays=30","excessDaysCover=90","slowUnits=5 over slowDays=90","Daily demand average fills missing days in the history window with zero when a history end date exists.","Seasonality is not added. Only variation already present in the supplied history affects the standard deviation."],"purchaseOrderCreated":false,"inventorySystemAccessed":false,"leadTimeInvented":false,"demandInvented":false,"priceInvented":false,"findings":[],"limitations":["Products, sales, supplier lead times, and purchases are copied only from labeled fields supplied by the caller.","Reorder point = average daily demand × (lead time days + review days) + safety stock.","Safety stock = service-level z × daily demand standard deviation × square root of lead time days.","Demand forecasts use a simple average of available history only. Seasonality is not modeled unless present in that history.","Lead times, demand, and purchase prices are never invented. No purchase order is created and no inventory system is accessed."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"protocols":[{"x402":{}}]}}},"/api/v1/inventory-intelligence/safety-stock-calculate":{"post":{"operationId":"calculate_safety_stock","summary":"Calculate safety stock","description":"Calculate safetyStock = serviceLevelZ × demandStdev × sqrt(leadTimeDays). Short history raises disclosed uncertainty. Seasonality is not invented.","tags":["inventory-intelligence"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","maxLength":200000},"json":{"type":"string","maxLength":200000},"csv":{"type":"string","maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/plain","text/csv","application/json"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"products":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"onHand":{"type":"number","minimum":0,"maximum":1000000000},"onOrder":{"type":"number","minimum":0,"maximum":1000000000},"unitCost":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"sales":{"maxItems":2000,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"date":{"type":"string","maxLength":40},"units":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"suppliers":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"supplierId":{"type":"string","maxLength":80},"leadTimeDays":{"type":"number","minimum":0,"maximum":3650},"moq":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"purchases":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"date":{"type":"string","maxLength":40},"units":{"type":"number","minimum":0,"maximum":1000000000},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"asOf":{"type":"string","maxLength":40},"serviceLevelZ":{"type":"number","minimum":0,"maximum":5},"reviewDays":{"type":"number","minimum":0,"maximum":365},"excessDaysCover":{"type":"number","minimum":1,"maximum":3650},"slowUnits":{"type":"number","minimum":0,"maximum":1000000000},"slowDays":{"type":"number","minimum":1,"maximum":3650},"forecastDays":{"type":"integer","minimum":1,"maximum":365},"historyDays":{"type":"integer","minimum":1,"maximum":3650}},"additionalProperties":false},"example":{"asOf":"2026-11-10","historyDays":5,"serviceLevelZ":1.65,"suppliers":[{"sku":"SKU-1","leadTimeDays":4}],"sales":[{"sku":"SKU-1","date":"2026-11-06","units":8},{"sku":"SKU-1","date":"2026-11-07","units":12},{"sku":"SKU-1","date":"2026-11-08","units":8},{"sku":"SKU-1","date":"2026-11-09","units":12},{"sku":"SKU-1","date":"2026-11-10","units":10}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"status":{"type":"string"},"serviceLevelZ":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"serviceLevelZ":{"type":"number"},"demandStdev":{"type":"number"},"demandSupplied":{"type":"boolean"},"leadTimeDays":{"type":"number"},"leadTimeDaysSupplied":{"type":"boolean"},"historyDaysUsed":{"type":"number"},"safetyStock":{"type":"number"},"safetyStockSupplied":{"type":"boolean"},"formula":{"type":"string"},"uncertainty":{"type":"string"}},"additionalProperties":true}},"assumptions":{"type":"array","items":{"type":"string"}},"purchaseOrderCreated":{"type":"boolean"},"inventorySystemAccessed":{"type":"boolean"},"leadTimeInvented":{"type":"boolean"},"demandInvented":{"type":"boolean"},"priceInvented":{"type":"boolean"},"findings":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"code":{"type":"string"},"subject":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-04T19:00:00.000Z","status":"calculated","serviceLevelZ":1.65,"items":[{"sku":"SKU-1","name":"SKU-1","serviceLevelZ":1.65,"demandStdev":1.7889,"demandSupplied":true,"leadTimeDays":4,"leadTimeDaysSupplied":true,"historyDaysUsed":5,"safetyStock":5.9,"safetyStockSupplied":true,"formula":"safetyStock = serviceLevelZ × demandStdev × sqrt(leadTimeDays)","uncertainty":"high"}],"assumptions":["serviceLevelZ=1.65 (explicit normal z factor for safety stock)","reviewDays=0","historyDays=5","forecastDays=30","excessDaysCover=90","slowUnits=5 over slowDays=90","Daily demand average fills missing days in the history window with zero when a history end date exists.","Seasonality is not added. Only variation already present in the supplied history affects the standard deviation."],"purchaseOrderCreated":false,"inventorySystemAccessed":false,"leadTimeInvented":false,"demandInvented":false,"priceInvented":false,"findings":[{"kind":"observation","code":"history_short","subject":"SKU-1","detail":"Only 5 history day(s) were available. Safety stock uncertainty is high and seasonality is not modeled."}],"limitations":["Products, sales, supplier lead times, and purchases are copied only from labeled fields supplied by the caller.","Reorder point = average daily demand × (lead time days + review days) + safety stock.","Safety stock = service-level z × daily demand standard deviation × square root of lead time days.","Demand forecasts use a simple average of available history only. Seasonality is not modeled unless present in that history.","Lead times, demand, and purchase prices are never invented. No purchase order is created and no inventory system is accessed."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"protocols":[{"x402":{}}]}}},"/api/v1/inventory-intelligence/excess-detect":{"post":{"operationId":"detect_excess_inventory","summary":"Detect excess inventory","description":"Flag SKUs whose days of cover from supplied on-hand and average daily demand exceed the disclosed excessDaysCover threshold.","tags":["inventory-intelligence"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","maxLength":200000},"json":{"type":"string","maxLength":200000},"csv":{"type":"string","maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/plain","text/csv","application/json"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"products":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"onHand":{"type":"number","minimum":0,"maximum":1000000000},"onOrder":{"type":"number","minimum":0,"maximum":1000000000},"unitCost":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"sales":{"maxItems":2000,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"date":{"type":"string","maxLength":40},"units":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"suppliers":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"supplierId":{"type":"string","maxLength":80},"leadTimeDays":{"type":"number","minimum":0,"maximum":3650},"moq":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"purchases":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"date":{"type":"string","maxLength":40},"units":{"type":"number","minimum":0,"maximum":1000000000},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"asOf":{"type":"string","maxLength":40},"serviceLevelZ":{"type":"number","minimum":0,"maximum":5},"reviewDays":{"type":"number","minimum":0,"maximum":365},"excessDaysCover":{"type":"number","minimum":1,"maximum":3650},"slowUnits":{"type":"number","minimum":0,"maximum":1000000000},"slowDays":{"type":"number","minimum":1,"maximum":3650},"forecastDays":{"type":"integer","minimum":1,"maximum":365},"historyDays":{"type":"integer","minimum":1,"maximum":3650}},"additionalProperties":false},"example":{"asOf":"2026-11-10","historyDays":5,"excessDaysCover":30,"products":[{"sku":"SKU-1","name":"Widget","onHand":500},{"sku":"SKU-2","name":"Gadget","onHand":20}],"sales":[{"sku":"SKU-1","date":"2026-11-06","units":2},{"sku":"SKU-1","date":"2026-11-07","units":2},{"sku":"SKU-1","date":"2026-11-08","units":2},{"sku":"SKU-1","date":"2026-11-09","units":2},{"sku":"SKU-1","date":"2026-11-10","units":2},{"sku":"SKU-2","date":"2026-11-06","units":5},{"sku":"SKU-2","date":"2026-11-07","units":5},{"sku":"SKU-2","date":"2026-11-08","units":5},{"sku":"SKU-2","date":"2026-11-09","units":5},{"sku":"SKU-2","date":"2026-11-10","units":5}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"status":{"type":"string"},"excessDaysCover":{"type":"number"},"excessCount":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"onHand":{"type":"number"},"averageDailyDemand":{"type":"number"},"demandSupplied":{"type":"boolean"},"daysCover":{"type":"number"},"daysCoverSupplied":{"type":"boolean"},"thresholdDays":{"type":"number"},"excess":{"type":"boolean"},"excessUnits":{"type":"number"},"reason":{"type":"string"}},"additionalProperties":true}},"assumptions":{"type":"array","items":{"type":"string"}},"purchaseOrderCreated":{"type":"boolean"},"inventorySystemAccessed":{"type":"boolean"},"leadTimeInvented":{"type":"boolean"},"demandInvented":{"type":"boolean"},"priceInvented":{"type":"boolean"},"findings":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"code":{"type":"string"},"subject":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-04T19:00:00.000Z","status":"detected","excessDaysCover":30,"excessCount":1,"items":[{"sku":"SKU-1","name":"Widget","onHand":500,"averageDailyDemand":2,"demandSupplied":true,"daysCover":250,"daysCoverSupplied":true,"thresholdDays":30,"excess":true,"excessUnits":440,"reason":"days_cover_over_threshold"},{"sku":"SKU-2","name":"Gadget","onHand":20,"averageDailyDemand":5,"demandSupplied":true,"daysCover":4,"daysCoverSupplied":true,"thresholdDays":30,"excess":false,"excessUnits":0,"reason":"within_threshold"}],"assumptions":["serviceLevelZ=1.65 (explicit normal z factor for safety stock)","reviewDays=0","historyDays=5","forecastDays=30","excessDaysCover=30","slowUnits=5 over slowDays=90","Daily demand average fills missing days in the history window with zero when a history end date exists.","Seasonality is not added. Only variation already present in the supplied history affects the standard deviation."],"purchaseOrderCreated":false,"inventorySystemAccessed":false,"leadTimeInvented":false,"demandInvented":false,"priceInvented":false,"findings":[{"kind":"missing","code":"lead_time","subject":"SKU-1","detail":"No supplier lead time was supplied for this SKU. Lead time was not invented."},{"kind":"missing","code":"lead_time","subject":"SKU-2","detail":"No supplier lead time was supplied for this SKU. Lead time was not invented."}],"limitations":["Products, sales, supplier lead times, and purchases are copied only from labeled fields supplied by the caller.","Reorder point = average daily demand × (lead time days + review days) + safety stock.","Safety stock = service-level z × daily demand standard deviation × square root of lead time days.","Demand forecasts use a simple average of available history only. Seasonality is not modeled unless present in that history.","Lead times, demand, and purchase prices are never invented. No purchase order is created and no inventory system is accessed."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{}}]}}},"/api/v1/inventory-intelligence/slow-moving-stock-detect":{"post":{"operationId":"detect_slow_moving_stock","summary":"Detect slow-moving stock","description":"Flag SKUs whose supplied unit sales over the disclosed lookback are at or below the slowUnits threshold.","tags":["inventory-intelligence"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","maxLength":200000},"json":{"type":"string","maxLength":200000},"csv":{"type":"string","maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/plain","text/csv","application/json"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"products":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"onHand":{"type":"number","minimum":0,"maximum":1000000000},"onOrder":{"type":"number","minimum":0,"maximum":1000000000},"unitCost":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"sales":{"maxItems":2000,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"date":{"type":"string","maxLength":40},"units":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"suppliers":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"supplierId":{"type":"string","maxLength":80},"leadTimeDays":{"type":"number","minimum":0,"maximum":3650},"moq":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"purchases":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"date":{"type":"string","maxLength":40},"units":{"type":"number","minimum":0,"maximum":1000000000},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"asOf":{"type":"string","maxLength":40},"serviceLevelZ":{"type":"number","minimum":0,"maximum":5},"reviewDays":{"type":"number","minimum":0,"maximum":365},"excessDaysCover":{"type":"number","minimum":1,"maximum":3650},"slowUnits":{"type":"number","minimum":0,"maximum":1000000000},"slowDays":{"type":"number","minimum":1,"maximum":3650},"forecastDays":{"type":"integer","minimum":1,"maximum":365},"historyDays":{"type":"integer","minimum":1,"maximum":3650}},"additionalProperties":false},"example":{"asOf":"2026-11-10","slowDays":5,"slowUnits":5,"products":[{"sku":"SKU-SLOW","onHand":100},{"sku":"SKU-FAST","onHand":10}],"sales":[{"sku":"SKU-SLOW","date":"2026-11-08","units":1},{"sku":"SKU-FAST","date":"2026-11-06","units":4},{"sku":"SKU-FAST","date":"2026-11-07","units":4},{"sku":"SKU-FAST","date":"2026-11-08","units":4},{"sku":"SKU-FAST","date":"2026-11-09","units":4},{"sku":"SKU-FAST","date":"2026-11-10","units":4}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"status":{"type":"string"},"slowDays":{"type":"number"},"slowUnits":{"type":"number"},"slowCount":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"onHand":{"type":"number"},"onHandSupplied":{"type":"boolean"},"unitsSold":{"type":"number"},"lookbackDays":{"type":"number"},"thresholdUnits":{"type":"number"},"slow":{"type":"boolean"},"datedSaleCount":{"type":"number"}},"additionalProperties":true}},"assumptions":{"type":"array","items":{"type":"string"}},"purchaseOrderCreated":{"type":"boolean"},"inventorySystemAccessed":{"type":"boolean"},"leadTimeInvented":{"type":"boolean"},"demandInvented":{"type":"boolean"},"priceInvented":{"type":"boolean"},"findings":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-04T19:00:00.000Z","status":"detected","slowDays":5,"slowUnits":5,"slowCount":1,"items":[{"sku":"SKU-SLOW","name":"SKU-SLOW","onHand":100,"onHandSupplied":true,"unitsSold":1,"lookbackDays":5,"thresholdUnits":5,"slow":true,"datedSaleCount":1},{"sku":"SKU-FAST","name":"SKU-FAST","onHand":10,"onHandSupplied":true,"unitsSold":20,"lookbackDays":5,"thresholdUnits":5,"slow":false,"datedSaleCount":5}],"assumptions":["serviceLevelZ=1.65 (explicit normal z factor for safety stock)","reviewDays=0","historyDays=90","forecastDays=30","excessDaysCover=90","slowUnits=5 over slowDays=5","Daily demand average fills missing days in the history window with zero when a history end date exists.","Seasonality is not added. Only variation already present in the supplied history affects the standard deviation."],"purchaseOrderCreated":false,"inventorySystemAccessed":false,"leadTimeInvented":false,"demandInvented":false,"priceInvented":false,"findings":[],"limitations":["Products, sales, supplier lead times, and purchases are copied only from labeled fields supplied by the caller.","Reorder point = average daily demand × (lead time days + review days) + safety stock.","Safety stock = service-level z × daily demand standard deviation × square root of lead time days.","Demand forecasts use a simple average of available history only. Seasonality is not modeled unless present in that history.","Lead times, demand, and purchase prices are never invented. No purchase order is created and no inventory system is accessed."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{}}]}}},"/api/v1/inventory-intelligence/demand-forecast":{"post":{"operationId":"forecast_inventory_demand","summary":"Forecast inventory demand","description":"Forecast units as averageDailyDemand × forecastDays from available dated sales only. Seasonality is not modeled and uncertainty is disclosed.","tags":["inventory-intelligence"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","maxLength":200000},"json":{"type":"string","maxLength":200000},"csv":{"type":"string","maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/plain","text/csv","application/json"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"products":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"onHand":{"type":"number","minimum":0,"maximum":1000000000},"onOrder":{"type":"number","minimum":0,"maximum":1000000000},"unitCost":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"sales":{"maxItems":2000,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"date":{"type":"string","maxLength":40},"units":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"suppliers":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"supplierId":{"type":"string","maxLength":80},"leadTimeDays":{"type":"number","minimum":0,"maximum":3650},"moq":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"purchases":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"date":{"type":"string","maxLength":40},"units":{"type":"number","minimum":0,"maximum":1000000000},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"asOf":{"type":"string","maxLength":40},"serviceLevelZ":{"type":"number","minimum":0,"maximum":5},"reviewDays":{"type":"number","minimum":0,"maximum":365},"excessDaysCover":{"type":"number","minimum":1,"maximum":3650},"slowUnits":{"type":"number","minimum":0,"maximum":1000000000},"slowDays":{"type":"number","minimum":1,"maximum":3650},"forecastDays":{"type":"integer","minimum":1,"maximum":365},"historyDays":{"type":"integer","minimum":1,"maximum":3650}},"additionalProperties":false},"example":{"asOf":"2026-11-10","historyDays":5,"forecastDays":7,"sales":[{"sku":"SKU-1","date":"2026-11-06","units":8},{"sku":"SKU-1","date":"2026-11-07","units":12},{"sku":"SKU-1","date":"2026-11-08","units":8},{"sku":"SKU-1","date":"2026-11-09","units":12},{"sku":"SKU-1","date":"2026-11-10","units":10}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"status":{"type":"string"},"forecastDays":{"type":"number"},"historyDays":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"method":{"type":"string"},"forecastDays":{"type":"number"},"historyDaysUsed":{"type":"number"},"averageDailyDemand":{"type":"number"},"demandStdev":{"type":"number"},"demandSupplied":{"type":"boolean"},"forecastUnits":{"type":"number"},"forecastUnitsSupplied":{"type":"boolean"},"uncertainty":{"type":"string"},"seasonalityModeled":{"type":"boolean"},"assumption":{"type":"string"}},"additionalProperties":true}},"assumptions":{"type":"array","items":{"type":"string"}},"purchaseOrderCreated":{"type":"boolean"},"inventorySystemAccessed":{"type":"boolean"},"leadTimeInvented":{"type":"boolean"},"demandInvented":{"type":"boolean"},"priceInvented":{"type":"boolean"},"findings":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"code":{"type":"string"},"subject":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-04T19:00:00.000Z","status":"forecasted","forecastDays":7,"historyDays":5,"items":[{"sku":"SKU-1","name":"SKU-1","method":"simple_daily_average","forecastDays":7,"historyDaysUsed":5,"averageDailyDemand":10,"demandStdev":1.7889,"demandSupplied":true,"forecastUnits":70,"forecastUnitsSupplied":true,"uncertainty":"high","seasonalityModeled":false,"assumption":"forecastUnits = averageDailyDemand × forecastDays, using only sales dated on or before 2026-11-10."}],"assumptions":["serviceLevelZ=1.65 (explicit normal z factor for safety stock)","reviewDays=0","historyDays=5","forecastDays=7","excessDaysCover=90","slowUnits=5 over slowDays=90","Daily demand average fills missing days in the history window with zero when a history end date exists.","Seasonality is not added. Only variation already present in the supplied history affects the standard deviation.","Forecast method is a simple historical daily average. No external demand signal is used."],"purchaseOrderCreated":false,"inventorySystemAccessed":false,"leadTimeInvented":false,"demandInvented":false,"priceInvented":false,"findings":[{"kind":"observation","code":"forecast_uncertainty","subject":"SKU-1","detail":"Forecast uses a simple average over 5 day(s). Seasonality is not modeled. Uncertainty=high."}],"limitations":["Products, sales, supplier lead times, and purchases are copied only from labeled fields supplied by the caller.","Reorder point = average daily demand × (lead time days + review days) + safety stock.","Safety stock = service-level z × daily demand standard deviation × square root of lead time days.","Demand forecasts use a simple average of available history only. Seasonality is not modeled unless present in that history.","Lead times, demand, and purchase prices are never invented. No purchase order is created and no inventory system is accessed."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"protocols":[{"x402":{}}]}}},"/api/v1/inventory-intelligence/optimization-report":{"post":{"operationId":"report_inventory_optimization","summary":"Report inventory optimization","description":"Combine stockout risk, reorder points, safety stock, excess, slow-moving stock, and demand forecasts from supplied data. No purchase order is created.","tags":["inventory-intelligence"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","maxLength":200000},"json":{"type":"string","maxLength":200000},"csv":{"type":"string","maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/plain","text/csv","application/json"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"products":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"onHand":{"type":"number","minimum":0,"maximum":1000000000},"onOrder":{"type":"number","minimum":0,"maximum":1000000000},"unitCost":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"sales":{"maxItems":2000,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"date":{"type":"string","maxLength":40},"units":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"suppliers":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"supplierId":{"type":"string","maxLength":80},"leadTimeDays":{"type":"number","minimum":0,"maximum":3650},"moq":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"purchases":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","maxLength":80},"date":{"type":"string","maxLength":40},"units":{"type":"number","minimum":0,"maximum":1000000000},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"asOf":{"type":"string","maxLength":40},"serviceLevelZ":{"type":"number","minimum":0,"maximum":5},"reviewDays":{"type":"number","minimum":0,"maximum":365},"excessDaysCover":{"type":"number","minimum":1,"maximum":3650},"slowUnits":{"type":"number","minimum":0,"maximum":1000000000},"slowDays":{"type":"number","minimum":1,"maximum":3650},"forecastDays":{"type":"integer","minimum":1,"maximum":365},"historyDays":{"type":"integer","minimum":1,"maximum":3650}},"additionalProperties":false},"example":{"asOf":"2026-11-10","historyDays":5,"forecastDays":7,"serviceLevelZ":1.65,"reviewDays":0,"excessDaysCover":30,"slowDays":5,"slowUnits":5,"products":[{"sku":"SKU-1","name":"Widget","onHand":20,"onOrder":0,"unitCost":2.5},{"sku":"SKU-SLOW","name":"Shelfware","onHand":200}],"suppliers":[{"sku":"SKU-1","supplierId":"SUP-1","leadTimeDays":4,"moq":20}],"sales":[{"sku":"SKU-1","date":"2026-11-06","units":8},{"sku":"SKU-1","date":"2026-11-07","units":12},{"sku":"SKU-1","date":"2026-11-08","units":8},{"sku":"SKU-1","date":"2026-11-09","units":12},{"sku":"SKU-1","date":"2026-11-10","units":10},{"sku":"SKU-SLOW","date":"2026-11-09","units":1}],"purchases":[{"sku":"SKU-1","date":"2026-10-20","units":50,"unitPrice":2.1}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"status":{"type":"string"},"skuCount":{"type":"number"},"atRiskCount":{"type":"number"},"excessCount":{"type":"number"},"slowCount":{"type":"number"},"assumptions":{"type":"array","items":{"type":"string"}},"products":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"onHand":{"type":"number"},"onHandSupplied":{"type":"boolean"},"onOrder":{"type":"number"},"onOrderSupplied":{"type":"boolean"},"unitCost":{"type":"number"},"unitCostSupplied":{"type":"boolean"},"saleCount":{"type":"number"},"purchaseCount":{"type":"number"},"leadTimeDaysSupplied":{"type":"boolean"}},"additionalProperties":true}},"stockout":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"available":{"type":"number"},"availableSupplied":{"type":"boolean"},"reorderPoint":{"type":"number"},"reorderPointSupplied":{"type":"boolean"},"belowReorderPoint":{"type":"boolean"},"stockoutRiskCalculated":{"type":"boolean"},"averageDailyDemand":{"type":"number"},"demandSupplied":{"type":"boolean"},"leadTimeDays":{"type":"number"},"leadTimeDaysSupplied":{"type":"boolean"},"daysCover":{"type":"number"},"daysCoverSupplied":{"type":"boolean"},"riskLevel":{"type":"string"}},"additionalProperties":true}},"reorder":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"averageDailyDemand":{"type":"number"},"demandStdev":{"type":"number"},"demandSupplied":{"type":"boolean"},"leadTimeDays":{"type":"number"},"leadTimeDaysSupplied":{"type":"boolean"},"reviewDays":{"type":"number"},"serviceLevelZ":{"type":"number"},"safetyStock":{"type":"number"},"safetyStockSupplied":{"type":"boolean"},"demandDuringLead":{"type":"number"},"demandDuringLeadSupplied":{"type":"boolean"},"reorderPoint":{"type":"number"},"reorderPointSupplied":{"type":"boolean"},"available":{"type":"number"},"availableSupplied":{"type":"boolean"},"suggestedOrder":{"type":"number"},"suggestedOrderSupplied":{"type":"boolean"},"moq":{"type":"number"},"moqSupplied":{"type":"boolean"},"formula":{"type":"string"},"purchaseOrderCreated":{"type":"boolean"}},"additionalProperties":true}},"safety":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"serviceLevelZ":{"type":"number"},"demandStdev":{"type":"number"},"demandSupplied":{"type":"boolean"},"leadTimeDays":{"type":"number"},"leadTimeDaysSupplied":{"type":"boolean"},"historyDaysUsed":{"type":"number"},"safetyStock":{"type":"number"},"safetyStockSupplied":{"type":"boolean"},"formula":{"type":"string"},"uncertainty":{"type":"string"}},"additionalProperties":true}},"excess":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"onHand":{"type":"number"},"averageDailyDemand":{"type":"number"},"demandSupplied":{"type":"boolean"},"daysCover":{"type":"number"},"daysCoverSupplied":{"type":"boolean"},"thresholdDays":{"type":"number"},"excess":{"type":"boolean"},"excessUnits":{"type":"number"},"reason":{"type":"string"}},"additionalProperties":true}},"slow":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"onHand":{"type":"number"},"onHandSupplied":{"type":"boolean"},"unitsSold":{"type":"number"},"lookbackDays":{"type":"number"},"thresholdUnits":{"type":"number"},"slow":{"type":"boolean"},"datedSaleCount":{"type":"number"}},"additionalProperties":true}},"forecast":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"method":{"type":"string"},"forecastDays":{"type":"number"},"historyDaysUsed":{"type":"number"},"averageDailyDemand":{"type":"number"},"demandStdev":{"type":"number"},"demandSupplied":{"type":"boolean"},"forecastUnits":{"type":"number"},"forecastUnitsSupplied":{"type":"boolean"},"uncertainty":{"type":"string"},"seasonalityModeled":{"type":"boolean"},"assumption":{"type":"string"}},"additionalProperties":true}},"purchaseOrderCreated":{"type":"boolean"},"inventorySystemAccessed":{"type":"boolean"},"leadTimeInvented":{"type":"boolean"},"demandInvented":{"type":"boolean"},"priceInvented":{"type":"boolean"},"findings":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"code":{"type":"string"},"subject":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-04T19:00:00.000Z","status":"reported","skuCount":2,"atRiskCount":1,"excessCount":1,"slowCount":1,"assumptions":["serviceLevelZ=1.65 (explicit normal z factor for safety stock)","reviewDays=0","historyDays=5","forecastDays=7","excessDaysCover=30","slowUnits=5 over slowDays=5","Daily demand average fills missing days in the history window with zero when a history end date exists.","Seasonality is not added. Only variation already present in the supplied history affects the standard deviation."],"products":[{"sku":"SKU-1","name":"Widget","onHand":20,"onHandSupplied":true,"onOrder":0,"onOrderSupplied":true,"unitCost":2.5,"unitCostSupplied":true,"saleCount":5,"purchaseCount":1,"leadTimeDaysSupplied":true},{"sku":"SKU-SLOW","name":"Shelfware","onHand":200,"onHandSupplied":true,"onOrder":0,"onOrderSupplied":false,"unitCost":0,"unitCostSupplied":false,"saleCount":1,"purchaseCount":0,"leadTimeDaysSupplied":false}],"stockout":[{"sku":"SKU-1","name":"Widget","available":20,"availableSupplied":true,"reorderPoint":45.9,"reorderPointSupplied":true,"belowReorderPoint":true,"stockoutRiskCalculated":true,"averageDailyDemand":10,"demandSupplied":true,"leadTimeDays":4,"leadTimeDaysSupplied":true,"daysCover":2,"daysCoverSupplied":true,"riskLevel":"elevated"},{"sku":"SKU-SLOW","name":"Shelfware","available":200,"availableSupplied":true,"reorderPoint":0,"reorderPointSupplied":false,"belowReorderPoint":false,"stockoutRiskCalculated":false,"averageDailyDemand":0.5,"demandSupplied":true,"leadTimeDays":0,"leadTimeDaysSupplied":false,"daysCover":400,"daysCoverSupplied":true,"riskLevel":"not_calculated"}],"reorder":[{"sku":"SKU-1","name":"Widget","averageDailyDemand":10,"demandStdev":1.7889,"demandSupplied":true,"leadTimeDays":4,"leadTimeDaysSupplied":true,"reviewDays":0,"serviceLevelZ":1.65,"safetyStock":5.9,"safetyStockSupplied":true,"demandDuringLead":40,"demandDuringLeadSupplied":true,"reorderPoint":45.9,"reorderPointSupplied":true,"available":20,"availableSupplied":true,"suggestedOrder":25.9,"suggestedOrderSupplied":true,"moq":20,"moqSupplied":true,"formula":"reorderPoint = averageDailyDemand × (leadTimeDays + reviewDays) + safetyStock","purchaseOrderCreated":false},{"sku":"SKU-SLOW","name":"Shelfware","averageDailyDemand":0.5,"demandStdev":0.5,"demandSupplied":true,"leadTimeDays":0,"leadTimeDaysSupplied":false,"reviewDays":0,"serviceLevelZ":1.65,"safetyStock":0,"safetyStockSupplied":false,"demandDuringLead":0,"demandDuringLeadSupplied":false,"reorderPoint":0,"reorderPointSupplied":false,"available":200,"availableSupplied":true,"suggestedOrder":0,"suggestedOrderSupplied":false,"moq":0,"moqSupplied":false,"formula":"reorderPoint = averageDailyDemand × (leadTimeDays + reviewDays) + safetyStock","purchaseOrderCreated":false}],"safety":[{"sku":"SKU-1","name":"Widget","serviceLevelZ":1.65,"demandStdev":1.7889,"demandSupplied":true,"leadTimeDays":4,"leadTimeDaysSupplied":true,"historyDaysUsed":5,"safetyStock":5.9,"safetyStockSupplied":true,"formula":"safetyStock = serviceLevelZ × demandStdev × sqrt(leadTimeDays)","uncertainty":"high"},{"sku":"SKU-SLOW","name":"Shelfware","serviceLevelZ":1.65,"demandStdev":0.5,"demandSupplied":true,"leadTimeDays":0,"leadTimeDaysSupplied":false,"historyDaysUsed":2,"safetyStock":0,"safetyStockSupplied":false,"formula":"safetyStock = serviceLevelZ × demandStdev × sqrt(leadTimeDays)","uncertainty":"high"}],"excess":[{"sku":"SKU-1","name":"Widget","onHand":20,"averageDailyDemand":10,"demandSupplied":true,"daysCover":2,"daysCoverSupplied":true,"thresholdDays":30,"excess":false,"excessUnits":0,"reason":"within_threshold"},{"sku":"SKU-SLOW","name":"Shelfware","onHand":200,"averageDailyDemand":0.5,"demandSupplied":true,"daysCover":400,"daysCoverSupplied":true,"thresholdDays":30,"excess":true,"excessUnits":185,"reason":"days_cover_over_threshold"}],"slow":[{"sku":"SKU-1","name":"Widget","onHand":20,"onHandSupplied":true,"unitsSold":50,"lookbackDays":5,"thresholdUnits":5,"slow":false,"datedSaleCount":5},{"sku":"SKU-SLOW","name":"Shelfware","onHand":200,"onHandSupplied":true,"unitsSold":1,"lookbackDays":5,"thresholdUnits":5,"slow":true,"datedSaleCount":1}],"forecast":[{"sku":"SKU-1","name":"Widget","method":"simple_daily_average","forecastDays":7,"historyDaysUsed":5,"averageDailyDemand":10,"demandStdev":1.7889,"demandSupplied":true,"forecastUnits":70,"forecastUnitsSupplied":true,"uncertainty":"high","seasonalityModeled":false,"assumption":"forecastUnits = averageDailyDemand × forecastDays, using only sales dated on or before 2026-11-10."},{"sku":"SKU-SLOW","name":"Shelfware","method":"simple_daily_average","forecastDays":7,"historyDaysUsed":2,"averageDailyDemand":0.5,"demandStdev":0.5,"demandSupplied":true,"forecastUnits":3.5,"forecastUnitsSupplied":true,"uncertainty":"high","seasonalityModeled":false,"assumption":"forecastUnits = averageDailyDemand × forecastDays, using only sales dated on or before 2026-11-10."}],"purchaseOrderCreated":false,"inventorySystemAccessed":false,"leadTimeInvented":false,"demandInvented":false,"priceInvented":false,"findings":[{"kind":"missing","code":"lead_time","subject":"SKU-SLOW","detail":"No supplier lead time was supplied for this SKU. Lead time was not invented."},{"kind":"observation","code":"history_short","subject":"SKU-1","detail":"Only 5 history day(s) were available. Safety stock uncertainty is high and seasonality is not modeled."},{"kind":"observation","code":"forecast_uncertainty","subject":"SKU-1","detail":"Forecast uses a simple average over 5 day(s). Seasonality is not modeled. Uncertainty=high."},{"kind":"observation","code":"forecast_uncertainty","subject":"SKU-SLOW","detail":"Forecast uses a simple average over 2 day(s). Seasonality is not modeled. Uncertainty=high."}],"limitations":["Products, sales, supplier lead times, and purchases are copied only from labeled fields supplied by the caller.","Reorder point = average daily demand × (lead time days + review days) + safety stock.","Safety stock = service-level z × daily demand standard deviation × square root of lead time days.","Demand forecasts use a simple average of available history only. Seasonality is not modeled unless present in that history.","Lead times, demand, and purchase prices are never invented. No purchase order is created and no inventory system is accessed."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.12"},"protocols":[{"x402":{}}]}}}},"components":{"schemas":{"ApiError":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}}}}}}}