# Modifying booking requests

This article covers all endpoints that provides means to modify a booking request. For detailed information on the object schema of the RtB API, please refer to the [object schema] article.

## ModifyBookingRequest object

`ModifyBookingRequest` object is used to communicate `BookingRequest` state changes in modification requests.


```json
{
  "status": "REJECTED", 
  "rejectionReason": "POLICY_DONT_FIT_NEEDS",
  "rejectionReasonText": null
}
```

| Key | Value | Description |
|  --- | --- | --- |
| `status` | String | Status that you want to move the booking request to.  This can contain the following values:  - `APPROVED`: Request is approved by partner.   - `REJECTED`: Request is declined by partner. |
| `rejectionReason` | String | Specifies the rejection reason from one of the available options. This can contain the following values:  - `DATES_NOT_AVAILABLE`  - `POLICY_DONT_FIT_NEEDS`  - `OUTSIDE_HOURS_CHECKIN`  - `MISSING_INFORMATION`  - `NOT_COMFORTABLE`  **Required, if status is** `REJECTED`. |
| `rejectionReasonText` | String | Free text about why the request is being denied in case of `rejectionReason`: `NOT_COMFORTABLE`. This information is private and is not shared with the guest.  This text is only allowed when `rejectionReason` is `NOT_COMFORTABLE`. For any other status the value is ignored.  Text limit is 255 characters. Longer text are trimmed without returning a warning. - **Required if** `rejectionReason` **is** `NOT_COMFORTABLE`**.**- Pass this as null (if not it's ignored) for any other status. |


## Update booking request by ID

Use the `/rtb/properties/{property_id}/requests/{id}` endpoint to update a booking request by its ID.

### Method and URL


```http
POST https://supply-xml.booking.com/rtb/properties/{property_id}/requests/{id}
```

### Request body parameters

| Parameter | Description | Type | Required |
|  --- | --- | --- | --- |
| `status` | Status that you want to move the booking request to.  This can contain the following values:  - `APPROVED`: Request is approved by partner.   - `REJECTED`: Request is declined by partner. | String | True |
| `rejectionReason` | Specifies the rejection reason from one of the available options.  This can contain the following values:  - `DATES_NOT_AVAILABLE`  - `POLICY_DONT_FIT_NEEDS`  - `OUTSIDE_HOURS_CHECKIN`  - `MISSING_INFORMATION`  - `NOT_COMFORTABLE` | String | True, if status is `REJECTED`. |
| `rejectionReasonText` | Free text about why the request is being denied in case of `rejectionReason`: `NOT_COMFORTABLE`. This information is private and is not shared with the guest.  This text is only allowed when `rejectionReason` is `NOT_COMFORTABLE`. For any other status the value is ignored.  Text limit is 255 characters. Longer text are trimmed without returning a warning.  | String | True, if `rejectionReason` is `NOT_COMFORTABLE`. False (and ignored) for any other status. |


### Sample request


```bash
curl --location 'https://supply-xml.booking.com/rtb/properties/2342343/requests/fc521d813a3423b2fc521d813a3423b2' \
--header 'Authorization: Basic {your_base64_encoded_credentials}' \
--header 'X-Booking-Api-Version: {version_number}' \
--data '{"status": "REJECTED", "rejectionReason": "POLICY_DONT_FIT_NEEDS",}'
```

### Sample responses

In case of a successful request, you'll receive an empty response with status code 200.

In case of an error, you'll receive the following:

- an error code
- a message explaining the error, and
- an RUID in the metadata


#### Success


```json
{
    "warnings": [],
    "errors": [],
    "meta": {
        "ruid": "0000000000000000000000000000000000000000000000000000000000000000000000000000"
    }
}
```

#### Error


```json
{
    "meta": {
        "ruid": "0000000000000000000000000000000000000000000000000000000000000000000000000000"
    },
    "warnings": [],
    "errors": [
          {
            "message": "The Rtb request is expired, so status cannot be updated.",
            "code": "RTB_STATUS_CAN_NOT_CHANGE"
          }
    ]
}
```

## Declining a booking request

Connectivity providers must include an option for partners to select the reason for rejecting a request. If a partner chooses the reason `NOT_COMFORTABLE`, they must also provide an additional rejection reason text field for the partners to share any extra information.

Rejection Reason Is Kept Private
The rejection reason information the property shares is kept private and is only used to improve the overall experience.

This is how we show this option in the Booking.com Extranet.

![Decline reason example from Extranet](/assets/decline-reason.46545f4e3b8a9add2c6cfcd951041ce99500bf1c8bf867431902d467955b7923.d44379f7.png)