Import properties from Airbnb

Before connecting a property to any channel, make sure the following steps are completed:

  • An account has been created on the OTA using the property details provided below.

  • The listing has been published on the OTA.

  • The listing is currently active on the OTA.

  • You are logged in to the OTA with the same account that was used to create the listing.

⚠️ The connection process will fail if the listing is not active on the OTA prior to starting the connection.

Airbnb Integration Flow

The Airbnb Integration Flow enables landlords who already have properties listed on Airbnb to seamlessly import their existing listings into Hububb. This integration removes the need for manual property creation by automatically syncing all active Airbnb properties, their details, pricing, availability, and guest communications.

By connecting their Airbnb account, landlords can manage all their properties across multiple channels from a single platform while maintaining real-time synchronization with their original Airbnb listings. The entire process is designed to be fast (around 2 minutes) and simple.

Key Benefits

  • Fast property import — connect and sync all active Airbnb listings within minutes.

  • Centralized management — manage bookings, messages, and services from Hububb.

  • Real-time synchronization — pricing, availability, and guest messages stay in sync.

  • Multi-channel expansion — once imported, landlords can easily connect to additional OTAs like Booking.com and Vrbo.


Landlord User Experience Flow

This section describes what the landlord sees during the Airbnb integration process.

1

Connect Airbnb Account

The landlord lands on a clean, centered screen with the Airbnb logo at the top.

  • Title: “Import properties from Airbnb”

  • Descriptive text explaining that connecting the account will automatically import all properties and sync listings, availability, and pricing in real time.

  • Primary action: “Connect to Airbnb” button, with a loading state during the process.

  • Estimated sync time of ~2 minutes is shown.

  • A “Back” button (top-left) and “Powered by Channex” (top-right) are included.

  • Bottom section displays “Expand your reach” with partner logos (Booking.com, Vrbo, Hububb, Expedia).

Frontend actions / API calls:

  • GET /api/integrations/airbnb/connection-link is called to obtain the OAuth URL.

  • After successful connection, the user is redirected back to this screen; the "Connect to Airbnb" button shows loading while frontend polls:

    • GET /api/integrations/airbnb/status is used to fetch the connection status.

  • If status response is "connected", user is redirected to the Connection Success step.

Screenshot reference: ![[Desktop 15.png]]

2

Connection Success

Once the connection succeeds, a confirmation screen appears:

  • Title: “Successfully connected”

  • Description: Airbnb account has been connected to Hububb.

  • Primary action: “Explore your properties” button to proceed to the dashboard.

    • POST /api/properties/submit-airbnb-property endpoint is called on click.

  • A welcome message is sent to the landlord in chat from Hububb Operations.

  • Landlord is redirected to the Overview page.

At this point, the landlord can start managing their properties, bookings, and services in Hububb.


Frontend System Flow (Next.js)

This section explains what happens behind the scenes in the web app.


Backend Calls

What it does:

  • Ensures a Temporary Connection exists for the user (creates one if needed).

  • Asks Channex for an Airbnb OAuth link bound to that Temporary Connection.

  • Returns the URL that the frontend should open to let the landlord authorize Airbnb.

Step by step:

  1. If accountName is provided, check it’s not already connected for this user. If it is, return an error asking to use a different name or disconnect first.

  2. Look for an existing pending TemporaryConnection for this user/context. If none exists, create a temporary Property in Channex and then create a new TemporaryConnection in the DB linked to that temporary property.

  3. Ask Channex for an Airbnb connection URL, embedding the callback URL and the TemporaryConnection ID as the token.

  4. Return that URL to the frontend so the landlord can authorize Airbnb.

  5. After successful authorization, the backend will receive a callback and call the handle-redirect endpoint.

Data created/updated:

  • May create a Channex temporary Property.

  • Creates (or reuses) a TemporaryConnection with status pending.

What the frontend receives:

  • A single URL so the landlord can authorize Airbnb.


2) GET /api/integrations/airbnb/handle-redirect

What it does:

  • Channex calls this after the landlord completes Airbnb authorization.

  • Schedules a background job (Google Cloud Tasks) to perform the heavy lifting (property import and setup).

  • Redirects the landlord back to the correct UI, marked as status=pending.

Step by step:

  1. Receive channel_id from Channex and the temporary connection token (TemporaryConnection ID).

  2. If the channel is already connected elsewhere, mark the TemporaryConnection as failed with a clear reason.

  3. Create a short‑delay background task in the airbnb-connections queue, passing channelId and temporaryConnectionId.

  4. Redirect the user to a “pending” page. The redirect base depends on where the flow started (dashboard vs web). If the flow was initiated for a specific property request, redirect back to that property request page.


3) GET /api/integrations/airbnb/status

What it does:

  • Reports whether the connection is still pending, failed, or completed.

Step by step:

  1. Frontend polls this endpoint with userId and temporaryConnectionId.

  2. If the TemporaryConnection is present and pending → return { status: 'pending' }.

  3. If present and failed → return { status: 'failed', reason }.

  4. If not found → the background process has completed and removed it → return { status: 'connected' }.


4) POST /api/integrations/airbnb/connect

This is the background task that actually performs the onboarding work after OAuth approval.

What it does:

  • Validates the TemporaryConnection and user.

  • Pulls Airbnb active listing IDs via Channex.

  • If there are no active listings: deactivates and deletes the channel and stops with a clear message.

  • If listings exist:

    • Fetches full listing details (per listing).

    • Creates Properties in Channex.

    • Maps listing data and stores Properties in Hububb DB (with images, address, price).

    • Retrieves mapping details and creates Room Types and Rate Plans in Channex; persists Rooms and Rate Plans in Hububb DB.

    • Creates channel mappings (Airbnb listing ↔ Channex rate plan) and stores PropertyChannel and ChannelMapping in Hububb.

    • Activates the Channex channel and deletes the TemporaryConnection.

    • Creates booking and messaging webhooks in Channex.

    • Installs Channex Messages app if available.

    • Loads future reservations for the listings.

    • Activates the Airbnb service subscription(s) for the imported properties.

    • Deletes the temporary Channex property created at the start.

    • Optionally sends user confirmation emails per property and internal notification for new users.

    • Renames the channel to the chosen account name (if provided).

    • Lists each imported property on Hububb (marketplace service) if applicable.

Data created/updated (examples):

  • Hububb: Property, Image, Address, Price, Room, RatePlan, PropertyChannel, ChannelMapping, SubscriptionService.

  • Channex: Properties, Room Types, Rate Plans, Mappings, Webhooks, Channel activation.


5) POST /api/properties/submit-airbnb-property

What it does:

  • Finalizes the onboarding from the UI perspective (after connection shows as successful).

  • Confirms property import is complete and continues landlord flow into dashboard.

  • Sends a welcome message to the Landlord with content:

Welcome to Hububb Support. Our team is here to ensure your hosting journey is seamless. Use this chat to reach us for technical guidance, platform assistance or best practices. Your success is our priority, we're just a message away. Hububb Support Team


Backend System Flow (NestJS + Channex)

Once the user authorizes Airbnb in the popup, the backend takes over to finalize the integration.


Database Layer

Connection Handling

  • TemporaryConnection – Tracks OAuth process. Fields: userId, status, accountName, etc.

Property Data

  • Property – Stores Airbnb listing details (title, bedrooms, etc.).

  • PropertyChannel – Links Property to Airbnb OTA.

  • ChannelMapping – Maps Airbnb rate plans to Channex.

Operational Data

  • SubscriptionService – Tracks active Airbnb subscriptions.

  • Reservation – Guest bookings imported from Airbnb.

  • Customer – Guest contact details.

Data flow: Airbnb → Channex → Hububb (DB) → Elasticsearch → Hububb UI


Integrations

Airbnb OAuth

  • Standard OAuth 2.0 flow.

  • Tokens stored securely.

  • Refresh handled automatically.

Channex (Bridge Layer)

Channex is used as a bridge between Hububb and Airbnb APIs.

Endpoints used:

  • /meta/airbnb/connection_link - Generate connection URL

  • /channels/{id}/action/listings - Get active Airbnb listings

  • /channels/{id}/action/listing_details - Fetch detailed info

  • /channels/{id}/action/load_future_reservations - Import existing bookings

  • /channels/{id}/mappings - Create mapping between Airbnb and Hububb

Google Cloud Tasks

  • Handles background OAuth & sync jobs.

  • Queues: airbnb-connections, airbnb-sync.

  • Ensures non-blocking UI flow.

Webhooks & Messaging Apps

  • Webhooks: Booking events & new messages from Airbnb via Channex.

  • Channex Messaging App: Installed automatically after connection.

Elasticsearch

  • Indexes property data for Hububb search functionality.


QA & Testing Checklist

Connection Flow

  • Connection starts & completes successfully

  • OAuth redirect works

  • Temporary connection records created

Property Import

  • All active listings imported correctly

  • Property data mapped accurately

  • Pricing & images validated

UX

  • Clear error messages

  • Notifications delivered

  • Dashboard states accurate