# Cancellation

These operations cover the cancellation of hotel bookings, either initiated by the traveler or by the hotel/vendor.

**Webhook used:** [PNR_V3](/openapi/webhookeventapi/webhooks/paths/pnr_v3/post)

| Step | Operation  | Event trigger | Context |
|  --- | --- | --- | --- |
| 1
 | `BOOKING_CANCELED_ BY_TRAVELER`
 | When the hotel booking is canceled by the traveler.
 | The hotel reservation has been cancelled by the traveler.
The refund amount depends on the hotel's cancellation policy:
- **Refundable** (canceled before the cancellation deadline): The full prepaid amount is refunded.
- **Partially refundable** (canceled after the deadline):
The penalty is deducted from full price and then refunded (e.g., one night's stay deducted as penalty).
- **Non-refundable:** No refund is received.
- **Pay-at-hotel bookings**: There is no Spotnana-side refund to process, however a cancellation fee may still apply per hotel policy.

**Example:** A traveler booked a refundable $750 hotel stay with free cancellation until 48 hours before check-in.
They cancel 5 days before check-in. The `BOOKING_CANCELED_BY_TRAVELER` event is triggered and the full $750 is refunded.
 |
| 2 | `BOOKING_CANCELED_ BY_VENDOR` | When the hotel booking is canceled by the hotel or the supplier. | The hotel or booking supplier has canceled the reservation.
This scenario is less common and could occur due to hotel overbooking, property closure, renovation,
natural disaster, or operational issues.
The refund processing follows the same rules as traveler-initiated cancellations.
For a vendor cancellation, the traveler is typically entitled to a full refund since the cancellation was not their doing,
though the actual refund may depend on the hotel policies.
**Example:** A traveler has a confirmed reservation at a beachfront hotel.
A hurricane warning forces the hotel to close, and the hotel cancels all reservations for the affected dates.
The `BOOKING_CANCELED_BY_VENDOR` event is triggered. The full prepaid amount is refunded. |


## Hotel cancellation flow diagram

```mermaid
flowchart LR
    subgraph cancellation["Cancellation"]
        A(["Confirmed hotel<br>booking"]) --> B{"Who initiates<br>the cancellation?"}

        B -->|"Traveler<br>cancels"| C{"Cancellation<br>policy?"}

        C -->|"Free<br>cancellation"| D["<b>BOOKING_CANCELED_<br>BY_TRAVELER</b><br>―――――――――――<br>Full prepaid price refunded if canceled before deadline"]

        C -->|"Penalty<br>applies"| E["<b>BOOKING_CANCELED_<br>BY_TRAVELER</b><br>―――――――――――<br>Penalty (e.g., one night's stay) deducted and remainder refunded, if canceled after deadline."]

        C -->|"Non-<br>refundable"| F["<b>BOOKING_CANCELED_<br>BY_TRAVELER</b><br>―――――――――――<br>Non-refundable rate.<br>No refund processed ($0)."]

        B -->|"Hotel/supplier<br>cancels"| G["<b>BOOKING_CANCELED_<br>BY_VENDOR</b><br>―――――――――――<br>Hotel proactively canceled.<br>e.g., Due to overbooking, closure, etc.<br>Typically full refund."]
        D --> H["<b>INVOICE_GENERATED</b><br>―――――――――――<br>Credit note / refund<br>adjustment invoice."]
        E --> H
        G --> H
    end

    style A fill:#f0f0f0,stroke:#999
    style D fill:#F44336,color:#fff
    style E fill:#F44336,color:#fff
    style F fill:#F44336,color:#fff
    style G fill:#F44336,color:#fff
    style H fill:#FF9800,color:#fff
```