> ## Documentation Index
> Fetch the complete documentation index at: https://docs.seyaha.net/llms.txt
> Use this file to discover all available pages before exploring further.

# DELETE /bookings/{reservationCode}

> Release a hold. Seyaha calls this when a customer abandons checkout or a reservation expires.

Seyaha calls `DELETE /bookings/{reservationCode}` to release a hold in three situations:

* The customer abandons checkout before completing payment
* Payment fails and the hold needs to be freed
* The reservation `expiresAt` time passes and Seyaha's sweep job cleans it up

The `reservationCode` path parameter is the `reservationConfirmationCode` you returned
from `POST /bookings/reserve`.

***

## Request

```http theme={null}
DELETE /bookings/{reservationCode}
Authorization: Bearer <auth_key>
Content-Type: application/json
```

Seyaha also sends the code in the request body for compatibility:

### Path parameter

| Parameter         | Description                                                 |
| ----------------- | ----------------------------------------------------------- |
| `reservationCode` | The `reservationConfirmationCode` from the reserve response |

### Request body (optional)

```json theme={null}
{
  "reservationConfirmationCode": "HOLD-2026-0001"
}
```

***

## Response

```http theme={null}
200 OK
Content-Type: application/json

{
  "success": true,
  "message": "Reservation released"
}
```

### Response body

| Field     | Type    | Description                     |
| --------- | ------- | ------------------------------- |
| `success` | boolean | `true` if the hold was released |
| `message` | string  | Optional human-readable status  |

***

## Full flow example

```
1. Customer starts checkout
   Seyaha → POST /bookings/reserve
   Your API ← { "reservationConfirmationCode": "HOLD-2026-0001", "expiresAt": "..." }

2a. Customer completes payment
    Seyaha → POST /bookings/confirm
    (hold is promoted to confirmed booking — no DELETE needed)

2b. Customer abandons / payment fails
    Seyaha → DELETE /bookings/HOLD-2026-0001
    Your API ← { "success": true }
    (slot is freed)

2c. expiresAt passes without confirmation
    Seyaha sweep job → DELETE /bookings/HOLD-2026-0001
    Your API ← { "success": true }
    (slot is freed)
```

***

## Implementation notes

<Note>
  If you receive a DELETE for a code you don't recognise (e.g. it already expired on
  your side), return `200` with `success: true` anyway. Seyaha treats `404` or `500`
  as errors and will retry, which creates unnecessary noise.
</Note>

* Timeout: **10 seconds**
* Restore the slot's vacancies immediately when a hold is released so other customers can book it.
* Implement idempotency — calling DELETE multiple times for the same code should always return `200`.
