{"openapi":"3.1.0","info":{"title":"GET /api/v1/inventory/supply-chain","version":"1.0.0","description":"Get inventory supply chain map"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/inventory/supply-chain":{"get":{"tags":["inventory:supply_chain"],"summary":"Get inventory supply chain map","description":"Return a single payload of nodes (locations with on-hand + alerts) and edges (open POs + in-transit transfers) for the Supply Chain Map.","operationId":"get_supply_chain_map_api_v1_inventory_supply_chain_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplyChainResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SupplyChainEdge":{"properties":{"id":{"type":"string","title":"Id","description":"Underlying PO or Transfer ID."},"kind":{"type":"string","title":"Kind","description":"'purchase_order' or 'transfer'."},"from_location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Location Id","description":"Source location ID."},"to_location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Location Id","description":"Destination location ID."},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Human-readable label (e.g. 'PO-123' or 'TRF-456')."},"status":{"type":"string","title":"Status","description":"Current status of the PO or transfer."},"total_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Cents","description":"PO total (for PO edges) in cents. None for transfers."},"expected_arrival_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expected Arrival Date","description":"When goods are expected to arrive."}},"type":"object","required":["id","kind","status"],"title":"SupplyChainEdge","description":"A directed edge between two nodes representing in-flight goods.\n\n``kind`` is either ``\"purchase_order\"`` (PO waiting to be\nreceived) or ``\"transfer\"`` (in-transit InventoryTransfer). UIs\nshould render them with different line styles."},"SupplyChainNode":{"properties":{"id":{"type":"string","title":"Id","description":"Location ID."},"name":{"type":"string","title":"Name","description":"Display name of the location."},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code","description":"Short code (e.g. 'WH1')."},"location_type":{"type":"string","title":"Location Type","description":"LocationTypeEnum value."},"is_default":{"type":"boolean","title":"Is Default","description":"Whether this is the business default location.","default":false},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City","description":"City for layout grouping."},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State","description":"State/region for layout grouping."},"on_hand_units":{"type":"number","title":"On Hand Units","description":"Total units on hand at this location across all variants.","default":0.0},"on_hand_value_cents":{"type":"integer","title":"On Hand Value Cents","description":"Total value of on-hand inventory at this location, in cents.","default":0},"open_po_count":{"type":"integer","title":"Open Po Count","description":"POs with this location as ship_from or ship_to and a non-terminal status.","default":0},"low_stock_count":{"type":"integer","title":"Low Stock Count","description":"Variants at this location whose available <= reorder_point.","default":0},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id","description":"Vendor whose default_location_id points here, if any."}},"type":"object","required":["id","name","location_type"],"title":"SupplyChainNode","description":"A location node on the supply-chain map.\n\n``on_hand_value_cents`` is a SUM of ``inventory_levels.on_hand *\nvariant.unit_cost`` at the node, expressed in business-currency\ncents. ``open_po_count`` counts POs whose ship_from or ship_to\npoints at this node and whose status is not terminal."},"SupplyChainResponse":{"properties":{"nodes":{"items":{"$ref":"#/components/schemas/SupplyChainNode"},"type":"array","title":"Nodes"},"edges":{"items":{"$ref":"#/components/schemas/SupplyChainEdge"},"type":"array","title":"Edges"},"generated_at":{"type":"string","format":"date-time","title":"Generated At","description":"Server time the payload was computed."}},"type":"object","required":["generated_at"],"title":"SupplyChainResponse","description":"Full supply-chain map payload: nodes + edges."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}