# Preview order modifications v3.3

**Use the /orders/modify/preview endpoint to check whether an accommodation date change or a room adult-allocation change can be applied before you submit it. For date changes, the response also includes the current and proposed total order prices.**

---

## Overview

Use the [/orders/modify/preview](/demand/docs/open-api/3.3/demand-api/orders/orders/modify/preview) endpoint to check whether a requested change can be applied to an order.

**Important**

The orders/modify/preview endpoint is read-only and does not apply any changes. To apply a change, submit it separately to /orders/modify.

### When to use this endpoint

Use the preview endpoint to:

✅ Validate whether a modification to a date or number of adults allocated to a room is allowed.
✅ Identify constraints before submitting a modification.
✅ Show users the expected cost impact (for accommodation date changes)

The endpoint does not preview payment card changes, guest name changes or smoking preference changes. Submit those changes directly to /orders/modify.

**Preview does not guarantee the modification**

A preview checks whether the requested `change` can be applied when you make the preview request. It does not reserve availability or apply the change. Submit the same supported `change` to /orders/modify, and handle any response from that endpoint.

### Modification flow

1. Call /orders/modify/preview with the `order` ID and the requested change.
2. Check the `data.modifiable` field in the response.
3. If `data.modifiable` is `true`, submit the same `change` to /orders/modify.
4. If `data.modifiable` is `false`, use `data.reason` to explain why the requested change cannot be applied. Do not submit that `change` to orders/modify.

Preview → Check the result → Modify

## Supported and unsupported changes

| Change | Can you preview it? | Request `type` or next step |
| --- | --- | --- |
| Check-in and check-out dates | Yes. If the `change` can be applied, the response includes the `current` and proposed total `order` prices. | Set `modification.accommodation.type` to `dates`. |
| Number of adults allocated to a room `reservation` | Yes. The preview checks whether the new adult `allocation` can be applied. | Set `modification.accommodation.type` to `room`. |
| Payment card details | No. | Submit the `change` directly to /orders/modify. |
| Guest names or smoking preference | No. | Submit the `change` directly to /orders/modify. |

## Request structure

The request body requires `order` and `modification`.

The `modification` object requires `accommodation`, which identifies the `reservation` and the `type` and details of the change.

| Required field | Description |
| --- | --- |
| `order` | The identifier of the `order` that contains the `accommodation` reservation. |
| `modification` | The requested modification. It must contain an `accommodation` object. |
| `modification.accommodation` | Identifies the `reservation` and the `accommodation` `change` to preview. |
| `modification.accommodation.reservation` | The identifier of the `accommodation` `reservation` within the order. |
| `modification.accommodation.type` | The `change` to preview: dates or room. |
| `modification.accommodation.change` | The details of the requested change. The required fields depend on type. |

- For a date change, `change` must include `checkin` and `checkout` as calendar dates in YYYY-MM-DD format. The check-out date must be later than the check-in date.
- For a room change, `change` must include `room_reservation` and `allocation.number_of_adults`. The adult count must be at least 1 and must not exceed the room's maximum capacity.

## Preview a date `change`

Set `modification.accommodation.type` to dates and provide the new check-in and check-out dates in `modification.accommodation.change`.

### Example request

```json
{
  "order": "6520081014",
  "modification": {
    "accommodation": {
      "reservation": "6187285715",
      "type": "dates",
      "change": {
        "checkin": "2027-04-19",
        "checkout": "2027-04-21"
      }
    }
  }
}
```

A date `change` may affect the total `order` price.

- If the preview is modifiable, compare `data.price.current.amount` with `data.price.new.amount`.
- The `currency` field applies to both amounts.

## Preview a room `allocation` `change`

Set `modification.accommodation.type` to room to preview a `change` to the number of adults allocated to a room reservation.

This preview does not support guest names or smoking preferences modifications.

### Example request

```json
{
  "order": "6520081014",
  "modification": {
    "accommodation": {
      "reservation": "6187285715",
      "type": "room",
      "change": {
        "room_reservation": "9876543210",
        "allocation": {
          "number_of_adults": 2
        }
      }
    }
  }
}
```

The request uses two identifiers:

- `reservation` identifies the accommodation reservation within the order.
- `room_reservation` identifies the room reservation whose adult `allocation` you want to change.

Use the /orders/details/accommodations endpoint to retrieve `reservation` details and confirm the identifiers required for the modification.

---

## Understand the response

All responses include:

- `request_id` – Unique identifier for the request.
- `data.modifiable` – Indicates whether the requested `change` can be applied.

### Change can be applied

When `data.modifiable` is true, submit the same `change` to /orders/modify. For a date `change`, the response includes price. For a room `allocation` `change`, `price` is not returned.

**Example of date modification response:**

```json
{
  "request_id": "0123456789abcdef0123456789abcdef",
  "data": {
    "modifiable": true,
    "price": {
      "currency": "EUR",
      "current": {
        "amount": 200.00
      },
      "new": {
        "amount": 250.00
      }
    }
  }
}
```

The `price` object is returned only for a modifiable date change.

- It contains the `current` and proposed total `order` prices.
- The `currency` field applies to both amounts.

Use these values to show the proposed `price` and any difference before submitting the modification.

| Explanation | Action |
| --- | --- |
| The modification can be applied | You can proceed with /orders/modify. |
| The `price` field indicates the new amount. | Display the updated pricing. |

### Change cannot be applied

When `data.modifiable` is `false`, the response includes a `reason` code. Do not submit the `change` to /orders/modify.

```json
{
  "request_id": "0123456789abcdef0123456789abcdef",
  "data": {
    "modifiable": false,
    "reason": "not_available"
  }
}

```

Use the `reason` code to explain why the requested change cannot be applied.

| Reason code | Meaning |
| --- | --- |
| `not_allowed_for_online_payment` | The requested date `change` is not allowed because the `order` was paid online at the time of booking. |
| `guest_count_change_not_allowed` | The number of adults cannot be changed because the rate uses a fixed occupancy configured by the property. |
| `exceeds_room_capacity` | The requested number of adults exceeds the `room`'s maximum capacity. |
| `no_change_needed` | The requested values match the `current` `reservation` details, so no `change` is needed. |
| `exceeds_max_nights` | The requested date range exceeds the maximum stay duration configured for the property. |
| `not_available` | The `accommodation` is not available for the requested dates. |
| `modification_not_possible` | The `change` cannot be applied because of another business constraint or system limitation. |

| Explanation | Action |
| --- | --- |
| The modification cannot be applied | Do not call /orders/modify endpoint. |
| The `reason` field explains why | Display the `reason` to the user. |

---

## Errors

HTTP 200 means the preview request was processed. A business constraint is represented by `data.modifiable` set to false and a `reason` code.

An HTTP error means the request could not be processed. For example:

- HTTP 400 can indicate missing or malformed values, an invalid request structure or an unsupported `modification` type.
- HTTP 404 indicates that the `order` or `reservation` does not exist or is not accessible to the affiliate making the request.
- HTTP 500 indicates an unexpected server error; retry later and contact support if the problem continues.

## Limitations

- The endpoint previews only `accommodation` date changes and changes to the number of adults allocated to a `room` reservation.
- It does not preview payment card changes, guest name changes or smoking preference changes.
- Price information is returned only for a modifiable date change.
- A preview does not reserve availability or guarantee that the subsequent `modification` request will succeed.

---

## Related guides

- [Modify your accommodation orders](/demand/docs/orders-api/order-modify) — Submit supported modifications and interpret the response.
- [Orders details](/demand/docs/orders-api/order-details) — Retrieve `order` and `reservation` details.
- [Troubleshoot order modifications](/demand/docs/orders-api/order-modify-troubleshooting) — Diagnose common `modification` errors.
- [Payment errors](/demand/docs/support/error-handling/payment-errors) — Review payment-related error guidance.
- [Cancel your orders](/demand/docs/orders-api/cancel-order) — Learn how to cancel an order.
