# Accommodations availability – Migrating to v3.2

**This guide helps you adapt your integration from v3.1 to v3.2 of the Demand API for the /accommodations/availability endpoint.**

---

## Introduction

This guide summarises the changes from /accommodations/availability v3.1 → v3.2 and provides practical guidance to maintain correct functionality, including:

- Request and response field changes.
- Multi-currency pricing support.
- Product-level inventory and policy updates.
- Recommendations and pricing updates.
- Best practices for iteration and UI handling.

## Breaking changes v3.2  Breaking changes

Breaking changes

These are the only breaking or integration-impacting changes between 3.1 and 3.2 versions.

| Field | v3.1 | v3.2 | Migration note |
| --- | --- | --- | --- |
| `data` | Single object per request | Array of objects, one per accommodation. Multiple accommodation ids accepted. | Update your parsing logic to handle an array instead of a single object. |
| `currency` | Single string field | Object with `accommodation` and `booker` currencies | Replace `currency` string references with `currency.accommodation` and `currency.booker`. |
| `products[].price` | Numeric fields (`base`, `book`, `chargeable_online`, `extra_charges`) | Objects per currency (`accommodation_currency`, `booker_currency`) | Update calculations and display logic to handle multi-currency objects. |
| `products[].deal.public_price` | Numeric | Object per currency | Same as above, update to handle multi-currency. |
| `products[].number_available_at_this_price` | Field name in v3.1 | Renamed to `products[].number_available` | Update field name in your parsing logic. |
| `products[].policies.cancellation.price` | Numeric | Object per currency | Update to handle multi-currency values. |
| `recommendation.price` | Numeric fields | Objects per currency | Adjust logic for multi-currency handling. |
| `products[].third_party_inventory` | Boolean | Object `inventory` | Update logic to use `inventory.third_party` and, optionally, `inventory.type`. |

## Important changes in v3.2

### /bulk availability deprecated

In v3.1, data was a single object. In v3.2, data is **an array of accommodation objects**

**Reason for change:**

v3.1 has two separate endpoints:

- /accommodations/availability – returned availability for a single property.
- /accommodations/bulk-availability – returned availability for multiple properties in a single request.

v3.2 merges both endpoints, so /accommodations/availability now supports returning availability for one or multiple properties. As a result, the data field is an array regardless of the number of properties requested.

**Migration note:**

- Update your code to iterate over `data[]` even if you are requesting availability for a single property.
- Any logic that previously assumed a single object in data must now handle an array of objects.

### Multi-currency support

Prices and charges are now objects with accommodation_currency and booker_currency.

Affects fields like:

- `products[].price`
- `products[].deal.public_price`
- `products[].policies.cancellation.price`
- `recommendation.price`

**Migration note:**

Replace numeric assignments with per-currency objects.

Migration example:

**v3.1 response **

```json

"base": 120.0

```

**v3.2 response**

```json

"base": { "accommodation_currency": 120.0, "booker_currency": 120.0 }

```

Update calculations, storage, and display logic to accommodate per-currency objects.

### Field renames

| v3.1 | v3.2 | Notes |
| --- | --- | --- |
| `products[].number_available_at_this_price` | `products[].number_available` | Update parsing logic and UI templates. |

### Recommendations

- `recommendation.price` now follows the same multi-currency structure as products.
- `recommendation.products[].price` also changed to multi-currency objects.

**Migration note:**

Adjust pricing calculations and display for multi-currency fields.

---

## Field mapping v3.1 → v3.2

| v3.1 field | v3.2 field | Notes / Migration action |
| --- | --- | --- |
| `data` | `data[]` | v3.2 returns an array of accommodation objects. Update loops. |
| `data.currency` (string) | `data[].currency.accommodation` / `data[].currency.booker` | Replace string with multi-currency object |
| `data.products[].deal.public_price` (number) | `data[].products[].deal.public_price.accommodation_currency` / `booker_currency` | Convert numeric to object per currency |
| `data.products[].number_available_at_this_price` | `data[].products[].number_available` | Field renamed |
| `data.products[].policies.cancellation.free_cancellation_until` | **Deprecated** | v3.2 uses `cancellation[].from` and `cancellation[].price` per currency |
| `data.products[].policies.cancellation.schedule[].price` (number) | `data[].products[].policies.cancellation[].price.accommodation_currency / booker_currency` | Convert numeric to object per currency |
| `data.products[].policies.cancellation.type` | **Deprecated** | Use `cancellation[]` array for fees; `type` no longer provided |
| `data.products[].price.base` | `data[].products[].price.base.accommodation_currency / booker_currency` | Convert numeric to multi-currency object |
| `data.products[].price.chargeable_online` | `data[].products[].price.chargeable_online.accommodation_currency / booker_currency` | Convert numeric to multi-currency object |
| `data.products[].price.book` | `data[].products[].price.display.accommodation_currency / booker_currency` | `book` is now `display` in v3.2 |
| `data.products[].price.extra_charges.conditional[]` | `data[].products[].price.charges[]` | Charges are now all in `charges[]` array with `included_in` for display / chargeable_online |

---

## Migration steps

### 1. Update parsing of data

- Iterate over `data[]` instead of treating data as a single object.

### 2. Update your models

- Reflect v3.2 field changes:
    - Multi-currency support (`currency.accommodation` and `currency.booker`)
    - New `price.display`, `price.total`, and `price.charges` structures
    - Product-level inventory and pricing changes (`inventory.type`, `inventory.third_party`).
- Update enums:
    - `cancellation.type` removed in favour of `cancellation[] `array
    - `number_available_at_this_price` → `number_available`

### 3. Update recommendation handling:

- Parse and display recommendation prices using multi-currency objects.

### 4. UI & Business logic

- Update front-end display to use `price.display` instead of `price.book`.
- Adjust booking flows for multiple payment timings (`products[].policies.payment.timings`).
- Update handling of charges, including `chargeable_online` and `included_in` flags.

### 6. Test end-to-end

- Validate API responses for multi-currency pricing, inventory type, cancellation, and payment policies.
- Use [Sandbox environment](/demand/docs/getting-started/sandbox) and test properties.
- Verify correct handling of third-party inventory flags and charge breakdowns.

### 7. Rollout

- Migrate gradually in a staging environment.
- Monitor logs using `request_id`.
- Fully migrate once all tests pass and all business logic is confirmed.

---

## What´s next

- Check to [accommodations/availability](/demand/docs/open-api/3.2/demand-api/accommodations/accommodations/availability) reference
