{"openapi":"3.1.0","info":{"title":"GET /api/v1/bills/upcoming","version":"1.0.0","description":"List upcoming (expected) bills"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/bills/upcoming":{"get":{"tags":["bills"],"summary":"List upcoming (expected) bills","description":"Forecast rows for bills the business expects — recurring contractor payments, retainers. These are estimates: they carry no journal entries and are excluded from AP totals, aged payables and the balance sheet.","operationId":"list_upcoming_bills_api_v1_bills_upcoming_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: expected, converted, dismissed.","title":"Status"},"description":"Filter by status: expected, converted, dismissed."},{"name":"vendor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by vendor.","title":"Vendor Id"},"description":"Filter by vendor."},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Only occurrences expected on or after this date.","title":"Date From"},"description":"Only occurrences expected on or after this date."},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Only occurrences expected on or before this date.","title":"Date To"},"description":"Only occurrences expected on or before this date."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Maximum rows to return.","default":200,"title":"Limit"},"description":"Maximum rows to return."},{"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/SuccessEnvelope_UpcomingBillListResponse_"}}}},"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"},"SuccessEnvelope_UpcomingBillListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/UpcomingBillListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[UpcomingBillListResponse]"},"UpcomingBillListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/UpcomingBillResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total","description":"Number of rows returned."},"total_estimated_amount":{"type":"integer","title":"Total Estimated Amount","description":"Sum of estimated_amount over the returned `expected` rows, in cents. A forecast figure — never an AP balance."}},"type":"object","required":["items","total","total_estimated_amount"],"title":"UpcomingBillListResponse","description":"Expected bills within a date horizon.\n\nNot cursor-paginated: the list is bounded by the requested date window and\na hard row cap, and the client sums it for a forecast total, so a partial\npage would be actively misleading."},"UpcomingBillResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id"},"vendor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"estimated_amount":{"type":"integer","title":"Estimated Amount","description":"Estimated amount in cents."},"expected_date":{"type":"string","format":"date","title":"Expected Date"},"status":{"type":"string","title":"Status"},"series_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Series Id","description":"Shared by every occurrence generated together."},"frequency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Frequency"},"day_of_week":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Day Of Week"},"day_of_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Day Of Month"},"bill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Id","description":"The real bill this became, once converted or matched."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"is_estimate":{"type":"boolean","title":"Is Estimate","description":"Always true. Upcoming bills are forecast rows: they carry no journal entries and are excluded from AP totals, aged payables and the balance sheet.","default":true},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","estimated_amount","expected_date","status","created_at","updated_at"],"title":"UpcomingBillResponse","description":"A projected bill occurrence."},"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":[]}]}