{"openapi":"3.1.0","info":{"title":"GET /api/v1/businesses/{business_id}/cfo-portal/po-forecast-settings","version":"1.0.0","description":"List open POs and which forecast column they flow through"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/businesses/{business_id}/cfo-portal/po-forecast-settings":{"get":{"tags":["cfo-portal"],"summary":"List open POs and which forecast column they flow through","description":"List every open PO with its forecast attribution.\n\n**Returns:** ``POForecastSettingsResponse`` — each row identifies\nwhether the PO flows through ``inventory`` (no linked bill yet) or\n``ap_out`` (a ``Bill`` exists with ``source_inventory_order_id``\npointing at this PO), plus the amount and date the forecast uses.\n\n**Why it matters:** Operators auditing the forecast can pinpoint\nwhy a given dollar shows up in AP Out vs. Inventory Payments without\nhaving to cross-reference the bills and PO tables manually.","operationId":"cfo_portal_po_forecast_settings_api_v1_businesses__business_id__cfo_portal_po_forecast_settings_get","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"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/POForecastSettingsResponse"}}}},"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"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"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"},"POForecastDetail":{"properties":{"po_id":{"type":"string","title":"Po Id"},"po_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Po Number"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"status":{"type":"string","title":"Status"},"total_cents":{"type":"integer","title":"Total Cents","default":0},"balance_cents":{"type":"integer","title":"Balance Cents","default":0},"expected_paid_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Expected Paid On"},"is_linked_to_bill":{"type":"boolean","title":"Is Linked To Bill","default":false},"linked_bill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linked Bill Id"},"linked_bill_due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Linked Bill Due Date"},"linked_bill_remaining_balance_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Linked Bill Remaining Balance Cents"},"forecast_column":{"type":"string","enum":["inventory","ap_out"],"title":"Forecast Column"}},"type":"object","required":["po_id","status","forecast_column"],"title":"POForecastDetail","description":"One PO surfaced on the Cash Flow PO Settings panel.\n\nEach row tells the operator (a) which column this PO's cash flows\nthrough (``inventory`` when unlinked, ``ap_out`` when an explicit\n``Bill`` is attached via ``source_inventory_order_id``) and (b) the\namount and date used in that column."},"POForecastSettingsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/POForecastDetail"},"type":"array","title":"Items"},"total_inventory_outflow_cents":{"type":"integer","title":"Total Inventory Outflow Cents","default":0},"total_ap_outflow_cents":{"type":"integer","title":"Total Ap Outflow Cents","default":0}},"type":"object","title":"POForecastSettingsResponse","description":"Response envelope for the PO settings panel."},"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":[]}]}