{"openapi":"3.1.0","info":{"title":"POST /api/v1/bills/upcoming/{upcoming_bill_id}/convert","version":"1.0.0","description":"Push an upcoming bill into a real bill"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/bills/upcoming/{upcoming_bill_id}/convert":{"post":{"tags":["bills"],"summary":"Push an upcoming bill into a real bill","description":"Creates a **draft** bill from the estimate and marks the forecast row converted. The bill posts nothing to the ledger until it is approved and marked received, exactly like a hand-entered bill.","operationId":"convert_upcoming_bill_api_v1_bills_upcoming__upcoming_bill_id__convert_post","parameters":[{"name":"upcoming_bill_id","in":"path","required":true,"schema":{"type":"string","title":"Upcoming Bill 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"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpcomingBillConvertRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_UpcomingBillResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"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"},"SuccessEnvelope_UpcomingBillResponse_":{"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/UpcomingBillResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[UpcomingBillResponse]"},"UpcomingBillConvertRequest":{"properties":{"amount":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Amount","description":"Actual amount in cents. Defaults to the estimate."},"due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due Date","description":"Due date for the bill. Defaults to the expected date."},"bill_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bill Number","description":"Vendor's invoice number, when known."},"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key","description":"Attachment key for the received document."}},"type":"object","title":"UpcomingBillConvertRequest","description":"Push an estimate into a real draft bill."},"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":[]}]}