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

# Quote API

> Re-check a selected option and return bookable quote data.

## Endpoint

```http theme={null}
POST /api/quote
```

`POST /api/quote/tgx` exists in controller but is not implemented yet. Use `/api/quote`.

## Authentication

* Required header: `api-key: <partner-api-key>`
* Required body field: `settings.access.code`

## Headers

| Header            | Required | Description               |
| ----------------- | -------- | ------------------------- |
| `Content-Type`    | Yes      | `application/json`        |
| `api-key`         | Yes      | Partner API key           |
| `connection-code` | Optional | Auto-filled from body     |
| `session-id`      | Optional | Auto-generated if missing |

## Request Body

### Top-level fields

| Field                 | Type    | Required | Notes                      |
| --------------------- | ------- | -------- | -------------------------- |
| `quoteCriteria`       | object  | Yes      | Selected option context    |
| `settings`            | object  | Yes      | Must include `access.code` |
| `distributionContext` | object  | No       | Optional                   |
| `requestFromPortal`   | boolean | No       | Default `false`            |

### `quoteCriteria` fields

| Field                               | Type    | Required | Notes                                       |
| ----------------------------------- | ------- | -------- | ------------------------------------------- |
| `optionId`                          | string  | Yes      | From `search` response option ID            |
| `accommodation.type`                | string  | No       | Default `Hotel`                             |
| `accommodation.code`                | string  | Yes      | Must match cached search option             |
| `occupancies[]`                     | array   | Yes      | Must match cached search occupancy snapshot |
| `occupancies[].occupancyId`         | number  | No       | Optional                                    |
| `occupancies[].paxes[]`             | array   | Yes      | Guest list                                  |
| `occupancies[].paxes[].age`         | number  | Yes      | Guest age                                   |
| `occupancies[].paxes[].nationality` | string  | No       | Guest nationality                           |
| `market`                            | string  | No       | Market code                                 |
| `paymentType`                       | string  | No       | Defaults to `MerchantPay`                   |
| `parameters[]`                      | array   | No       | Additional parameter list                   |
| `parameters[].key`                  | number  | Yes      | Parameter key                               |
| `parameters[].value`                | string  | Yes      | Parameter value                             |
| `parameters[].parameterType`        | string  | No       | Optional                                    |
| `parameters[].immutable`            | boolean | No       | Optional                                    |
| `parameters[].roomId`               | number  | No       | Optional                                    |
| `checkIn`                           | string  | Yes      | Must match search                           |
| `checkOut`                          | string  | Yes      | Must match search                           |
| `language`                          | string  | No       | Optional                                    |
| `currency`                          | string  | No       | Optional                                    |
| `nationality`                       | string  | No       | Optional                                    |

## Example Request

```json theme={null}
{
  "quoteCriteria": {
    "optionId": "177f8ec3-6d98-4a2f-8567-5c45eddb0ead",
    "accommodation": {
      "type": "Hotel",
      "code": "6475503709317edd78e1dbd9"
    },
    "occupancies": [
      {
        "occupancyId": 1,
        "paxes": [
          { "age": 30, "nationality": "US" },
          { "age": 28, "nationality": "US" }
        ]
      }
    ],
    "checkIn": "2026-03-01",
    "checkOut": "2026-03-03",
    "language": "EN",
    "currency": "USD",
    "nationality": "US"
  },
  "settings": {
    "access": { "code": 10001 }
  }
}
```

## Success Response

```json theme={null}
{
  "data": {
    "id": "cb4af805-08aa-4ec4-9f90-a8b94e6d9d54",
    "accommodation": {
      "accommodationCode": "6475503709317edd78e1dbd9",
      "accommodationName": "Comfort Inn & Suites",
      "accommodationType": "Hotel",
      "location": {
        "country": "US",
        "longitude": -81.90058,
        "latitude": 41.41568
      }
    },
    "occupancies": [
      {
        "occupancyId": 1,
        "paxes": [{ "age": 30 }, { "age": 28 }]
      }
    ],
    "checkIn": "2026-03-01",
    "checkOut": "2026-03-03",
    "boardCode": "RO",
    "boardName": "Room Only",
    "isRefundable": true,
    "rate": {
      "currency": "USD",
      "baseRate": 120.0,
      "taxesAndFees": 18.5,
      "chargeTotal": 138.5
    },
    "cancelPolicy": {
      "refundable": true,
      "cancelPenalties": [
        {
          "penaltyType": "IMPORT",
          "currency": "USD",
          "deadline": "2026-02-28T23:59:59Z",
          "value": 50
        }
      ]
    },
    "rooms": [
      {
        "occupancyRefId": 1,
        "code": "DBL",
        "description": "Double Room",
        "rate": {
          "currency": "USD",
          "baseRate": 120.0,
          "taxesAndFees": 18.5,
          "chargeTotal": 138.5
        }
      }
    ],
    "requestId": "req_quote_64f5..._1739260000000_91234",
    "responseTime": 81
  },
  "message": "success"
}
```

## Response Fields

| Field                | Type      | Notes                                |
| -------------------- | --------- | ------------------------------------ |
| `data.id`            | string    | Quote reference (`quoteId`) for book |
| `data.accommodation` | object    | Accommodation summary                |
| `data.occupancies[]` | array     | Normalized occupancy output          |
| `data.checkIn`       | string    | Check-in date                        |
| `data.checkOut`      | string    | Check-out date                       |
| `data.roomCodes[]`   | string\[] | Optional room code list              |
| `data.roomNames[]`   | string\[] | Optional room name list              |
| `data.boardCode`     | string    | Optional board code                  |
| `data.boardName`     | string    | Optional board name                  |
| `data.isRefundable`  | boolean   | Optional refundable flag             |
| `data.rate`          | object    | Quote-level pricing                  |
| `data.cancelPolicy`  | object    | Quote-level cancellation policy      |
| `data.rooms[]`       | array     | Room-level pricing details           |
| `data.requestId`     | string    | Trace ID                             |
| `data.responseTime`  | number    | Milliseconds                         |

## Validation Behavior

* `optionId` must exist and not be expired (search cache key)
* `accommodation.code` must match cached option payload
* `checkIn/checkOut` must match cached option payload
* `occupancies` must match cached payload snapshot
* If supplier quote price increased beyond tolerance, API returns `400 Price changed`

## Rate Limit Headers

`/quote` includes:

* `X-RateLimit-Limit`
* `X-RateLimit-Remaining`
* `X-RateLimit-Reset`
* `Retry-After` when limited (`429`)

## Common Errors

* `400 optionRefId is required`
* `400 Option reference expired or invalid`
* `400 Option reference invalid`
* `400 Accommodation code mismatch`
* `400 Stay dates mismatch`
* `400 Occupancy details mismatch`
* `400 Room is unavailable`
* `400 Price changed`
* `403 Invalid connection code.`
