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

# Get pricing options

> GET /v1/products/:id/pricing/options - Retrieve available pricing options

## Endpoint

```
GET https://api.voyantcloud.com/v1/products/:id/pricing/options
```

Retrieve available room categories and pricing options for products with per-room pricing models. This endpoint is used to display room selection options in booking interfaces.

## Authentication

<ParamField header="Authorization" type="string" required>
  Bearer token (e.g. <code>Authorization: Bearer YOUR\_API\_KEY</code>)
</ParamField>

## Path parameters

<ParamField path="id" type="string" required>
  Product ID (UUID format)
</ParamField>

## Query parameters

<ParamField query="departure" type="string">
  Departure ID to get departure-specific pricing
</ParamField>

<ParamField query="ratePlanId" type="string">
  Rate plan ID for multi-tier pricing
</ParamField>

## Request example

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.voyantcloud.com/v1/products/prod_123abc/pricing/options?departure=dep_789xyz" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const productId = "prod_123abc"
  const departureId = "dep_789xyz"

  const response = await fetch(
    `https://api.voyantcloud.com/v1/products/${productId}/pricing/options?departure=${departureId}`,
    { headers: { Authorization: `Bearer ${process.env.VOYANT_API_KEY}` } },
  )

  const options = await response.json()
  console.log(options)
  ```

  ```python Python theme={null}
  import requests
  import os

  product_id = 'prod_123abc'
  departure_id = 'dep_789xyz'

  response = requests.get(
    f'https://api.voyantcloud.com/v1/products/{product_id}/pricing/options',
    params={'departure': departure_id},
    headers={'Authorization': f"Bearer {os.environ['VOYANT_API_KEY']}"}
  )

  options = response.json()
  print(options)
  ```
</CodeGroup>

## Response

<ResponseField name="options" type="array" required>
  Array of available pricing options

  <Expandable title="Option properties">
    <ResponseField name="key" type="string">
      Unique option identifier
    </ResponseField>

    <ResponseField name="label" type="string">
      Display name for the option
    </ResponseField>

    <ResponseField name="pax" type="integer">
      Maximum occupancy for this option
    </ResponseField>

    <ResponseField name="amountPerPerson" type="number">
      Price per person in this option
    </ResponseField>

    <ResponseField name="currency" type="string">
      3-letter ISO currency code
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "options": [
      {
        "key": "single",
        "label": "Single Room",
        "pax": 1,
        "amountPerPerson": 120.00,
        "currency": "EUR"
      },
      {
        "key": "double",
        "label": "Double Room",
        "pax": 2,
        "amountPerPerson": 100.00,
        "currency": "EUR"
      },
      {
        "key": "triple",
        "label": "Triple Room",
        "pax": 3,
        "amountPerPerson": 85.00,
        "currency": "EUR"
      }
    ]
  }
  ```

  ```json 200 No options available theme={null}
  {
    "options": []
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "error": "Not found"
  }
  ```

  ```json 500 Server Error theme={null}
  {
    "error": "Failed to fetch"
  }
  ```
</ResponseExample>

## Use cases

### Room selector UI

Build a room selection interface:

```javascript theme={null}
async function loadRoomOptions(productId, departureId) {
  const response = await fetch(
    `https://api.voyantcloud.com/v1/products/${productId}/pricing/options?departure=${departureId}`,
    { headers: { Authorization: `Bearer ${process.env.VOYANT_API_KEY}` } },
  )

  const { options } = await response.json()

  return options.map((option) => ({
    id: option.key,
    name: option.label,
    maxOccupancy: option.pax,
    pricePerPerson: option.amountPerPerson,
    currency: option.currency,
    displayPrice: `${option.currency} ${option.amountPerPerson.toFixed(2)}/person`,
  }))
}
```

### Price comparison

Compare prices across room types:

```javascript theme={null}
function findBestValue(options) {
  if (!options.length) return null

  // Find option with lowest per-person price
  return options.reduce((best, current) =>
    current.amountPerPerson < best.amountPerPerson ? current : best,
  )
}
```

<Tip>
  Empty `options` array indicates the product uses a different pricing model (per person, per group,
  or per option).
</Tip>

## Related endpoints

<CardGroup cols={2}>
  <Card title="Calculate price" icon="calculator" href="/api-reference/pricing/calculate-price">
    Calculate total price with selected rooms
  </Card>

  <Card title="Get product" icon="box" href="/api-reference/products/get-product">
    Get full product details
  </Card>

  <Card title="Extensions" icon="puzzle-piece" href="/api-reference/products/extensions">
    Get available add-ons
  </Card>
</CardGroup>
