# Invoicing and fees

These operations cover TMC service fees and invoice generation for hotel bookings.

**Webhooks used:** [PNR_V3](/openapi/webhookeventapi/webhooks/paths/pnr_v3/post), [SERVICE_CHARGE](/openapi/webhookeventapi/webhooks/paths/service_charge/post).

| Step | Operation  | Event trigger | Context |
|  --- | --- | --- | --- |
| 1 | `SERVICE_FEE` | When a TMC service fee is charged for the hotel booking. | A service fee has been charged by the TMC for a hotel booking.
The amount charged by a TMC depends on the contract and the configuration made on the Spotnana platform.
**Example:** A company's TMC charges a $15 booking fee per hotel reservation.
After the booking is confirmed, the `SERVICE_FEE` event is triggered with the charge details. |
| 2 | `INVOICE_GENERATED` | When an invoice document is created for the hotel booking or service fee. | Separate invoices are generated for the hotel booking and for any service fee incurred.
This event is also triggered for credit notes generated after cancellations and refunds.
**Example:** After a hotel is booked,
two `INVOICE_GENERATED` events are generated. One for the hotel booking and another for the TMC service fee. |


## Invoicing and service fee flow diagram

```mermaid
flowchart TD
    subgraph invoicing["Invoicing and fees"]
        A(["Hotel booking<br>confirmed"]) --> B["<b>SERVICE_FEE</b><br>―――――――――――<br>TMC fee<br>charged for this booking<br>(if configured)."]

        B --> C["<b>INVOICE_GENERATED</b><br>―――――――――――<br>Hotel booking invoice created."]

        B --> D["<b>INVOICE_GENERATED</b><br>―――――――――――<br>Service fee invoice created<br>(if service fee was charged)."]
    end

    style A fill:#f0f0f0,stroke:#999
    style B fill:#FF9800,color:#fff
    style C fill:#FF9800,color:#fff
    style D fill:#FF9800,color:#fff
```