Skip to content

Request Extension ​

Extend the duration of an active or upcoming booking beyond the originally scheduled end time. This is useful when users need more time with the vehicle than initially planned.

Extension availability depends on whether the vehicle is booked by someone else after your current reservation ends. If the vehicle is available, the extension is approved immediately and additional charges are automatically applied to your payment method.

The extension flow works as follows:

  1. User requests a new end date/time
  2. System checks vehicle availability for the extended period
  3. If available, calculates additional charges based on the hourly rate
  4. Charges the user's payment method automatically
  5. Updates the booking with the new end date

Pro Tip

If the full extension isn't available due to a subsequent booking, the API response will include the maximum possible extension time, allowing users to choose a partial extension.

Endpoint ​

INFO

POST /api/v1/client/bookings/{booking}/request-extension

Headers ​

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer {token}Yes
X-Agency-Signature{signature}Yes

Path Parameters ​

ParameterTypeDescription
bookingintegerBooking ID

Request Body ​

ParameterTypeRequiredDescription
new_end_datestringYesNew end datetime (ISO 8601)

Example Request ​

bash
curl -X POST https://api.daakey.com/api/v1/client/bookings/1/request-extension \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {token}" \
  -H "X-Agency-Signature: {signature}" \
  -d '{
    "new_end_date": "2024-01-15T22:00:00Z"
  }'

Response ​

Success (200) ​

json
{
  "success": true,
  "message": "Extension approved",
  "data": {
    "id": 1,
    "original_end_date": "2024-01-15T18:00:00Z",
    "new_end_date": "2024-01-15T22:00:00Z",
    "extension_hours": 4,
    "additional_cost": {
      "subtotal": 60.00,
      "tax": 6.00,
      "total": 66.00,
      "currency": "USD"
    },
    "payment_status": "charged",
    "approved_at": "2024-01-15T16:00:00Z"
  },
  "meta": {
    "agency_id": 123,
    "agency_code": "AGENCY123"
  },
  "request_id": "uuid",
  "timestamp": "2024-01-01T00:00:00.000Z"
}

Error (400) - Vehicle Not Available ​

json
{
  "success": false,
  "message": "Extension not available",
  "data": {
    "reason": "Vehicle is booked by another customer starting at 19:00",
    "max_extension": "2024-01-15T19:00:00Z"
  },
  "request_id": "uuid",
  "timestamp": "2024-01-01T00:00:00.000Z"
}

Error (400) - Cannot Extend ​

json
{
  "success": false,
  "message": "Cannot extend booking",
  "data": {
    "reason": "Booking has already ended"
  },
  "request_id": "uuid",
  "timestamp": "2024-01-01T00:00:00.000Z"
}

Error (402) - Payment Failed ​

json
{
  "success": false,
  "message": "Payment failed",
  "data": {
    "reason": "Card declined",
    "additional_cost": 66.00
  },
  "request_id": "uuid",
  "timestamp": "2024-01-01T00:00:00.000Z"
}

Notes ​

  • Extensions are subject to vehicle availability
  • Additional charges are automatically applied to the payment method
  • Extensions can only be made for active or upcoming bookings
  • Maximum extension is limited by agency settings and next booking

Daakey Car Sharing Platform