Update a Carpool Booking
PATCH/carpool/bookings/:booking_id
Changes a booking that is waiting for approval. This operation is available to the main account only.
Send only the fields to change. A field left out keeps its current value,
and the whole booking is then checked as POST /carpool/bookings checks a
new one: availability, the account's booking rules, the driver's permissions
and the booking form. This booking is left out of the driver's and the
vehicle's schedule, so moving it within its own slot does not conflict with
itself. The first failing check returns the same status and reason code as
create.
| Current status | Result |
|---|---|
REQUESTED | The booking is changed and the approval step runs again, see below. |
Any other status, EXPIRING_APPROVAL and APPROVED included | 409 with CARPOOL_BOOKING_STATE_CONFLICT. Nothing is changed. To change an approved booking, cancel it and create a new one. |
A booking GET /carpool/bookings/{booking_id} cannot return, for example
one that has no vehicle, returns 404 and is not changed.
Vehicle
| Fields sent | Vehicle the booking ends up with |
|---|---|
vehicle_id | That vehicle, checked as a named vehicle. |
category_id | Carpool picks one again, as create does. It never returns the vehicle the booking holds now when the new window overlaps the current one. |
| Neither | The vehicle it has now, checked again against the new values. |
Approval and notifications
The account's approval setting is applied again, as on create.
| Approval setting | Result | Notifications |
|---|---|---|
| New requests are approved automatically | The booking becomes APPROVED (RETURNED when the whole window is in the past and the account allows back-dated booking). | The account's approval notifications are sent. |
| Requests must be approved manually | It stays REQUESTED. Every approval or rejection a department manager recorded is removed and the approvers of the driver's department are asked again. | The account's approval request notifications are sent again. |
Every successful update sends these notifications and uses SMS credits,
even when only one field changed. A retry sends them again, because this
operation takes no Idempotency-Key.
Request rules
vehicle_id,category_idandrequest_driver_idcannot be null or an empty string.start_tsandend_tscannot be an empty string.booking_purpose_id,request_descriptionandpickup_site_location_idcan be set to null to clear them, and the account's booking rules may then refuse the booking.booking_form, when sent, replaces the stored answers. Left out or null, the stored answers are kept.- The booking's requestor name is not updated when the driver changes.
Request
Responses
- 200
- 401
- 403
- 404
- 409
- 422
- 500
The updated booking.
Unauthorized access. Authentication is required.
The operation requires main account credentials. Valid subusers receive this response.
The requested resource was not found.
The booking is no longer waiting for approval (CARPOOL_BOOKING_STATE_CONFLICT), or the driver already holds an overlapping booking (CARPOOL_DRIVER_SCHEDULE_CONFLICT). Nothing was changed.
Request field validation or Carpool business validation failed.
Internal server error.