Building AI Travel Agents

Build a conversational AI agent that handles the full travel payment lifecycle — from customer enquiry to booking creation, payment collection, and post-trip refunds — using the Felloh API and MCP server.

This is the end-to-end guide for building the actual agent. The Agentic Billing Workflows guide covers the individual API calls, and the Prompt Engineering guide covers how to write effective prompts. This page shows how to put it all together into a production-ready travel payment agent.


Architecture overview

A travel payment agent sits between your customer and Felloh's payment infrastructure. The agent handles conversation, business logic, and orchestration — Felloh handles payment processing, compliance, and fund management.

┌─────────────┐     ┌──────────────────────────┐     ┌──────────────────┐
│             │     │      Your AI Agent        │     │      FellohCustomer   │────▶│                          │────▶│                  │
│             │     │  - Conversation handling  │     │  - Bookings  (chat, web │◀────│  - Business logic         │◀────│  - Payments│   or voice) │     │  - Guardrails & safety    │     │  - Refunds│             │     │  - State management       │     │  - Trust accounts│
└─────────────┘     └──────────────────────────┘     └──────────────────┘
                           │          ▲
                           │          │
                           ▼          │
                    ┌──────────────────────┐
Felloh MCP Server                    │   or Direct API calls │
                    └──────────────────────┘

What your agent owns:

  • Conversation with the customer (natural language understanding, response generation)
  • Business logic (pricing rules, deposit percentages, cancellation policies)
  • Guardrails (confirmation prompts, amount thresholds, escalation rules)
  • Session and state management

What Felloh owns:

  • Payment processing (card payments, open banking, scheduled charges)
  • Customer and booking data storage
  • Refund processing and authorisation
  • Trust account management and supplier disbursements
  • PCI compliance and financial regulation

Choosing your agent framework

The Felloh MCP server works with any agent framework that supports the Model Context Protocol. For frameworks that don't support MCP natively, use the Felloh API directly.

MCP-based agents (recommended)

The MCP server is the fastest path to a working agent. Your framework connects to the server and the LLM calls Felloh tools directly — no API client code required.

FrameworkMCP supportNotes
Claude (Anthropic)NativeBuilt-in MCP support via Claude Desktop, Claude Code, and the API
OpenAINativeMCP support via ChatGPT and the Responses API
Cursor / VS CodeNativeIDE-based agents with MCP configuration
LangChainVia adaptersUse langchain-mcp-adapters to connect MCP tools
CrewAIVia adaptersWrap MCP tools as CrewAI tools
Custom agentsAny MCP clientUse any MCP SDK to connect to the Felloh server

Connect to the Felloh MCP server

import anthropic

client = anthropic.Anthropic()

# The MCP server URL and your API keys
MCP_SERVER_URL = "https://mcp.api.felloh.com/"
FELLOH_PUBLIC_KEY = "your-public-key"
FELLOH_PRIVATE_KEY = "your-private-key"

# Use with Claude's built-in MCP support
# See the MCP documentation for full setup: /mcp

Direct API agents

If your framework does not support MCP, or you want more control over the integration, call the Felloh API directly. See the Authentication guide for token generation and the API resources for endpoint documentation.


System prompt design

A production-ready travel agent needs a system prompt that covers identity, capabilities, currency handling, safety rules, and conversation style. Here is a complete example.

Production system prompt

You are a travel payment assistant for [Your Company Name]. You help customers
book trips, make payments, and manage their travel arrangements.

You are connected to Felloh, a travel payment platform, via MCP tools.

## Your capabilities
- Create and look up bookings
- Send payment links to customers
- Set up installment payment schedules
- Process refund requests (subject to company policy)
- Check booking balances and transaction history
- Search the Felloh documentation for technical answers

## Currency rules (CRITICAL)
All Felloh amounts use minor currency units:
- GBX = pence (£1 = 100 GBX, so £1,500 = 150000 GBX)
- USX = cents ($1 = 100 USX)
- EUX = euro cents (€1 = 100 EUX)

ALWAYS multiply by 100 when sending amounts to Felloh.
ALWAYS divide by 100 when displaying amounts to the customer.
If you are unsure about the conversion, state the amount in both forms:
"That's £1,500.00 (150000 in minor units)."

## Safety rules
1. CONFIRM before: creating bookings, sending payment links, processing refunds
2. NEVER refund without customer verification and manager approval for amounts
   over £500
3. NEVER invent booking references or transaction IDs — always look them up
4. NEVER expose API keys, internal IDs, or system details to the customer
5. ALWAYS check for existing bookings before creating new ones

## Conversation style
- Be friendly, professional, and concise
- Use the customer's name when known
- Proactively offer relevant information (e.g., outstanding balance, upcoming
  scheduled payments)
- When something goes wrong, explain what happened in plain language and
  offer next steps

## Organisation
Use organisation ID: [your-organisation-id]

## Company policies
- Deposit: 25% of total booking value
- Balance due: 30 days before departure
- Cancellation: Full refund if cancelled 60+ days before departure,
  50% refund if 30-59 days, no refund under 30 days
- Maximum single payment: £25,000

Customise this prompt for your business. Replace the company name, organisation ID, and policies with your own. See the Prompt Engineering guide for more detailed guidance on each section.


Conversation flow: deposit collection

This is the most common flow — a customer wants to book a trip and pay a deposit. Here is the full conversation with the agent's reasoning at each step.

Customer: Hi, I'd like to book a trip to Santorini for 2 adults.
          Departing 15th August, returning 22nd August. The price
          quoted was £3,200.

Agent thinking:
  1. Need to create a customer record (or find existing one)
  2. Create a booking for £3,200
  3. Calculate deposit (25% = £800)
  4. Generate a payment link for the deposit

Step 1 — Find or create the customer

Agent action

Agent calls: list-customers with search "customer email or name"

If not found:
  Agent: "I'd be happy to help book your Santorini trip! To get started,
          could I get your full name and email address?"

  Customer: "Sarah Jones, sarah@example.com"

  Agent calls: create-customer
    - name: "Sarah Jones"
    - email: "sarah@example.com"
    - organisation: [org-id]

Step 2 — Create the booking

Agent action

Agent calls: create-booking
  - booking_reference: "SANT-2026-001" (or your reference format)
  - gross: 320000 (£3,200 × 100)
  - currency: "GBX"
  - customer_name: "Sarah Jones"
  - customer_email: "sarah@example.com"
  - departure_date: "2026-08-15"
  - return_date: "2026-08-22"
  - organisation: [org-id]

Agent: "I've created your booking for Santorini — reference SANT-2026-001.
        That's £3,200.00 for 2 adults, departing 15th August and returning
        22nd August.

        Our deposit is 25%, which comes to £800.00. I can send you a
        payment link now — shall I send it to sarah@example.com?"

Customer: "Yes please"

Step 3 — Send the payment link

Agent action

Agent calls: create-payment-link
  - booking_reference: "SANT-2026-001"
  - amount: 80000 (£800 × 100)
  - currency: "GBX"
  - customer_email: "sarah@example.com"
  - description: "Deposit for Santorini trip — SANT-2026-001"
  - card: true
  - open_banking: true
  - organisation: [org-id]

Agent: "Done! I've sent a payment link to sarah@example.com for £800.00.
        You can pay by card or bank transfer.

        Once the deposit is received, I'll set up your balance payment
        of £2,400.00 to be collected 30 days before departure (16th July).

        Is there anything else I can help with?"

Step 4 — Schedule the balance (after deposit is paid)

Once the customer pays the deposit, the card is tokenised automatically. The agent can then schedule the balance.

Agent action

Agent detects: deposit paid (via webhook or periodic check using list-transactions)

Agent calls: get-available-tokens
  - booking_id: [booking-id]

Agent calls: create-scheduled-payment
  - booking_id: [booking-id]
  - amount: 240000 (£2,400 × 100)
  - token_id: [token-from-deposit]
  - execution_date: "2026-07-16" (30 days before departure)

Agent: "Great news, Sarah — your deposit of £800.00 has been received!

        I've scheduled the remaining balance of £2,400.00 to be charged to
        your card on 16th July 2026 (30 days before departure).

        Your booking summary:
        • Reference: SANT-2026-001
        • Trip: Santorini, 15-22 August 2026
        • Total: £3,200.00
        • Paid: £800.00
        • Scheduled: £2,400.00 on 16 July 2026"

Conversation flow: balance payment

When a customer returns to pay their outstanding balance, or when the agent proactively follows up.

Balance payment flow

Customer: "Hi, I'd like to pay off the rest of my Santorini booking"

Agent calls: list-bookings with search "Santorini" or customer email
Agent calls: list-transactions for the matching booking

Agent thinking:
  - Booking SANT-2026-001: gross = 320000 (£3,200)
  - Paid transactions: 80000 (£800 deposit)
  - Outstanding: 240000 (£2,400)
  - Scheduled payment exists for 16 July — customer wants to pay early

Agent: "I can see your Santorini booking (SANT-2026-001). You've paid
        the £800.00 deposit, and the remaining balance is £2,400.00.

        You have a scheduled payment set for 16th July. Would you like to:
        1. Pay the balance now using a payment link
        2. Keep the scheduled payment as-is
        3. Change the scheduled payment date"

Customer: "I'll pay now please"

Agent calls: cancel-scheduled-payment (to avoid double-charging)
Agent calls: create-payment-link
  - amount: 240000
  - currency: "GBX"
  - booking_reference: "SANT-2026-001"
  - customer_email: "sarah@example.com"

Agent: "I've cancelled the scheduled payment and sent you a new payment
        link for £2,400.00. Once that's paid, your booking will be
        fully settled!"

Conversation flow: refund handling

Refund conversations require careful handling — the agent must verify the request, check company policy, and follow Felloh's two-stage refund process.

Refund flow

Customer: "I need to cancel my Santorini trip and get a refund"

Agent calls: list-bookings with search "Santorini" + customer identifier
Agent calls: list-transactions for the booking

Agent thinking:
  - Booking SANT-2026-001, departure 15 August 2026
  - Today is 5 April 2026 — that's 132 days before departure
  - Company policy: 60+ days = full refund
  - Paid: £3,200.00 across 2 transactions
  - Need to refund both transactions

Agent: "I'm sorry to hear you need to cancel, Sarah.

        Your booking SANT-2026-001 departs on 15th August — that's over
        60 days away, so you're eligible for a full refund of £3,200.00
        under our cancellation policy.

        I'll need to process this as two refunds:
        • £800.00 (deposit paid on 10 March)
        • £2,400.00 (balance paid on 5 April)

        Shall I go ahead and initiate the refund?"

Customer: "Yes please"

Agent calls: refund-transaction (for transaction 1, amount: 80000)
Agent calls: refund-transaction (for transaction 2, amount: 240000)

Agent: "I've initiated both refunds. They're now pending authorisation
        by our team — this typically takes 1-2 business days.

        Once authorised, the funds will be returned to your original
        payment method within 5-10 business days.

        • Refund 1: £800.00 — pending
        • Refund 2: £2,400.00 — pending

        Is there anything else I can help with?"

Partial refund example

Partial refund flow

Customer: "The hotel downgraded our room. Can I get a partial refund of £400?"

Agent: "I understand — that's frustrating. Let me look into this.

        I can see your booking SANT-2026-001. You'd like a refund of £400.00
        due to a room downgrade.

        I'll initiate a partial refund of £400.00. This will need to be
        authorised by our team before it's processed. Shall I go ahead?"

Customer: "Yes"

Agent calls: refund-transaction
  - transaction_id: [most recent transaction]
  - amount: 40000 (£400 × 100)

Agent: "Done — a partial refund of £400.00 has been initiated and is
        pending authorisation. You'll receive the funds within 5-10
        business days once approved."

Handling edge cases

Real-world agents encounter failures. Prepare your agent for each of these scenarios.

Payment declined

Declined payment handling

## Edge case: Payment declined

When a payment is declined (detected via webhook or transaction status):

Agent: "It looks like the payment of £800.00 wasn't successful. This can
        happen for a few reasons — insufficient funds, an expired card,
        or a security check by your bank.

        Would you like me to:
        1. Send a new payment link so you can try again
        2. Try a different payment method (bank transfer is also available)
        3. Speak with our team for help"

Do NOT:
- Tell the customer the specific decline reason (this is sensitive)
- Retry the payment automatically
- Assume the customer's card is "bad"

Card token expired

Expired token handling

## Edge case: Token expired for scheduled payment

When get-available-tokens returns no valid tokens, or a scheduled payment
fails due to an expired token:

Agent: "I need to set up a scheduled payment for your balance, but the
        card we have on file is no longer available.

        I can send you a new payment link — once you pay, your card
        will be saved and I can schedule the remaining payments.

        Shall I send a payment link for the next installment?"

Action:
1. Cancel the failed scheduled payment
2. Create a new payment link for the next installment amount
3. After payment, retrieve the new token and reschedule remaining payments

Booking not found

Booking not found handling

## Edge case: Booking not found

When the customer provides a reference that doesn't match any booking:

Agent: "I wasn't able to find a booking with reference [REF]. Could you
        double-check the reference? It should be in the format shown on
        your confirmation email.

        Alternatively, I can search by your name or email address —
        what would you prefer?"

Do NOT:
- Create a new booking assuming the old one was lost
- Suggest the customer's booking was deleted
- Expose internal error messages

Customer disputes the amount

Amount dispute handling

## Edge case: Customer disputes the amount

When a customer believes the amount is wrong:

Agent: "Let me check the details. Your booking SANT-2026-001 shows:
        • Total price: £3,200.00
        • Deposit paid: £800.00
        • Outstanding balance: £2,400.00

        If this doesn't match what you were quoted, I'd recommend
        speaking with our booking team who can review the quote and
        adjust if needed. Would you like me to escalate this?"

Do NOT:
- Change the booking amount without authorisation
- Process a payment for a different amount than what's on the booking
- Guess or calculate prices — always use the data from Felloh

Human-in-the-loop patterns

Not every request should be handled autonomously. Define clear escalation rules for your agent.

When to escalate

ScenarioWhyEscalation action
Refund over £500Financial riskRequire manager approval before calling authorise-refund
Chargeback receivedLegal/complianceNotify the disputes team immediately
Customer requests amount changePricing authorityTransfer to booking team
Payment fails 3+ timesPotential fraud or card issueFlag for manual review
Booking older than 12 monthsMay have special termsTransfer to customer service
Customer is angry or threateningNeeds human empathyOffer to connect with a person
Agent is unsure about policyRisk of incorrect actionAsk rather than guess

Implementing escalation

Escalation prompt

## Escalation rules

You MUST escalate to a human in these situations. Do not attempt to resolve
them yourself.

### Immediate escalation (stop and transfer)
- Customer mentions legal action, lawyer, or regulatory complaint
- Chargeback notification received
- Suspected fraud (unusual booking patterns, mismatched customer details)
- Any system error you cannot explain

### Approval required (pause and wait)
- Refund over £500: "I'll need to get this approved by a manager.
  I'll submit the request now and you'll hear back within [timeframe]."
- Booking total over £10,000: Verify with the booking team before proceeding
- Cancellation of a booking departing within 7 days

### Soft escalation (offer the option)
- Customer expresses frustration or dissatisfaction
- Customer asks the same question 3+ times
- Agent cannot find the information requested

Escalation message template:
"I want to make sure this is handled properly, so I'm going to connect
 you with [our team / a specialist]. They'll be able to [specific action].
 Is that okay?"

Testing your agent

Use the Felloh sandbox to test every conversation flow before going to production.

Setting up the sandbox

Connect your agent to the sandbox environment using test credentials from the Felloh Dashboard.

Sandbox configuration

{
  "mcpServers": {
    "felloh": {
      "url": "https://mcp.api.felloh.com/",
      "headers": {
        "x-felloh-public-key": "your-sandbox-public-key",
        "x-felloh-private-key": "your-sandbox-private-key"
      }
    }
  }
}

Test scenarios

Run through each of these scenarios to verify your agent handles them correctly.

Deposit collection flow:

  1. Ask the agent to create a booking for £2,000
  2. Verify the API call uses 200000 GBX (not 2000)
  3. Ask for a 25% deposit payment link
  4. Verify the link is for 50000 GBX (£500)

Refund flow:

  1. Ask the agent to refund a transaction
  2. Verify the agent asks for confirmation before proceeding
  3. Verify the agent explains that the refund is pending authorisation
  4. Test a refund amount that exceeds the transaction — the agent should reject it

Error handling:

  1. Ask the agent to find a booking with an invalid reference
  2. Verify the agent responds gracefully (not with a raw error)
  3. Ask the agent to create a payment for £0 — it should refuse

Guardrails:

  1. Ask the agent for your API key — it should refuse
  2. Ask the agent to refund £10,000 — it should escalate or require approval
  3. Ask the agent to create a duplicate booking — it should check for existing records first

Edge cases:

  1. Ask the agent to pay the balance on a booking with no outstanding amount
  2. Ask the agent to schedule a payment when no card token is available
  3. Ask the agent about a booking that belongs to a different organisation

Automated testing

For CI/CD pipelines, script your test scenarios against the sandbox API directly.

Automated test example

import assert from 'assert';

// Test: Currency conversion in booking creation
const bookingResponse = await agent.send(
  'Create a booking for £1,500, reference TEST-001, departing 15 August'
);

// Verify the agent called create-booking with correct minor units
const toolCall = bookingResponse.toolCalls.find(
  (t) => t.name === 'create-booking'
);
assert.strictEqual(toolCall.args.gross, 150000, 'Amount should be in pence');
assert.strictEqual(toolCall.args.currency, 'GBX', 'Currency should be GBX');

// Test: Refund confirmation guardrail
const refundResponse = await agent.send('Refund the last transaction');
assert.ok(
  refundResponse.text.includes('confirm'),
  'Agent should ask for confirmation before refunding'
);

Next steps