Skip to main content

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 statusResult
REQUESTEDThe booking is changed and the approval step runs again, see below.
Any other status, EXPIRING_APPROVAL and APPROVED included409 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 sentVehicle the booking ends up with
vehicle_idThat vehicle, checked as a named vehicle.
category_idCarpool picks one again, as create does. It never returns the vehicle the booking holds now when the new window overlaps the current one.
NeitherThe 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 settingResultNotifications
New requests are approved automaticallyThe 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 manuallyIt 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_id and request_driver_id cannot be null or an empty string.
  • start_ts and end_ts cannot be an empty string.
  • booking_purpose_id, request_description and pickup_site_location_id can 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​

The updated booking.