Create a Carpool Booking
POST/carpool/bookings
Creates a Carpool booking for a driver. This operation is available to the main account only.
Availability, the account's Carpool settings and the driver's existing
bookings are all checked before the booking is written, the way the Carpool
booking screen checks them. Which fields are required depends on those
settings. The account's approval setting decides whether the new booking
is BOOKING_STATUS_APPROVED, BOOKING_STATUS_REQUESTED or
BOOKING_STATUS_RETURNED.
Every request must carry an Idempotency-Key header. A retry with the same
key and body within 24 hours returns the original booking instead of
creating a second one.
The Creating a Booking
guide covers the settings that apply, the booking window, the booking
form, the returned status and notifications, idempotency and every
reason_code.
Request
Responses
- 200
- 400
- 401
- 403
- 409
- 422
- 429
- 500
- 503
The created booking, or, for a retry within 24 hours, the booking created by the earlier request with the same Idempotency-Key and body.
The request body is declared as JSON but cannot be parsed, or is not a JSON object or array. Nothing was processed.
Unauthorized access. Authentication is required.
The operation requires main account credentials. Valid subusers receive this response.
The driver already holds an overlapping booking (CARPOOL_DRIVER_SCHEDULE_CONFLICT), or a request with the same Idempotency-Key is still being processed (CARPOOL_IDEMPOTENCY_IN_PROGRESS).
Request field validation or Carpool business validation failed.
Too Many Requests - the endpoint's rate limit has been exceeded. Retry after the number of seconds in the Retry-After header.
Response Headers
Seconds to wait before retrying. The same value as X-RateLimit-Retry-After-Seconds when that wait is non-negative. If the computed wait is negative, Retry-After is floored at 0.
Unix timestamp of the next earliest successful request.
Seconds until the next earliest successful request.
Internal server error.
Service temporarily unavailable. The request did not complete and can be retried after the number of seconds in the Retry-After header, when one is sent.
Response Headers
Seconds to wait before retrying. Sent with db_busy and db_pool_timeout.