# Preview order modifications 3.2 Beta

**Learn how to use the /orders/modify/preview endpoint to check and validate changes in accommodation orders. This guide outlines required parameters, and practical examples to validate accommodation dates, room details or payment modifications.**

## Overview

Use the /orders/modify/preview endpoint to check whether a requested modification can be applied to an order and review its impact before confirming the change.

Important
This endpoint does not apply any changes.

### When to use this endpoint

Use the preview endpoint to:

✅ Validate whether a modification is allowed before attempting it. 
✅ Avoid failed modification requests. 
✅ Show users the expected cost impact (for accommodation date changes) 

### How it fits in the flow

Use this endpoint as an optional step before modifying an order:

1. Call /orders/modify/preview.
2. Check the `modifiable` field in the response.
3. If true, proceed with /orders/modify.


Preview → Validate → Modify

## Supported modification types

The endpoint supports previewing the following changes:

| Modification type |  | Field to include in `modification` object |
|  --- | --- | --- |
| Payment | Card details | `type: card` |
| Accommodation | Check-in and check-out dates | `type: dates` |
| Accommodation
 | Room-level details
(guest allocation, guest names, smoking preferences)
 | `type: room`
 |


## Endpoint usage

When making a request to the [orders/modify/preview endpoint](/demand/docs/open-api/3.2-beta/demand-api/orders/orders/modify/preview), you must include:

### Request structure

The request body always includes:

| Required | Parameter | Description |
|  --- | --- | --- |
| ✓ | `order` | The order ID (string) of the booking to modify. |
| ✓ | `modification` | Object containing the modification details, either:* `payment` - For card updates.
* `accommodation` - For dates or room updates.

 |


## Preview card details modifications

To check whether modifications in the payment card is possible:

1. Use the `modification.payment` object.
2. Set `type` to `"card"`.
3. Include a `"change"` object with:


* `number`: The new credit card number.
* `cvc`: The card’s CVC code (3–4 digits).
* `cardholder`: The cardholder's name.
* `expiry_date`: The card's expiry date in **YYYY-MM format**.


### Example request - Card modification


```json
{
  "order": "6520081014",
  "modification": {
    "payment": {
      "type": "card",
      "change": {
        "cardholder": "John Doe",
        "number": "4111111111111111",
        "expiry_date": "2027-12",
        "cvc": "123"
      }
    }
  }
}
```

Refer to the [Credit card payments](/demand/docs/payments/payments-examples2#2.-create-your-order) section for best practices when using cards as payment method.

## Preview accommodation date change

To check whether an accommodation date modification is possible:

1. Use the `modification.accommodation` object to modify the dates.
2. Include the `reservation` ID.
3. Set `type` to `"dates"`.
4. Include the new dates in `change` (checkin and checkout) using **YYYY-MM-DD format**.


Modifying dates may change the total price. Check the `current` and `new` price in the response.

### Example request - Dates modification


```json
{
  "order": "4297204980",
  "modification": {
    "accommodation": {
      "reservation": "4297204980",
      "type": "dates",
      "change": {
        "checkin": "2026-10-20",
        "checkout": "2026-10-21"
      }
    }
  }
}
```

## Preview accommodation room change

To check whether it is possible to update room-level details such as guest names, allocation, or smoking preferences:

1. Use the `modification.accommodation`.
2. Set `type` to `room`.
3. Include the `reservation` ID.
4. In the `change` object, specify:


* `room_reservation` ID (string).
* `guests[].name` - Update the guest name(s).
* `allocation.number_of_adults` - Update number of adults.
* `smoking_preference` - Modify the smoking preference for the room ("smoking", "non_smoking", or "no_preference").


Use [/orders/details/accommodations endpoint](/demand/docs/open-api/demand-api/orders/orders/details/accommodations) to retrieve the `room_reservation` IDs located under "products" in each object. The `room_reservation` ID is required for all room-level modifications.

### Example request - Room modification


```json
{
  "order": "5000375899",
  "modification": {
    "accommodation": {
      "reservation": "5000375899",
      "type": "room",
      "change": {
        "room_reservation": "5448643068",
        "allocation": {
          "number_of_adults": 2
        },
        "guests": [
          { "name": "Test Test" },
          { "name": "Test2 Test" }
        ],
        "smoking_preference": "smoking"
      }
    }
  }
}
```

## Understanding the response

All responses include:

* `request_id` – Unique identifier for the request.
* `data.modifiable` – Indicates whether the modification can be applied.


### When `modifiable` is false


```json
{
  "data": {
    "modifiable": false,
    "reason": "Modification not allowed for this reservation since this order has been cancelled."
  }
}
```

* The modification cannot be applied.
* The reason field explains why.


### When `modifiable` is true


```json
{
  "data": {
    "modifiable": true
  }
}
```

* The modification can be applied.
* You can proceed with /orders/modify


### Price information (accommodation date changes only)

For date changes, the response includes updated pricing:


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

Use this to:

* Show users the updated total cost.
* Highlight any price difference before confirmation.


Note: `price` is only included for accommodation date modifications.

### Handling the response

If `modifiable = false`

* Do not call /orders/modify endpoint.
* Display the `reason` to the user.


If `modifiable = true`

* Proceed with /orders/modify endpoint.
* Optionally display updated pricing (if available)


## Limitations

* Price information is only returned for accommodation date changes.
* Not all modification scenarios may be supported.
* Behaviour and response fields may change as this endpoint is in Beta.


Curious to know more?
* Refer to the [orders/modify guide](/demand/docs/orders-api/order-modify) to learn how to proceed the modifications.
* Find likely errors in the [Error handling guide](/demand/docs/support/error-handling/about-errors).
* Check the [Cancellations guide](/demand/docs/orders-api/cancel-order) in case you need to cancel the order instead.