PUT 5 min read

Update Booking

PUT /api/v1/bookings/{id}

Update an existing booking

Update Booking

Update an existing booking's information or status.

Path Parameters

Parameter Type Description
id integer The booking ID

Request Body

All fields are optional. Only include fields you want to update.

Field Type Description
customer_name string Customer name (max 255 chars)
customer_email string Customer email
customer_phone string Customer phone (max 50 chars)
vehicle_make string Vehicle make (max 100 chars)
vehicle_model string Vehicle model (max 100 chars)
vehicle_year integer Vehicle year (1900-2100)
vehicle_plate string Vehicle plate number (max 20 chars)
service_type string Type of service (max 100 chars)
scheduled_date date Appointment date (YYYY-MM-DD)
scheduled_time time Appointment time (HH:mm)
duration_minutes integer Duration in minutes (15-480)
status string Status: pending, confirmed, cancelled, completed
notes string Additional notes

Example Request - Update Status

curl -X PUT "https://hydra.marketdragon.ph/api/v1/bookings/42" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "confirmed"
  }'

Example Request - Reschedule

curl -X PUT "https://hydra.marketdragon.ph/api/v1/bookings/42" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "scheduled_date": "2024-01-26",
    "scheduled_time": "09:00",
    "notes": "Rescheduled per customer request"
  }'

Example Response

{
    "data": {
        "id": 42,
        "company_id": 1,
        "customer_name": "Jane Doe",
        "customer_email": "[email protected]",
        "customer_phone": "+1987654321",
        "vehicle_make": "Honda",
        "vehicle_model": "Civic",
        "vehicle_year": 2023,
        "vehicle_plate": "XYZ 789",
        "service_type": "Full Service",
        "scheduled_date": "2024-01-26",
        "scheduled_time": "09:00",
        "duration_minutes": 120,
        "status": "confirmed",
        "notes": "Rescheduled per customer request",
        "reference_number": "BK8B2D5F1A",
        "qr_code_url": "https://hydra.marketdragon.ph/p/acme-auto/booking/660e8400-e29b-41d4-a716-446655440042",
        "confirmed_at": "2024-01-20T11:30:00+00:00",
        "cancelled_at": null,
        "created_at": "2024-01-20T10:15:00+00:00",
        "updated_at": "2024-01-20T11:30:00+00:00"
    }
}

Booking Status Flow

Status Description
pending Initial status when booking is created
confirmed Booking has been confirmed
cancelled Booking has been cancelled
completed Service has been completed

Error Responses

403 Forbidden

{
    "message": "You do not have access to this booking."
}

422 Validation Error

{
    "message": "The selected status is invalid.",
    "errors": {
        "status": ["The selected status is invalid."]
    }
}
Back to Bookings
Was this helpful?