Create Work Order
Create a new work order.
Required Permission: create_work_orders
Required Fields
customer_id- UUID (must exist in customers table)location_id- UUID (customer location)service_id- UUID (links work order to a service from the service catalog)category- Enum: scheduled, emergency, warranty, contract, inspection, installation, repair, delivery, consultation, follow_up, recall, upgradepriority- Enum: low, normal, high, urgent, emergency, criticalsource- Enum: customer_request, scheduled_maintenance, emergency_call, contract, inspection, internal, warranty_claim, follow_up, system_generated, mobile_app, web_portal, call_center
Optional Fields
current_status- Enum: draft, pending_approval, approved, scheduled, dispatched, en_route, arrived, in_progress, on_hold, completed, cancelled, rescheduled, requires_parts, requires_approval, quality_check, invoiced, closedscheduled_start- datetime (Y-m-d H:i:s) - Scheduled start date and timescheduled_end- datetime (Y-m-d H:i:s) - Scheduled end date and time (must be after scheduled_start)requested_completion_by- datetime (Y-m-d H:i:s)completion_percentage- integer (0-100)work_started_at- datetimework_completed_at- datetimespecial_instructions- stringcompletion_summary- stringprimary_contact_id- UUIDcustomer_presence_required- booleancustomer_notification_sent- booleancustomer_notified_at- datetimepreferred_communication_methods- array (phone, email, sms, app)estimated_labor_cost- numeric, min:0estimated_parts_cost- numeric, min:0actual_labor_cost- numeric, min:0actual_parts_cost- numeric, min:0customer_signature_required- booleancustomer_signature_received- booleancustomer_signed_at- datetimequality_check_required- booleanquality_check_passed- booleanquality_checked_by- UUIDquality_checked_at- datetimecustomer_satisfaction_score- integer (1-5)customer_feedback- stringrequires_follow_up- booleanfollow_up_date- datefollow_up_completed- booleanwarranty_applicable- booleanwarranty_days- integerwarranty_expires_at- dateassigned_supervisor_id- UUIDexternal_work_order_id- stringcustomer_po_number- stringcontract_number- stringexternal_references- arrayresponse_time_minutes- integerresolution_time_minutes- integercompleted_on_time- booleancompleted_within_estimate- booleancallback_count- integerrequires_manager_approval- booleanapproved_by- UUIDapproved_at- datetimeapproval_notes- stringrisk_level- Enum: low, medium, high, criticalsafety_incident_occurred- booleansafety_requirements- arraypermit_required- booleanpermit_number- string
Auto-Calculated Fields (do not send these)
estimated_total- Automatically calculated from estimated_labor_cost + estimated_parts_costactual_total- Automatically calculated from actual_labor_cost + actual_parts_costactual_duration_minutes- Automatically calculated from work_started_at and work_completed_at
Headers
Request
Required: Enum - customer_request|scheduled_maintenance|emergency_call|contract|inspection|internal|warranty_claim|follow_up|system_generated|mobile_app|web_portal|call_center - Work order source
Required: Enum - scheduled|emergency|warranty|contract|inspection|installation|repair|delivery|consultation|follow_up|recall|upgrade - Work order category
Required: Enum - low|normal|high|urgent|emergency|critical - Work order priority level
Required: UUID - Service UUID from service catalog
Required: UUID - Customer UUID (must exist in customers table)
Required: UUID - Customer location UUID
Optional: datetime - Scheduled end date and time (must be after scheduled_start)
Optional: Enum - scheduled|dispatched|en_route|arrived|in_progress|on_hold|completed|cancelled|rescheduled|requires_parts|invoiced|closed - Initial work order status
Optional: datetime - Scheduled start date and time

