Technical Integration Guide
Complete technical reference for integrating WeatherIt weather protection into your booking flow, including URL structure, parameter specifications, and API endpoints.
Overview
This guide provides the technical specifications for integrating WeatherIt's Quote Landing Page (QLP) into your booking system. Partners can choose from multiple integration methods based on their technical requirements and security needs.
Base URLs
- Production QLP:
https://quote.weatherit.ai- Sandbox QLP:
https://quote.sandbox.weatherit.ai
Choosing Your Integration Method
WeatherIt supports three integration patterns. Choose the method that best fits your security requirements and technical capabilities.
| Method | Complexity |
|---|---|
| API Retrieval | Medium |
| Secure Token | High |
| Native URL | Low |
Method A: API Retrieval Integration
The API Retrieval method keeps booking data on your servers and provides it to WeatherIt on-demand. This ensures URLs stay clean, data remains current, and you maintain full control over what information is shared.
Architecture Overview
sequenceDiagram
autonumber
participant Customer as Customer Browser
participant QLP as WeatherIt QLP<br/>quote.weatherit.ai
participant API as WeatherIt Backend<br/>api.weatherit.ai
participant Partner as Your API Server<br/>api.yourcompany.com
Customer->>QLP: Clicks link with ?partner=xxx&booking=yyy
QLP->>API: Request booking details
API->>Partner: GET /bookings/{booking_id}
Partner-->>API: Return booking JSON
API-->>QLP: Booking data + Quote
QLP-->>Customer: Display coverage options
Note over Customer,Partner: Customer completes purchase on QLP
How It Works
flowchart LR subgraph Step1[Step 1: Customer Action] A[Customer clicks<br/>WeatherIt link] end subgraph Step2[Step 2: Data Retrieval] B[QLP extracts<br/>partner & booking IDs] C[WeatherIt calls<br/>your API] D[Your API returns<br/>booking details] end subgraph Step3[Step 3: Quote Display] E[Quote generated<br/>from booking data] F[Customer sees<br/>coverage options] end A --> B --> C --> D --> E --> F style Step1 fill:#e8f4f8 style Step2 fill:#f0f8e8 style Step3 fill:#f8f0e8
URL Structure
The customer-facing URL is minimal and clean:
https://quote.weatherit.ai/?partner={partner_id}&booking={booking_id}
Example:
https://quote.weatherit.ai/?partner=a1b2c3d4-e5f6-7890-abcd-ef1234567890&booking=BOOK-3712
Required Parameters
| Parameter | Type | Description | Validation | Example |
|---|---|---|---|---|
partner | string | Your unique partner identifier (UUID format) | 3-100 characters | a1b2c3d4-e5f6-... |
booking | string | Your internal booking reference | Non-empty string | BOOK-3712 |
Your API Endpoint Requirements
You must expose an API endpoint that WeatherIt can call to retrieve booking details.
Security Considerations
| Aspect | Recommendation |
|---|---|
| Authentication | Use API key authentication for WeatherIt callbacks |
| IP Whitelisting | Whitelist WeatherIt API server IPs (provided during onboarding) |
| HTTPS | All endpoints must use TLS 1.2+ |
| Rate Limiting | Implement rate limiting |
Method B: Secure Token Integration
Booking data is exchanged server-to-server for a token, ensuring information never appears in URLs or browser history.
Architecture Overview
sequenceDiagram autonumber participant Platform as Customer Platform participant Customer as Customer Browser participant YourWeb as Your Website<br/>yourcompany.com participant YourServer as Your Backend Server participant WTAPI as WeatherIt API<br/>api.weatherit.ai participant QLP as WeatherIt QLP<br/>quote.weatherit.ai Platform->>YourServer: Request token generation YourServer-->>Platform: Redirect URL with token YourWeb->>Customer: Redirect to QLP Customer->>QLP: Opens ?token=wt_tok_... QLP->>WTAPI: Validate token WTAPI-->>QLP: Booking data QLP-->>Customer: Display coverage options
Token Exchange Flow
flowchart TB subgraph CustomerAction[Customer Action] A[Customer clicks<br/>'Add Weather Protection'] end subgraph ServerExchange[Server-to-Server Exchange] B[Your server sends<br/>booking data to WeatherIt] C[WeatherIt validates<br/>and stores data] D[Token generated<br/>wt_tok_xxx...] end subgraph CustomerRedirect[Customer Redirect] E[Your server redirects<br/>customer with token] F[Customer lands on QLP<br/>?token=wt_tok_xxx] end subgraph QuoteDisplay[Quote Display] G[Token validated<br/>Data retrieved] H[Quote displayed<br/>to customer] end A --> B --> C --> D --> E --> F --> G --> H style ServerExchange fill:#e8f8e8 style CustomerAction fill:#f8f8e8 style CustomerRedirect fill:#e8e8f8 style QuoteDisplay fill:#f8e8f8
Token Request Specification
Endpoint:
POST https://api.weatherit.ai/v1/tokens
Authorization: Bearer {your_api_key}
Content-Type: application/json
Request Body:
{
"partner_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"booking_id": "BOOK-3712",
"experience": {
"name": "Harbour Bridge Climb",
"type": "outdoor_activity",
"location": {
"latitude": -33.8523,
"longitude": 151.2108,
"suburb": "Sydney",
"state": "NSW",
"country": "AU"
}
},
"coverage": {
"start_date": "2025-03-15",
"end_date": "2025-03-15",
"amount": 250.00,
"currency": "AUD"
},
"customer": {
"email": "[email protected]",
"first_name": "John",
"last_name": "Smith"
},
"metadata": {
"source": "checkout_page",
"session_id": "sess_abc123"
}
}Success Response (201 Created):
{
"token": "wt_tok_abc123def456ghi789jkl012mno345pqr678",
"expires_at": "2025-01-20T12:15:00Z",
"quote_url": "https://quote.weatherit.ai/?token=wt_tok_abc123def456..."
}Error Response (400 Bad Request):
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"details": {
"coverage.start_date": "Must be a future date"
}
}
}Customer Redirect
After receiving the token, redirect the customer to the quote page:
https://quote.weatherit.ai/?token=wt_tok_abc123def456ghi789jkl012mno345pqr678
Security Features
| Feature | Description |
|---|---|
| Single-Use Tokens | Each token can only be used once |
| Server-to-Server | Sensitive data never touches customer browser |
| No URL Exposure | Booking details not visible in browser history |
| Audit Trail | All token creations logged for compliance |
Method C: Native URL Integration
The Native URL method passes all booking details directly in the URL. This is the simplest integration requiring no backend changes, making it ideal for email campaigns, quick launches, or MVPs.
Architecture Overview
sequenceDiagram autonumber participant Source as Email / Website / App participant Customer as Customer Browser participant QLP as WeatherIt QLP<br/>quote.weatherit.ai Source->>Customer: Link with all parameters embedded Note over Source,Customer: ?partner=xxx&booking=yyy&lat=-33.85<br/>&lon=151.21&start=2025-03-15&amount=250... Customer->>QLP: Clicks link QLP->>QLP: Extract & validate parameters QLP->>QLP: Generate quote from URL data QLP-->>Customer: Display coverage options Note over Customer,QLP: Customer completes purchase
How It Works
flowchart LR subgraph Source[Link Source] A[Email Campaign] B[Booking Confirmation] C[Partner Website] end subgraph URL[URL Contains Everything] D[partner & booking IDs] E[Location coordinates] F[Dates & amount] G[Experience details] end subgraph QLP[WeatherIt QLP] H[Parse URL params] I[Validate data] J[Generate quote] K[Display options] end A --> D B --> D C --> D D --> E --> F --> G --> H --> I --> J --> K style Source fill:#f8e8f8 style URL fill:#e8f8e8 style QLP fill:#e8e8f8
URL Structure
https://quote.weatherit.ai/?partner={partner_id}
&booking={booking_id}
&lat={latitude}
&lon={longitude}
&start={start_date}
&end={end_date}
&amount={amount}
&type={event_type}
&experience={experience_name}
Parameter Reference
Required Parameters
| Parameter | Type | Format | Description | Example |
|---|---|---|---|---|
partner | string | UUID | Your partner identifier | a1b2c3d4-e5f6-... |
booking | string | Any | Your booking reference | BOOK-3712 |
start | string | YYYY-MM-DD | Coverage start date | 2025-03-15 |
end | string | YYYY-MM-DD | Coverage end date | 2025-03-16 |
amount | number | Decimal | Booking value | 250.00 |
type | string | Enum | Event type (see below) | outdoor_activity |
experience | string | — | Experience/activity name | Harbour Bridge Climb |
product_name | string | — | Product identifier | premium_outdoor |
currency | string | AUD | Currency code | NZD |
lang | string | en | Language code | en |
country | string | AU | Country code | NZ |
Location Parameters
You must provide one of the following location options:
flowchart TD
A[Location Required] --> B{Which format?}
B -->|Recommended| C[Coordinates]
B -->|Alternative| D[Address-Based]
C --> E["lat=-33.8523<br/>lon=151.2108"]
D --> F["suburb=Sydney<br/>state=NSW"]
E --> G[Direct lookup<br/>Most accurate]
F --> H[Geocoded by WeatherIt<br/>Good accuracy]
style C fill:#d4edda
style E fill:#d4edda
Option A: Coordinates (Recommended)
&lat=-33.8523&lon=151.2108
| Parameter | Type | Range | Example |
|---|---|---|---|
lat | number | -90 to 90 | -33.8523 |
lon | number | -180 to 180 | 151.2108 |
Option B: Address-Based
&suburb=Sydney&state=NSW
| Parameter | Type | Example |
|---|---|---|
suburb | string | Sydney |
state | string | NSW |
Location Resolution
When using suburb/state, WeatherIt will geocode the address to coordinates. For maximum accuracy, we recommend providing coordinates directly.
URL Construction Examples
Full URL (All Parameters)
https://quote.weatherit.ai/?partner=a1b2c3d4-e5f6-7890-abcd-ef1234567890&booking=BOOK-3712&lat=-33.8523&lon=151.2108&start=2025-03-15&end=2025-03-16&amount=250.00&type=outdoor_activity&experience=Harbour%20Bridge%20Climb&product_name=premium¤cy=AUD&lang=en&country=AU
Address-Based URL
https://quote.weatherit.ai/?partner=a1b2c3d4-e5f6-7890-abcd-ef1234567890&booking=BOOK-3712&suburb=Sydney&state=NSW&start=2025-03-15&end=2025-03-15&amount=250.00&type=outdoor_activity&country=AU
URL Encoding Requirements
Critical: All parameter values containing special characters must be URL-encoded
| Character | Encoded | Example |
|---|---|---|
| Space | %20 | Harbour%20Bridge%20Climb |
& | %26 | Fish%20%26%20Chips |
+ | %2B | Lunch%2BDinner |
# | %23 | Tour%23123 |
Event Types Reference
The type parameter specifies the category of experience being protected.
| Type Value | Description | Example Use Cases |
|---|---|---|
outdoor_activity | Outdoor experiences | Bridge climbs, hiking tours, zip-lining, kayaking |
| 'camping' | Camping | Camp grounds, caravan parks |
accommodation | Lodging bookings | Hotels, vacation rentals, camping, glamping |
tour | Guided tours | City tours, wine tours, day trips, walking tours |
event | Ticketed events | Concerts, festivals, sporting events, weddings |
transport | Transportation | Scenic flights, boat cruises, rail journeys |
Validation & Error Handling
Parameter Validation Flow
The QLP validates all URL parameters before displaying the quote interface.
flowchart TD
A[URL Received] --> B[Extract Parameters]
B --> C{Valid Partner?<br/>3-100 chars}
C -->|NO| C1[Error: invalid-partner]
C -->|YES| D{Valid Booking?<br/>non-empty}
D -->|NO| D1[Error: missing-params]
D -->|YES| E{Integration Type?}
E -->|Minimal params| F[API Retrieval Mode]
F --> F1[Fetch from Partner API]
E -->|Has lat/start/amount| G{Valid Location?<br/>coords OR suburb}
G -->|NO| G1[Error: missing-params]
G -->|YES| H{Valid Dates?<br/>ISO 8601 format}
H -->|NO| H1[Error: invalid-format]
H -->|YES| I{Valid Date Range?<br/>start ≤ end}
I -->|NO| I1[Error: invalid-dates]
I -->|YES| J{Valid Amount?<br/>positive number}
J -->|NO| J1[Error: invalid-format]
J -->|YES| K[Generate Quote]
K --> L[Display Quote Page]
F1 --> L
C1 --> ERR[Error Page]
D1 --> ERR
G1 --> ERR
H1 --> ERR
I1 --> ERR
J1 --> ERR
style L fill:#d4edda
style ERR fill:#f8d7da
Validation Rules Summary
| Parameter | Validation | Error Code |
|---|---|---|
partner | 3-100 characters, valid format | invalid-partner |
booking | Non-empty string | missing-params |
lat | Number between -90 and 90 | invalid-format |
lon | Number between -180 and 180 | invalid-format |
start | Valid ISO 8601 date | invalid-format |
end | Valid ISO 8601 date | invalid-format |
| Date range | Start ≤ End | invalid-dates |
amount | Positive number | invalid-format |
| Location | Must have (lat+lon) OR (suburb+state) | missing-params |
Error Page Display
When validation fails, customers see a branded error page:
{
"type": "invalid-dates",
"title": "Invalid Date Range",
"message": "The event start date is after the end date.",
"details": "Please contact your booking provider for a corrected link."
}API Error Codes
Error Code Categories
flowchart LR subgraph Auth[Authentication Errors<br/>401/403] A1[MISSING_BEARER_TOKEN] A2[INVALID_TOKEN] A3[TOKEN_EXPIRED] A4[PARTNER_INACTIVE] end subgraph Val[Validation Errors<br/>400/422] B1[LOCATION_ERROR] B2[INSUFFICIENT_ADVANCE_NOTICE] B3[DURATION_EXCEEDED] B4[NO_COVERAGE_AVAILABLE] end subgraph Biz[Business Logic Errors<br/>422] C1[QUOTE_EXPIRED] C2[NO_STATIONS_FOUND] C3[HIGH_RISK_DETECTED] end style Auth fill:#f8d7da style Val fill:#fff3cd style Biz fill:#cce5ff
Authentication Errors (401/403)
| Code | HTTP Status | Description | Resolution |
|---|---|---|---|
MISSING_BEARER_TOKEN | 401 | Authorization header missing | Add API key to request |
INVALID_TOKEN_FORMAT | 401 | Token format incorrect | Check token prefix/format |
INVALID_TOKEN | 401 | Token is invalid or revoked | Generate new token |
TOKEN_EXPIRED | 401 | Token has expired | Generate new token |
PARTNER_INACTIVE | 403 | Partner account is inactive | Contact WeatherIt support |
PARTNER_SUSPENDED | 403 | Partner account is suspended | Contact WeatherIt support |
Validation Errors (400/422)
| Code | HTTP Status | Description |
|---|---|---|
LOCATION_ERROR | 422 | Unable to process location data |
INSUFFICIENT_ADVANCE_NOTICE | 422 | Booking date too close to coverage start |
DURATION_EXCEEDED | 422 | Coverage period exceeds maximum allowed |
NO_COVERAGE_AVAILABLE | 422 | No coverage options for this booking |
PREMIUM_THRESHOLD_EXCEEDED | 422 | Premium exceeds allowed limits |
Business Logic Errors (422)
| Code | HTTP Status | Description |
|---|---|---|
QUOTE_EXPIRED | 422 | Quote has expired and must be regenerated |
NO_STATIONS_FOUND | 422 | No weather stations available for location |
HIGH_RISK_DETECTED | 422 | Risk assessment exceeds acceptable thresholds |
INSUFFICIENT_HISTORICAL_DATA | 422 | Not enough weather data for location |
Support
For technical support or integration assistance:
| Channel | Contact |
|---|---|
| [email protected] | |
| Documentation | weatherit.readme.io |
Need Help?
Our integration team is available to assist with setup, testing, and go-live. Contact us for a technical onboarding session.
Updated 7 months ago
