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

# Modifications Overview

Selfbook provides the [modify reservation](api-reference/endpoint/patch-modify-reservation) API which allows for
updating the following reservation attributes.

* reservation dates
* reservation guest payment method

Please read below for more details.

## Reservation dates modifications

Use this operation when you want to provide guests with a way change the dates of their stay.

You may only make modifications to a CONFIRMED reservation. Modifications on dates apply to the same room type.
If you wish to change the room type, you would need to cancel the reservation and re-book a different room type.

Because modification of dates will cause a price change, the best practice workflow is as follows.

1. Begin by retrieving the existing reservation to allow for a review the details.
   Use the [find a reservation](/api-reference/endpoint/get-hotel-reservation) API for this.
2. Next, collect the new dates and search for availability at the same property. If a rate is available for the new dates that matches the original booking\_code and room\_description, you can proceed with the modification.
   If no such rate is available, you cannot modifiy the reservation dates.
3. If there is availability for the same room, display the new price and store the associate rate.
   You should also display the terms of the original reservation as well. This gives the guest a chance to
   review any potential modification restrictions if included in the rate terms. Allow the guest to confirm or cancel the modification request.
4. If confirmed, make the modification request.
5. Display the result.

If the modification is successful, the reservation record will be returned with the updated price reflected
in the 'rate.price' attribute. The `confirmation_id` and `reservation_id` will remain the same.

Find below a flow chart showing this visually.

```mermaid theme={null}
  flowchart TD
    A[Retrieve Existing Reservation]
    --> B[Collect Desired Dates, Search for Availability]
    B -->C{Dates/Room Available?}
    C-->|No| D[Unable to Modify]
    C-->|Yes| E@{ shape: curv-trap, label: "Display new price, original terms" }
    E-->F{Confirm Modification}
    F-->|Yes| H[Perform Modification]
    H--> I@{ shape: curv-trap, label: "Display results" }
```

## Guest payment method modification

Use this operation if you want to modify the guest payment method associated with the reservation. You will need to provide an updated
tokenized payment method. When successful, the reservation will be updated with this new guest payment method.
