Add a real booking system to Lovable with the Opencals connector

Lovable is very good at the part of a booking site people look at. It's less good at the part that has to be correct, because with no backend to talk to it invents one: slots in a table, bookings as rows, no idea that two people just picked the same Tuesday 10:00.
Lovable's custom connectors fix that properly. A workspace admin registers an API once, attaches a couple of knowledge files telling Lovable how to use it, and every project in the workspace can connect to it without anyone pasting a key into code. This guide sets up Opencals that way. At the end, you describe a business and Lovable builds a site that reads your real services, shows live availability, holds the slot while the customer checks out, and takes payment through your own Stripe account.
It takes about ten minutes, and nearly all of it is copy and paste.
Four steps: create an Opencals storefront key with no allowed origins, create a custom connector in Lovable (Advanced auth with two headers), paste the two knowledge files below, then connect it to a project and describe the business. The key stays in Lovable's connector credentials and never appears in project code.
Before you start
- An Opencals store. Create one free and add at least one service with a schedule, so there's something to book. A new store is a free development store that runs payments in Stripe test mode, which is exactly what you want while building.
- Admin or owner rights in your Lovable workspace. Lovable only lets admins and owners create custom connectors. Everyone else in the workspace can use it once it exists.
Step 1: a storefront key without allowed origins
In the Opencals dashboard, go to Settings → API Keys and create a storefront key. Call it "Lovable" so you know where it's used. It starts with sfk_.
Leave the allowed origins list empty. Lovable calls the API from its own servers, and those requests carry no Origin header. A key with an origins allowlist rejects them with 401 Origin not allowed for this API key, which is the single most common setup mistake. That's safe here, because the key never reaches the browser.
Step 2: create the connector
In Lovable, open Connectors, click + and choose Custom connector. Fill in the details section:
Details
Display name
The internal ID comes from this and can't change later
Opencals
Short description
Headless commerce for bookable services: cart, checkout, payments
Description
Shown in the catalogue. Copy copies the full text
Opencals is a headless commerce API for selling time: services, sessions, classes, and rentable resources such as courts, rooms and studios. It works like a storefront API: a catalogue of bookable products with variants and add-ons, a cart, checkout, payments, discounts, orders and customer accounts. Every product is time-based, and Opencals handles the availability, capacity and double-booking. Lovable builds the storefront; the merchant's live Opencals store supplies the products, prices and rules. What the app can do: - Catalogue: products with variants, prices, images, collections, staff, locations, and add-ons (fixed or charged per hour) - Real-time availability: exact slots per day or ranges for a calendar, filtered by staff, location and booking length - Cart: hold slots with an expiry timer, add or change add-ons, apply promo codes, automatic discounts, and customer credit (money or prepaid hours) - Checkout: customer details, billing address with company and VAT, delivery address for mobile services, marketing consent per channel, and custom checkout questions including file uploads - Payments: cards through Stripe (paid into the merchant's own connected account), cash, bank transfer, or instant confirmation when nothing is due. Tax-inclusive or tax-exclusive pricing, with authoritative totals from the API - Orders and receipts: an order number, line items, payment status, and invoices - Group classes with capacity and spots left, invited guests, and variable-length bookings (e.g. a court for 60 or 90 minutes) - Customer accounts: email-code or password sign-in, upcoming and past bookings, self-service reschedule and cancel within the merchant's notice rules, profile, and marketing preferences The server side handles availability, timezones, double-booking prevention, pricing, tax, discounts, payment capture, and confirmation and reminder emails. The merchant manages products, staff, schedules, discounts and payment settings in the Opencals dashboard (app.opencals.com). You need an Opencals store and a Storefront API key (sfk_…) created in the Opencals dashboard.
Category
E-commerce
Documentation URL
https://opencals.com/docs
Logo
Download it and upload the file
https://opencals.com/images/logo/icon.png
Step 3: authentication and the test request
Choose Advanced as the authentication method. Opencals needs two headers on every request, and Advanced is the method that can hold both:
Authentication (Advanced)
API base URL
https://api.opencals.com
Field 1: key
Label: Storefront API key (sfk_…). Send as header. Secret: yes
X-Api-Key
Field 2: key
Label: API version (enter 1). Send as header. Secret: no
X-Api-Version
Test request method
GET
Test request path
Returns 200 with your store name and currency
/storefront/stores/public-settings
Don't skip the version header. Every storefront route answers 404 Cannot GET … without X-Api-Version: 1, including the test request, so a missing version looks like a broken URL rather than an auth problem.
Step 4: the two knowledge files
This is what turns Lovable from guessing into knowing. Knowledge files are Markdown that Lovable reads whenever it writes code against the connector. Click Add knowledge file twice and paste these. Each is under Lovable's 50,000-character limit.
Knowledge file 1
Opencals Storefront API
Complete endpoint reference: catalogue, availability, cart, appointments, discounts, checkout and payment, customer accounts, reschedule/cancel, errors and rate limits. · opencals-storefront-api.md
Loading…
Knowledge file 2
Opencals booking site playbook
How to build a booking website on Opencals: choosing the booking flow for the business type, pages and components, slot picker, checkout and payment UX, design and launch checklist. · lovable-booking-site-playbook.md
Loading…
Use the title as the file's Name and the line under it as its Description. The description is what Lovable reads to decide which file to open, so it's worth copying exactly.
The first file is the reference: every endpoint with its real fields, and rules like "the bookable ID is always a variant's id" and "slot times are UTC, convert for display only". The second is the part I'd have wanted on day one. It tells Lovable to match the page flow to the business before worrying about looks: a salon books a person, a padel club books a court on a grid, a yoga studio sells spots in a class. It also lists the checks to run before calling the site done.
Click Create. Opencals now appears in your workspace's connector catalogue.
Step 5: connect it and describe the business
Open the Opencals connector and choose Add connection. Paste your sfk_ key into the first field and 1 into the second. Pick who can use this connection (only you, specific people, or the whole workspace), and Lovable runs the test request. A green check means the key and version header are right.
Link the connection to a project, then describe the business rather than the booking system:
Build a booking website for Fade & Co, a three-chair barbershop in Manchester.
Use the Opencals connector for services, prices, barbers and availability.
Customers pick a service, then a barber or "anyone", then a time.
Dark and bold: black, off-white, one brass accent. Pages: home, services,
booking flow, checkout with card payment, confirmation.No service list, no prices, no opening hours: those come from your store. Add a service in the Opencals dashboard next week and it appears on the site without another prompt.
What Lovable builds, and one limit to know
With the knowledge files in place, Lovable writes a thin server function per operation (list services, get slots, book a slot, start checkout) that calls Opencals through the connector, and a frontend that only talks to those functions. Card payments use Stripe's payment form in the page with the details Opencals returns from checkout, so there's no Stripe connector and no Stripe secret to set up in Lovable. The money goes to the Stripe account connected to your Opencals store.
The limit: rate limits are shared across the whole site. Opencals limits each key per client IP to 120 requests a minute. Behind Lovable's gateway every visitor arrives from the same address, so one Lovable site gets roughly 120 requests a minute across all of its visitors. That's fine for a single business, and the playbook tells Lovable to cache the catalogue and load availability one day at a time for this reason. If you're planning a launch that sends a crowd to the site at once, get in touch before it goes out.
Test one booking before you share the link
Run this in the Lovable preview with your development store:
- The services page shows your real services and prices, and nothing is hard-coded.
- Days with no availability are disabled, and times show in your local timezone.
- Book a slot, go to checkout, and pay with Stripe's test card
4242 4242 4242 4242. - The confirmation page shows an order number, and the booking appears in your Opencals dashboard with a confirmation email sent.
- An invalid promo code shows a clear error, and a real one changes the total.
When those pass, switch the store to production in the Opencals dashboard to take real payments, publish the Lovable app, and point your domain at it.
Using a different builder? The same setup exists for v0 and Base44, and the overview of all three is in build a booking website with AI.
Frequently Asked Questions
Early Access — 3 Months Free
Ready to transform your service business?
Join 150+ businesses already using Opencals. Get 3 months completely free with all features unlocked.