{"openapi":"3.1.0","info":{"title":"PUT /api/v1/expense-reports/{report_id}","version":"1.0.0","description":"Update expense report"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/expense-reports/{report_id}":{"put":{"tags":["expense-reports"],"summary":"Update expense report","description":"Update a draft expense report.","operationId":"update_expense_report_api_v1_expense_reports__report_id__put","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report 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/ExpenseReportUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ExpenseReportDetailResponse_"}}}},"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":{"ExpenseReportDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number"},"status":{"type":"string","title":"Status"},"currency":{"type":"string","title":"Currency"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"total":{"type":"integer","title":"Total"},"employee_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee User Id"},"approved_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By User Id"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted At"},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At"},"reimbursed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reimbursed At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"line_count":{"type":"integer","title":"Line Count","default":0},"can_be_updated":{"type":"boolean","title":"Can Be Updated","default":false},"can_be_deleted":{"type":"boolean","title":"Can Be Deleted","default":false},"can_be_submitted":{"type":"boolean","title":"Can Be Submitted","default":false},"can_be_approved":{"type":"boolean","title":"Can Be Approved","default":false},"can_be_reimbursed":{"type":"boolean","title":"Can Be Reimbursed","default":false},"lines":{"items":{"$ref":"#/components/schemas/ExpenseReportLineResponse"},"type":"array","title":"Lines"}},"type":"object","required":["id","business_id","status","currency","total"],"title":"ExpenseReportDetailResponse","description":"Expense report with line items."},"ExpenseReportLineInput":{"properties":{"description":{"type":"string","maxLength":500,"minLength":1,"title":"Description"},"amount":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount","description":"Amount in cents"},"expense_date":{"type":"string","format":"date","title":"Expense Date","description":"Date expense was incurred"},"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key","description":"Receipt attachment S3 key"},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id","description":"Expense category ledger"}},"type":"object","required":["description","amount","expense_date"],"title":"ExpenseReportLineInput","description":"Line item payload for create/update."},"ExpenseReportLineResponse":{"properties":{"id":{"type":"string","title":"Id"},"expense_report_id":{"type":"string","title":"Expense Report Id"},"description":{"type":"string","title":"Description"},"amount":{"type":"integer","title":"Amount"},"expense_date":{"type":"string","format":"date","title":"Expense Date"},"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key"},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id"},"has_receipt":{"type":"boolean","title":"Has Receipt","default":false},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","expense_report_id","description","amount","expense_date"],"title":"ExpenseReportLineResponse","description":"Expense report line in API responses."},"ExpenseReportUpdateRequest":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"lines":{"anyOf":[{"items":{"$ref":"#/components/schemas/ExpenseReportLineInput"},"type":"array","minItems":1},{"type":"null"}],"title":"Lines","description":"Replace all lines when provided"}},"type":"object","title":"ExpenseReportUpdateRequest","description":"Update a draft expense report."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SuccessEnvelope_ExpenseReportDetailResponse_":{"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/ExpenseReportDetailResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ExpenseReportDetailResponse]"},"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":[]}]}