Features How it Works WordPress Docs Pricing Contact
Sign In Get Started
Documentation

StayPilot Documentation

Everything you need to set up, configure, and get the most out of StayPilot.

Getting Started

StayPilot is an all-in-one hotel operating system. Follow these steps to go from sign-up to accepting live bookings in under 30 minutes.

New to StayPilot? Start here. This guide covers the essential setup steps. For advanced configuration, use the sidebar navigation to jump to specific sections.
  • 1
    Request Administrative Access

    StayPilot is a curated platform. To get started, Try live demo or contact our sales team. We will set up your hotel instance, create your administrative credentials, and walk you through the initial configuration.

    Once your account is provisioned, you will receive a secure login link to access your dedicated dashboard.

  • 2
    Configure Your Hotel Profile

    Navigate to Settings → Hotel Info. Fill in:

    • Hotel name, address, and contact details
    • Check-in / check-out times
    • Currency and timezone
    • Cancellation policy
    • Property photos (used in your booking widget)

    Click Save Changes. This information appears in booking confirmation emails sent to guests.

  • 3
    Add Your First Room

    Go to Rooms → Add New Room. Each room requires:

    • Room name — e.g. "Deluxe Sea View", "Standard Twin"
    • Room type — single, double, twin, suite, etc.
    • Base price per night
    • Capacity — max adults and children
    • Amenities — Wi-Fi, AC, minibar, balcony, etc.
    • Photos — at least 3 for best conversion

    Once saved, the room appears live in your booking widget and dashboard calendar.

  • 4
    Configure Email Notifications

    Go to Settings → Email Configuration. Enter your SMTP details and configure notification preferences. Send a test email to confirm delivery before going live.

    See Email Configuration for full setup instructions.

Dashboard Overview

The StayPilot dashboard is your command center. It gives you a real-time view of occupancy, revenue, and upcoming arrivals.

Dashboard Panels
  • Total Rooms — count of all rooms configured for your property
  • Total Bookings — all-time reservation count
  • Pending — reservations awaiting your confirmation
  • Revenue — total revenue from confirmed bookings
  • Recent Bookings — latest 6 reservations with booking ID, guest, room, dates, and amount
Room Management

Access via Rooms in the left navigation. The rooms list shows all configured rooms. Click any room to edit its details, set pricing, manage photos and amenities, or view its booking history. Use the Availability section to block dates for a specific room.

Bookings

The Bookings page lists all reservations. Use filters to narrow by date range, status, or room. Each booking record contains:

  • Guest name, email, and phone number
  • Check-in and check-out dates
  • Room assigned, number of guests, branch/property name
  • Total amount, payment status
  • Special requests

Booking statuses: pending — awaiting hotel approval. confirmed — reservation confirmed. payment_pending — online payment initiated but not yet received. cancelled — reservation cancelled. You can manually update a booking's status from its detail view.

Availability Calendar

The Availability page shows a calendar for each room across a date range. Each cell indicates whether the dates are open, booked, or blocked. You can:

  • Click a date range to block dates for maintenance or hold
  • Click an existing booking block to view or update that reservation
  • Bulk-update availability across multiple dates in one action
Analytics & Revenue

Revenue and booking data is available directly on the Dashboard. The Payments page gives a transaction-level breakdown:

  • Total bookings & revenue — displayed in the four stat cards at the top of the Dashboard
  • Pending bookings — reservations awaiting your approval
  • Payments — a list of all transactions with method, amount, and status
WordPress Plugin

The StayPilot WordPress plugin lets you embed your hotel booking widget directly on your existing WordPress website with no coding required.

WordPress Plugin Setup
  1. 1
    Install the Plugin

    Download staypilot-booking.php from your StayPilot account portal and upload it via WordPress Admin → Plugins → Add New → Upload Plugin. Activate the plugin once uploaded.

  2. 2
    Configure API Settings

    Go to Hotel Booking → Settings in the WordPress admin sidebar. Fill in both required fields:

    • API URL — the backend server URL (e.g. https://api.staypilot.lk). Provided by StayPilot when your account is provisioned.
    • Hotel Property Key — your unique hotel API key from StayPilot Dashboard → Settings → Property Key.
    Both API URL and Hotel Property Key are required. The widget will not load without them.
  3. 3
    Customize Appearance (optional)

    In the same settings page, expand Appearance Settings to configure:

    • Primary color — brand color for buttons and highlights
    • Font family — pick a Google Font or leave blank to inherit your theme's font automatically
    • Widget Layoutclassic (full-page wizard) or horizontal-bar (compact search bar)

    Advanced users can also inject Custom CSS from the Advanced Customization section in the plugin settings. It is scoped inside the widget's Shadow DOM and never affects the rest of your site.

Shortcodes (WordPress)

The plugin registers the [hotel_booking] shortcode. Add it to any page or post via the block editor (Shortcode block) or the classic editor.

Basic — uses settings configured in plugin admin
[hotel_booking]
Override API key per page (optional)
[hotel_booking api_key="YOUR_HOTEL_API_KEY"]

The widget is fully self-contained inside a Shadow DOM — it handles room search, date selection, guest details, and checkout in one flow, and its styles never affect the rest of your WordPress theme.

Custom CDN Script (non-WordPress)

For websites not using WordPress — plain HTML, React, Vue, or any other framework — embed the widget using the CDN script. There are three mounting strategies; pick the one that fits your site:

  1. A
    Declarative div container Recommended

    Add data-stay-pilot-widget to any <div> on the page. Load the script once anywhere (e.g. before </body>) — all matching divs mount automatically:

    html
    <!-- Place this where you want the widget -->
    <div
      data-stay-pilot-widget
      data-api-key="YOUR_HOTEL_API_KEY"
    ></div>
    
    <!-- Load the script once, anywhere on the page -->
    <script src="https://cdn.staypilot.lk/widget/latest/stay-pilot-widget.js"></script>

    You can also pass optional configuration attributes on the same div:

    html — with optional attributes
    <div
      data-stay-pilot-widget
      data-api-key="YOUR_HOTEL_API_KEY"
      data-primary-color="#1a56db"
      data-font-family="Poppins"
      data-template="horizontal-bar"
    ></div>
  2. B
    One-liner script tag

    Add data-api-key directly to the <script> tag. The widget auto-creates a container immediately before it:

    html
    <script
      src="https://cdn.staypilot.lk/widget/latest/stay-pilot-widget.js"
      data-api-key="YOUR_HOTEL_API_KEY"
    ></script>
  3. C
    Explicit container target

    Place an empty <div> with a specific id, then point the script at it via data-target:

    html
    <div id="booking"></div>
    
    <script
      src="https://cdn.staypilot.lk/widget/latest/stay-pilot-widget.js"
      data-api-key="YOUR_HOTEL_API_KEY"
      data-target="booking"
    ></script>
  4. D
    Programmatic — React / Vue / plain JS

    Call window.StayPilot.mount() after the script loads. In React, always call window.StayPilot.unmount() in your useEffect cleanup — this is required for React 18 Strict Mode:

    html / vue
    <div id="booking-container"></div>
    
    <script src="https://cdn.staypilot.lk/widget/latest/stay-pilot-widget.js"></script>
    <script>
      window.StayPilot.mount('booking-container', {
        hotelApiKey: 'YOUR_HOTEL_API_KEY',
      });
    </script>
    react — strict mode safe
    import { useEffect } from 'react';
    
    function BookingPage() {
      useEffect(() => {
        const script = document.createElement('script');
        script.src = 'https://cdn.staypilot.lk/widget/latest/stay-pilot-widget.js';
        script.onload = () => {
          window.StayPilot?.mount('booking-container', {
            hotelApiKey: 'YOUR_HOTEL_API_KEY',
          });
        };
        document.body.appendChild(script);
    
        // Required cleanup — prevents double-mount in React 18 Strict Mode
        return () => {
          window.StayPilot?.unmount('booking-container');
        };
      }, []);
    
      return <div id="booking-container" />;
    }
    The server URL is baked into the widget bundle — you only need hotelApiKey. Do not pass apiUrl; the baked-in value is always used.
Supported Data Attributes

Place these on the <div data-stay-pilot-widget> container (Method A) or on the <script> tag (Methods B / C):

AttributeRequiredDescription
data-api-keyYesYour hotel API key
data-targetNoID of an existing container div to mount into (Methods B/C only)
data-primary-colorNoBrand color for buttons, e.g. #1a56db
data-font-familyNoGoogle Font name, e.g. Poppins. Defaults to the host page's body font.
data-templateNoWidget layout: classic (default) or horizontal-bar
data-debugNoSet to true to enable verbose console output
Widget Layouts

Two layout templates are available:

  • classic (default) — full-page multi-step wizard; best for a dedicated booking page
  • horizontal-bar — compact single-row search bar with results appearing below; ideal for header areas or hotel chain-style sites

The widget runs inside a Shadow DOM — host-page CSS can never affect it and widget CSS can never bleed into your site.

API Reference

The StayPilot REST API lets you integrate with third-party tools or build custom booking flows. The public widget API uses an API key; the hotel admin API uses a JWT token.

Widget (Public) API — API Key Auth

All public widget endpoints require your Hotel API Key. Pass it as a header:

http header
X-API-Key: YOUR_HOTEL_API_KEY

Alternatively pass it as a query parameter: ?api_key=YOUR_HOTEL_API_KEY

Hotel Admin API — JWT Auth

The hotel management API (rooms, bookings, settings) requires a JWT issued at login. POST your credentials to /hotels/login, then include the token:

http header
Authorization: Bearer YOUR_JWT_TOKEN
Keep your API key secret. Never expose it in public repositories. Rotate it immediately if compromised via Dashboard → Settings → Regenerate Key.

Base URL:

base url
https://api.staypilot.lk

All responses are JSON. Successful responses include "success": true and a data key. Errors include "success": false, an error message, and a machine-readable code.

success response
{ "success": true, "data": { /* payload */ }, "message": "" }
error response
{ "success": false, "error": "Room not found", "code": "NOT_FOUND" }
Rooms API

Hotel Admin endpoints (requires JWT). Base path: /hotels/rooms

MethodEndpointDescription
GET/hotels/roomsList all rooms for your hotel
GET/hotels/rooms/{id}Get details for a specific room
POST/hotels/roomsCreate a new room
PUT/hotels/rooms/{id}Update room details or pricing
DELETE/hotels/rooms/{id}Delete a room (no active bookings allowed)
GET/hotels/rooms/{id}/availabilityGet availability records for a room
POST/hotels/rooms/{id}/availabilitySet availability for a date range
POST/hotels/rooms/{id}/availability/bulkBulk-update availability across multiple ranges
GET /hotels/rooms — example response
{
  "success": true,
  "data": [
    {
      "room_id": 1,
      "name": "Deluxe Sea View",
      "description": "...",
      "capacity": 2,
      "price": 149.00,
      "branch_id": 1,
      "branch_name": "Main Building"
    }
  ]
}
Bookings API

Hotel Admin endpoints (requires JWT). Base path: /hotels/bookings

MethodEndpointDescription
GET/hotels/bookingsList all bookings (supports filters)
GET/hotels/bookings/{booking_id}Get a single booking with full guest details
PUT/hotels/bookings/{booking_id}/statusUpdate booking status (confirmed / cancelled)
PUT/hotels/bookings/group/statusBatch-update status for a group booking
DELETE/hotels/bookings/{booking_id}Permanently delete a booking record

Public widget endpoints (requires API Key). Base path: /api/public

MethodEndpointDescription
POST/api/public/bookingsCreate a single-room booking
POST/api/public/bookings/batchCreate a multi-room group booking
GET/api/public/bookings/{id}Retrieve a booking by ID
POST/api/public/bookings/{id}/cancelCancel a booking
POST /api/public/bookings — request body
{
  "room_id": 1,
  "check_in": "2026-03-15",
  "check_out": "2026-03-18",
  "guests": 2,
  "first_name": "Jane",
  "last_name": "Smith",
  "email": "jane@example.com",
  "phone": "+1-555-0100",
  "country": "US",
  "special_requests": "Early check-in if possible"
}
Availability & Search API

Public widget endpoints (requires API Key). Base path: /api/public

MethodEndpointDescription
GET/api/public/availabilityCheck availability for a specific room and date range
GET/api/public/searchSearch all rooms with availability in one call
GET/api/public/initBootstrap call — returns hotel info, rooms, branches, and settings
GET/api/public/branchesList branches / sub-properties
GET /api/public/availability?room_id=1&check_in=2026-03-15&check_out=2026-03-18
{
  "success": true,
  "data": {
    "room_id": 1,
    "available": true,
    "nights": 3
  }
}
Email Configuration

StayPilot sends automated emails for new booking requests and status changes. Configure your SMTP server and notification preferences from the Email Settings page in the left navigation.

SMTP Setup

Go to Email Settings (left navigation) and fill in the SMTP section:

  • SMTP Host — e.g. smtp.gmail.com, smtp.sendgrid.net
  • Port — 587 (TLS) or 465 (SSL). Port 587 is recommended.
  • Username — usually your email address or API username
  • Password / App Password — use an app-specific password for Gmail
  • From Name — displayed as the sender name (e.g. "The Grand Hotel")
  • From Address — the reply-to email address
For Gmail, enable 2-Step Verification and generate an App Password under Google Account → Security. Use that as your SMTP password instead of your regular password.

Click Send Test Email to confirm the configuration works before going live.

Notification Preferences

From Email Settings, toggle which events trigger automated emails to your hotel inbox:

EventTriggerConfigurable
New Booking RequestGuest submits booking formEnable / Disable toggle
Booking ConfirmationHotel confirms a bookingEnable / Disable toggle
Booking CancellationBooking is cancelledEnable / Disable toggle

You can also set a custom From Name, Reply-To address, and email footer text to match your hotel's branding.

Hotel Settings

All general hotel configuration lives under Settings in the left navigation. Changes here affect your booking widget, emails, and invoices.

Pricing & Taxes

Go to Pricing & Taxes in the left navigation. You can configure:

  • Base currency — all prices are stored and displayed in this currency
  • VAT / Tax rate — applied to all bookings; can be included in displayed price or added at checkout
  • City tax — per-person per-night tax (tourism levy)
  • Seasonal pricing rules — adjust prices by date range (e.g. +20% in peak season)
  • Length-of-stay discounts — e.g. 10% off for 7+ nights
Frequently Asked Questions
Can I use StayPilot without a WordPress site?

Yes. The WordPress plugin is optional. Embed the booking widget on any website using the CDN script — it works with plain HTML, React, Vue, or any CMS. The recommended approach is the declarative <div data-stay-pilot-widget> method. See Custom CDN Script for full instructions.

Is there a free trial?

We offer a live demo so you can explore StayPilot before committing. Book a demo with our team and we'll walk you through the platform with a real hotel environment.

How do I accept payments?

StayPilot integrates with Stripe and PayHere for online card payments. Configure them under Settings → Payment Settings. You can also set the payment mode to Pay at Hotel (no upfront charge) or Bank Deposit (guests transfer funds manually with a reference number).

Can guests book in multiple languages?

The booking widget currently supports English. Multi-language support (French, German, Spanish, Arabic) is on our roadmap — contact us if this is a priority for your property.

How do I prevent double bookings?

StayPilot uses real-time availability locking. When a guest begins a booking, the dates are soft-locked for a short window. Once confirmation is received, dates are permanently blocked. This prevents double bookings for all direct reservations.

Can I export my booking data?

You can view all bookings with filters from the Bookings page. CSV export is on our roadmap. For urgent data exports, contact support and we'll assist you.

How do I contact support?

Email us at support@staypilot.com. Pro and Business plan customers have access to priority support with a 4-hour response time during business hours. All customers also have access to this documentation.