Zim
by @robinmtzieme-commits
Agent travel middleware for searching flights, hotels, and car rentals, assembling policy-aware itineraries, managing traveler preferences, and preparing pay...
clawhub install zimπ About This Skill
name: zim description: >- Agent travel middleware for searching flights, hotels, and car rentals, assembling policy-aware itineraries, managing traveler preferences, and preparing payment-ready booking workflows via Stripe Checkout. Uses Travelpayouts affiliate API and SerpApi for search aggregation. Includes a Python CLI/package, shell search scripts, and a WhatsApp conversational agent. Use when the user asks to search, compare, rank, assemble, approve, or prepare booking for flights, hotels, accommodations, car rentals, or full trips. metadata: openclaw: requires: bins: ["python3", "bash", "curl", "jq"] capabilities: - id: stripe_checkout description: Creates Stripe Checkout sessions for payment collection (test mode by default) scope: payment requires_env: ["STRIPE_SECRET_KEY"] - id: travelpayouts_search description: Searches flights and hotels via Travelpayouts affiliate API scope: search requires_env: ["TRAVELPAYOUTS_TOKEN"] - id: serpapi_search description: Searches flights and hotels via SerpApi for Google Flights/Hotels results scope: search requires_env: ["SERPAPI_KEY"] sensitive_env: - STRIPE_SECRET_KEY - STRIPE_WEBHOOK_SECRET - TRAVELPAYOUTS_TOKEN - SERPAPI_KEY - OPENROUTER_API_KEY
Zim β Agent Travel Middleware
Use Zim as a travel workflow engine, not a generic search helper. Accept structured or messy travel intent, apply policy and traveler preferences, assemble coherent booking-ready options, and state clearly what is and is not automated.
What this package contains
This skill package includes:
SKILL.md β operating instructions for the skillscripts/search-flights.sh β Travelpayouts/Aviasales flight search with cached-fare fallbackscripts/search-hotels.sh β hotel deeplink generation for live availability lookupscripts/search-cars.sh β car rental comparison deeplinksreferences/api-guide.md β API/deeplink notes for Travelpayouts and related linksreferences/agent-to-agent-booking.md β product model and truthfulness ruleszim/ β Python package implementing:zim flights, zim hotels, zim cars, zim trip, zim preferences, zim policy)
- booking state machine and local booking persistence
- Stripe Checkout session creation for payment collection
- placeholder booking executor that does not complete real supplier reservations
tests/ β package testspyproject.toml β Python package metadata and dependency declarationsDo not describe this package as shell scripts only. It contains both shell helpers and a Python application.
Runtime requirements
Require all of the following when using or publishing this skill:
bash
- curl
- jq
- python3
pydantic>=2.0
- click>=8.0
- httpx>=0.25
- python-dateutil
- stripe>=8.0
pytest>=7.0
- pytest-asyncio>=0.21
- respx>=0.21If a downstream environment expects requirements.txt, generate it from the package metadata or install from pyproject.toml. This package currently declares dependencies in pyproject.toml, not in a checked-in requirements.txt file.
Required environment variables
Declare these explicitly when using the skill:
| Variable | Required | Purpose |
|---|---|---|
| TRAVELPAYOUTS_TOKEN | Yes for flight/hotel affiliate search | Travelpayouts / Aviasales token used for API access and affiliate attribution |
| TRAVELPAYOUTS_MARKER | Yes for production affiliate attribution consistency | Affiliate marker identifier for Travelpayouts deeplinks and tracking |
| STRIPE_SECRET_KEY | Yes for payment flow | Stripe secret key used to create and retrieve Checkout Sessions |
| STRIPE_WEBHOOK_SECRET | Yes for webhook verification in deployed payment flow | Stripe webhook signature secret |
| ZIM_BASE_URL | No | Base URL for Stripe success/cancel redirects; defaults to http://localhost:8000 |
Important notes:
TRAVELPAYOUTS_TOKEN enables the current search scripts.TRAVELPAYOUTS_MARKER should be treated as required configuration for a production deployment even if some current scripts reuse the token as a marker fallback.STRIPE_SECRET_KEY should be sk_test_... in the current beta/test setup.External services and API dependencies
Zim depends on these external services:
Travelpayouts / Aviasales
Used for:Stripe
Used for:Linked booking/search destinations
Zim may generate outbound deeplinks to:These links are for comparison or manual completion unless a real provider executor is added.
Payment and booking boundaries
Be precise about what Zim does today.
Current payment state
Current booking execution state
PlaceholderExecutor does not create real airline, hotel, or car rental reservations.booked in plain language unless supplier-side booking execution truly happened.Preferred truthful language:
booking-ready options assembledawaiting approvalpayment link createdpayment collected; provider reservation still requires execution/manual completionAvoid false claims like:
your trip is fully bookedpayment completed and reservation confirmedPayment-data disclosure
Zim includes payment orchestration via Stripe, but payment-card handling is intentionally limited.
STRIPE_SECRET_KEY.STRIPE_WEBHOOK_SECRET in deployed flows.Treat booking/payment metadata as sensitive operational data even though raw card data is not stored by the package.
Quick start
Shell scripts
# Flights
bash scripts/search-flights.sh LHR DXB 2025-12-15 2025-12-20 usd 5Hotels
bash scripts/search-hotels.sh "Dubai" 2025-12-15 2025-12-18 usd 10Cars
bash scripts/search-cars.sh "Dubai Airport" 2025-12-15 2025-12-18
Python CLI
# Install package locally
python3 -m pip install .Search flights
zim flights LHR DXB 2026-04-15 --return-date 2026-04-20 --cabin businessSearch hotels
zim hotels Dubai 2026-04-15 2026-04-20 --stars-min 4Search cars
zim cars "Dubai Airport" 2026-04-15 2026-04-20 --car-class suvAssemble full itinerary
zim trip LHR DXB 2026-04-15 --return-date 2026-04-20 --mode business --human
WhatsApp Conversational Agent
When handling travel messages on the WhatsApp channel, use the Zim WhatsApp agent for a smoother conversational experience with stateful multi-turn flows (search β select β confirm β book).
How to invoke
bash /home/ubuntu/.openclaw/workspace/zim/scripts/zim-wa.sh "" "whatsapp:"
This returns JSON: {"response": "...", "success": true/false}
Send the response text back to the user on WhatsApp.
Conversation flow
The WhatsApp agent maintains state per user automatically: 1. User sends a natural language travel request β agent returns search results 2. User replies with 1, 2, or 3 β agent shows selection summary, asks YES/NO 3. User says YES β agent returns booking confirmation + deeplink 4. User says CANCEL at any point β resets to fresh search
State persists across calls via SQLite, so multi-message conversations work.
When to use the WhatsApp agent vs direct CLI
zim-wa.sh)zim flights, zim hotels)search-flights.sh)Agent workflow
Parse into a structured travel object
Extract as many of these fields as possible:
Core trip fields
business or personalFlight fields
Hotel fields
Car fields
Policy / workflow fields
If key fields are missing, ask only for the minimum needed to continue.
Convert city names to IATA codes before flight search where needed. Common defaults:
Convert dates to YYYY-MM-DD.
Business vs personal mode
Apply ranking differently by mode.
Business mode
Personal mode
Running searches
Use the Python CLI when you want structured JSON for agent consumption. Use shell scripts when you want simple direct output and live deeplinks.
Assemble an itinerary, not disconnected results
Default behavior is to combine flight + hotel + car into a coherent recommendation when the request implies a trip.
Preferred response structure: 1. Trip summary 2. Recommended flight 3. Recommended hotel 4. Recommended car (if relevant) 5. Why this is the best fit 6. Action state β booking-ready / approval-needed / missing info
Presenting results
Flights
Hotels
Cars
Approval and state handling
When total cost exceeds threshold or any item is out of policy, say approval is required.
When payment has not been started, say so. When payment link/session exists, say so. When provider execution is still placeholder/manual, say so.
Preference memory
Surface recurring preferences as durable travel preferences when relevant:
Error handling
TRAVELPAYOUTS_TOKEN is not set, explain that affiliate-linked flight/hotel search cannot run.STRIPE_SECRET_KEY is not set, explain that checkout session creation cannot run.References
Read these only when needed:
references/api-guide.mdreferences/agent-to-agent-booking.mdπ‘ Examples
Shell scripts
# Flights
bash scripts/search-flights.sh LHR DXB 2025-12-15 2025-12-20 usd 5Hotels
bash scripts/search-hotels.sh "Dubai" 2025-12-15 2025-12-18 usd 10Cars
bash scripts/search-cars.sh "Dubai Airport" 2025-12-15 2025-12-18
Python CLI
# Install package locally
python3 -m pip install .Search flights
zim flights LHR DXB 2026-04-15 --return-date 2026-04-20 --cabin businessSearch hotels
zim hotels Dubai 2026-04-15 2026-04-20 --stars-min 4Search cars
zim cars "Dubai Airport" 2026-04-15 2026-04-20 --car-class suvAssemble full itinerary
zim trip LHR DXB 2026-04-15 --return-date 2026-04-20 --mode business --human