Delete Booking
Delete a booking (cancel with refund).
Endpoint
INFO
DELETE /api/v1/dashboard/bookings/{booking}
Headers
| Header | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
Accept | application/json | Yes |
Authorization | Bearer {token} | Yes |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
booking | integer | Booking ID |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
reason | string | No | Cancellation reason |
refund_amount | decimal | No | Custom refund amount |
full_refund | boolean | No | Issue full refund |
Example Request
bash
curl -X DELETE https://api.daakey.com/api/v1/dashboard/bookings/1 \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{
"reason": "Vehicle issue - customer compensation",
"full_refund": true
}'Response
Success (200)
json
{
"success": true,
"message": "Booking cancelled",
"data": {
"id": 1,
"reference": "BK-2024-00001",
"status": "cancelled",
"cancelled_at": "2024-01-15T12:00:00Z",
"cancellation_reason": "Vehicle issue - customer compensation",
"refund": {
"amount": 332.00,
"status": "processing"
}
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Error (400)
json
{
"success": false,
"message": "Cannot cancel booking",
"data": {
"reason": "Booking has already ended"
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Notes
- Dashboard users can override cancellation policy
- Completed bookings cannot be cancelled