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

# Fetch Rates

## Overview

Retrieves daily rate breakdowns for multiple properties within a date range. Unlike the Discovery API which returns quote-based pricing, this endpoint returns raw daily rates per property — useful for rate synchronization, calendar views, and revenue analysis.

***

## Request

```
POST /v1/properties/rates
```

### Headers

| Header         | Type   | Required | Description                           |
| -------------- | ------ | -------- | ------------------------------------- |
| `Api-Key`      | string | Yes      | Your API key for authentication.      |
| `Channel-Id`   | string | Yes      | Your distribution channel identifier. |
| `Content-Type` | string | Yes      | Must be `application/json`.           |

### Request Body

| Field         | Type            | Required | Validation                      | Description                              |
| ------------- | --------------- | -------- | ------------------------------- | ---------------------------------------- |
| `propertyIds` | array of string | Yes      | Must not be empty.              | List of property IDs to fetch rates for. |
| `fromDate`    | string (date)   | Yes      | Must be today or in the future. | Start date in `YYYY-MM-DD` format.       |
| `toDate`      | string (date)   | Yes      | Must be today or in the future. | End date in `YYYY-MM-DD` format.         |

### Example Request

```bash theme={null}
curl -X POST "https://sandbox.elivaas.com/v1/properties/rates" \
  -H "Api-Key: YOUR_API_KEY" \
  -H "Channel-Id: YOUR_CHANNEL_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "propertyIds": ["prop_456", "prop_789"],
    "fromDate": "2025-08-01",
    "toDate": "2025-08-07"
  }'
```

***

## Response — `200 OK`

A JSON object where each key is a property ID and each value is an array of [DailyRate](#daily-rate-object) objects.

### Response Structure

| Key            | Type               | Description                                                         |
| -------------- | ------------------ | ------------------------------------------------------------------- |
| `{propertyId}` | array of DailyRate | Daily rates for the given property within the requested date range. |

### Daily Rate Object

| Field        | Type          | Description                                           |
| ------------ | ------------- | ----------------------------------------------------- |
| `propertyId` | string        | Identifier of the property.                           |
| `date`       | string (date) | The calendar date for this rate.                      |
| `rate`       | integer       | Rate amount for this date in the property's currency. |

### Example Response

```json theme={null}
{
  "prop_456": [
    {
      "propertyId": "prop_456",
      "date": "2025-08-01",
      "rate": 1500
    },
    {
      "propertyId": "prop_456",
      "date": "2025-08-02",
      "rate": 1800
    },
    {
      "propertyId": "prop_456",
      "date": "2025-08-03",
      "rate": 1800
    },
    {
      "propertyId": "prop_456",
      "date": "2025-08-04",
      "rate": 1500
    }
  ],
  "prop_789": [
    {
      "propertyId": "prop_789",
      "date": "2025-08-01",
      "rate": 2500
    },
    {
      "propertyId": "prop_789",
      "date": "2025-08-02",
      "rate": 3000
    }
  ]
}
```

### Validation Errors

When the request body fails validation, the API returns `400 Bad Request`:

| Condition           | Error Message                             |
| ------------------- | ----------------------------------------- |
| Empty `propertyIds` | `propertyIds must not be empty`           |
| Missing `fromDate`  | `fromDate is required`                    |
| Past `fromDate`     | `fromDate must be today or in the future` |
| Missing `toDate`    | `toDate is required`                      |
| Past `toDate`       | `toDate must be today or in the future`   |

***

## Error Handling

| Status | Meaning               | Description                                    |
| ------ | --------------------- | ---------------------------------------------- |
| `200`  | Success               | Rates returned.                                |
| `400`  | Bad Request           | Validation errors. Check the response message. |
| `401`  | Unauthorized          | Missing or invalid `Api-Key` or `Channel-Id`.  |
| `500`  | Internal Server Error | Unexpected error.                              |
