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

# Booking Flow

> How the AI uses FareHarbor actions to list tours, check availability, validate pricing, and complete bookings.

Once FareHarbor is [connected](/integrations/fareharbor/connect), your AI agent follows a structured flow to move customers from interest to confirmed reservation.

## Booking lifecycle

```mermaid theme={"dark"}
flowchart LR
    A[List tours] --> B[Check availability]
    B --> C[Validate pricing]
    C --> D{Payment link}
    C --> E{Direct booking}
    D --> F[Customer pays]
    E --> G[Booking confirmed]
    F --> G
```

The AI walks through these steps automatically based on the conversation. It will not skip ahead — availability is always checked before validation, and validation is always checked before booking.

## AI actions

Each action below maps to a toggle in the FareHarbor settings. Disable any action to prevent the AI from using it.

<AccordionGroup>
  <Accordion title="List Tours & Activities" icon="list">
    The AI retrieves all bookable items for the configured company. Each item includes a name, headline, and per-ticket pricing. This is usually the first action the AI calls when a customer asks what is available.
  </Accordion>

  <Accordion title="Check Availability" icon="calendar">
    Given a specific tour and date, the AI looks up open time slots. Each slot includes the start time, remaining capacity, and per-ticket-type pricing. The availability and customer type rate identifiers returned here are required for all subsequent booking steps.
  </Accordion>

  <Accordion title="Validate Booking" icon="circle-check">
    Before committing a booking, the AI confirms the selected time slot is still available and retrieves the exact price breakdown (subtotal, taxes, total). This guards against stale availability — a slot that was open seconds ago may have filled.
  </Accordion>

  <Accordion title="Create Booking" icon="check-to-slot">
    Confirms a reservation directly through the FareHarbor API. Requires the customer's name, email, and phone number. FareHarbor sends a confirmation email to the customer automatically.

    <Warning>
      Create Booking is **disabled by default**. It creates a confirmed reservation without collecting payment through FareHarbor's checkout. Enable it only if your payment workflow is handled separately.
    </Warning>
  </Accordion>

  <Accordion title="Get Booking" icon="magnifying-glass">
    Looks up an existing booking by its UUID. Returns the current status (booked, cancelled, rebooked), confirmation details, and whether the booking is still eligible for cancellation.
  </Accordion>

  <Accordion title="Cancel Booking" icon="ban">
    Cancels an existing booking by its UUID. FareHarbor applies a grace period after creation — the AI checks `is_eligible_for_cancellation` before attempting to cancel.
  </Accordion>

  <Accordion title="Get Payment Link" icon="link">
    Generates a FareHarbor payment link the customer can open to review their booking details and complete payment. This is the **recommended booking path** — the customer handles payment on FareHarbor's hosted checkout rather than providing card details in the conversation.
  </Accordion>

  <Accordion title="Send Payment Link via SMS" icon="comment-sms">
    Sends the payment link to the customer's phone number via SMS. The AI composes a short, friendly message in the customer's language and appends the payment link automatically. Useful during voice calls where the customer cannot click a link.
  </Accordion>
</AccordionGroup>

## Managing AI actions

Control exactly which actions your AI agent can perform from the FareHarbor settings in your [OpenCX dashboard](https://platform.open.cx/settings/integrations).

| Action                    | Default | What it controls                                  |
| ------------------------- | ------- | ------------------------------------------------- |
| List Tours & Activities   | On      | AI can show customers what is available           |
| Check Availability        | On      | AI can look up open time slots for a date         |
| Validate Booking          | On      | AI can confirm pricing before committing          |
| Create Booking            | **Off** | AI can complete a reservation directly            |
| Get Booking               | On      | AI can look up existing bookings                  |
| Cancel Booking            | On      | AI can cancel a booking on behalf of the customer |
| Get Payment Link          | On      | AI can generate a self-service payment URL        |
| Send Payment Link via SMS | On      | AI can text the payment link to the customer      |

## Payment links

Payment links are the recommended way to handle bookings. When the AI generates a payment link:

1. The customer receives a URL pointing to FareHarbor's hosted checkout.
2. The checkout page shows the selected tour, time slot, pricing, and a payment form.
3. The customer completes payment directly on FareHarbor — no card details pass through OpenCX.
4. FareHarbor sends the confirmation email.

The AI can share the link inline in a chat message or send it via SMS during a voice call.

## Good to know

<AccordionGroup>
  <Accordion title="Company resolution" icon="building">
    If you selected a default company during setup, the AI uses that company for all bookings without asking the customer. If you chose Auto-detect, the AI resolves the company from your affiliated companies list. When multiple companies are affiliated, the AI may ask the customer which company they mean.
  </Accordion>

  <Accordion title="Connection resolution (multi-location orgs)" icon="layer-group">
    If you have more than one FareHarbor connection configured, every tool call includes a `location` parameter identifying which connection to use. The AI resolves this automatically whenever the customer's request matches a specific connection (for example, the customer names a brand, region, or company that maps to one connection). If the request is ambiguous, the AI asks which location or brand the customer means before proceeding.

    Per-action toggles apply to **each connection independently** — you can allow bookings on one connection while keeping another read-only.
  </Accordion>

  <Accordion title="Pricing format" icon="dollar-sign">
    FareHarbor returns prices in cents. The AI converts to dollar format (e.g. \$45.00) before presenting to customers. Tax breakdowns are shown when the AI validates a booking.
  </Accordion>
</AccordionGroup>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Connect FareHarbor" icon="plug" href="/integrations/fareharbor/connect">
    API keys, sandbox mode, and Test & Connect.
  </Card>

  <Card title="Troubleshooting" icon="wrench" href="/integrations/fareharbor/troubleshooting">
    Connection failures, missing availability, SMS issues.
  </Card>

  <Card title="Chat" icon="comments" href="/integrations/fareharbor/channels/chat">
    How booking conversations work in chat.
  </Card>

  <Card title="Voice" icon="phone" href="/integrations/fareharbor/channels/voice">
    How booking conversations work on calls.
  </Card>
</CardGroup>
