> ## 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.

# Create Transport Option

> Create a departure-level transport option with optional legs and pricing override.

## Method

`POST` `/v1/products/:id/transport/options`

## Path Parameters

<ParamField path="id" type="uuid">Product ID that owns the departure.</ParamField>

## Body Parameters

<ParamField name="departure_id" type="uuid" required>Departure ID the option belongs to.</ParamField>
<ParamField name="key" type="string" required>Unique key for the option (per departure).</ParamField>
<ParamField name="name" type="string" required>Display name.</ParamField>
<ParamField name="description" type="string">Optional descriptive text.</ParamField>
<ParamField name="seats_total" type="integer">Total seats offered by the option.</ParamField>
<ParamField name="seats_available" type="integer">Available seats (optional override).</ParamField>
<ParamField name="pricing_override" type="object">Optional pricing adjustment.</ParamField>

<Expandable title="Pricing override">
  <ParamField name="pricing_override.price_delta.mode" type="string">`flat` or `percent`.</ParamField>
  <ParamField name="pricing_override.price_delta.amount" type="number">Absolute adjustment (major units) when mode is `flat`.</ParamField>
  <ParamField name="pricing_override.price_delta.value" type="number">Percentage (0-1) when mode is `percent`.</ParamField>
</Expandable>

<ParamField name="attributes" type="object">Arbitrary key/value metadata.</ParamField>
<ParamField name="legs" type="array">Optional array of leg definitions for the option.</ParamField>

<Expandable title="Leg object">
  <ParamField name="legs[].seq" type="integer">Ordering (defaults to array position).</ParamField>
  <ParamField name="legs[].mode_id" type="string">Transport mode ID.</ParamField>
  <ParamField name="legs[].operator_org_id" type="string">Provider organization ID.</ParamField>
  <ParamField name="legs[].from_place_id" type="string">Origin Google Place ID.</ParamField>
  <ParamField name="legs[].to_place_id" type="string">Destination Google Place ID.</ParamField>
  <ParamField name="legs[].airline_code" type="string">IATA airline code.</ParamField>
  <ParamField name="legs[].flight_number" type="string">Flight number.</ParamField>
  <ParamField name="legs[].is_charter" type="boolean">Whether the leg is chartered.</ParamField>
  <ParamField name="legs[].cabin_class" type="string">Cabin class label.</ParamField>
  <ParamField name="legs[].fare_class_code" type="string">Fare class.</ParamField>
  <ParamField name="legs[].depart_offset_minutes" type="integer">Offset (minutes) from departure start.</ParamField>
  <ParamField name="legs[].duration_minutes" type="integer">Duration in minutes.</ParamField>
  <ParamField name="legs[].luggage" type="object">JSON luggage data.</ParamField>
  <ParamField name="legs[].attributes" type="object">Additional metadata.</ParamField>
</Expandable>

## Headers

<ParamField header="Authorization" type="string">Bearer token (requires `products:write`).</ParamField>
<ParamField header="content-type" type="string">`application/json`</ParamField>

## Request Example

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.voyantcloud.com/v1/products/prod_123/transport/options" \
    -H "Authorization: Bearer $VOYANT_API_KEY" \
    -H "content-type: application/json" \
    -d '{
      "departure_id": "dep_456",
      "key": "athens-flight",
      "name": "Athens morning flight",
      "seats_total": 40,
      "pricing_override": {
        "price_delta": { "mode": "flat", "amount": 45 }
      },
      "legs": [
        {
          "mode_id": "mode_flight",
          "operator_org_id": "org_airline",
          "from_place_id": "ChIJ8UNwppk4j4ARzWPaN9xq_9o",
          "to_place_id": "ChIJGaK-SZcYtUYR0Y1DSXB6QrM",
          "flight_number": "RO381",
          "airline_code": "RO",
          "duration_minutes": 160
        }
      ]
    }'
  ```

  ```javascript Node.js theme={null}
  const res = await fetch("https://api.voyantcloud.com/v1/products/prod_123/transport/options", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.VOYANT_API_KEY}`,
      "content-type": "application/json",
    },
    body: JSON.stringify({
      departure_id: "dep_456",
      key: "coach",
      name: "Coach transfer",
    }),
  })
  const payload = await res.json()
  ```

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

  payload = {
    "departure_id": "dep_456",
    "key": "athens-flight",
    "name": "Athens morning flight",
    "seats_total": 40
  }

  resp = requests.post(
    "https://api.voyantcloud.com/v1/products/prod_123/transport/options",
    headers={
      "Authorization": f"Bearer {os.environ['VOYANT_API_KEY']}",
      "content-type": "application/json",
    },
    json=payload,
  )
  option = resp.json()
  ```
</RequestExample>

## Response

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "item": {
      "id": "opt_001",
      "departure_id": "dep_456",
      "key": "athens-flight",
      "name": "Athens morning flight",
      "description": null,
      "seats_total": 40,
      "seats_available": null,
      "pricing_override": {
        "price_delta": { "mode": "flat", "amount": 45 }
      },
      "attributes": {}
    }
  }
  ```
</ResponseExample>

<Tip>
  Legs are optional. If omitted, the option references the main departure segments.
</Tip>
