BeniBrain runs the storefront catalogue, service availability, checkout and booking logic for a business. This API lets an external website or app read that data and create orders or bookings against it, while BeniBrain's server remains the single source of truth for price, stock and slot availability. Everything documented here is implemented and running in production today — nothing on this site is aspirational.
Getting started
Every request identifies the business by its public integration key (looks like lc_…). A business finds theirs in the BeniBrain dashboard under Settings → Developers → API keys, labelled "Public key". It is a publishable identifier, not a secret — safe to use directly in client-side JavaScript.
https://benibrain.com/apicurl "https://benibrain.com/api/public/store/info?apiKey=lc_your_key_here"Authentication
There are two distinct authentication models on this API, matching the two audiences it serves:
| Surface | Who calls it | Auth |
|---|---|---|
Storefront & booking (/public/store/*, /public/booking/*, /public/order/*, /public/commerce/attachments) | Any website embedding the storefront or booking widget | apiKey query parameter, scoped to that one business |
Server API (/v1/*): services, products, bookings, orders, customers, enquiries | The business's own website back end, plugin or app, from a server | Secret API key (bb_sk_…) the business makes itself, sent as Authorization: Bearer. See Server API. |
Webhook management (/webhooks/*) and connected website (/integrations/website) | The business itself, configuring its own integrations | Authenticated BeniBrain business session (dashboard login) |
The storefront/booking key is a public identifier, not a bearer credential: it only ever grants access to that one business's already-public catalogue and lets a buyer start a checkout or booking. It cannot read another business's data, and it cannot be used to change store configuration. A handful of storefront/booking endpoints (loyalty balance, order history, product reviews) additionally require the buyer to verify their own email via a one-time code — see the customer session endpoints in the API reference.
How BeniBrain and your website fit together
Your website is the presentation layer; BeniBrain is the system of record. In practice that means:
- Your site fetches products/services from BeniBrain to render pages, but never quotes a final price, stock count, or available time slot from a value it cached earlier — it re-fetches or re-submits and lets BeniBrain's server confirm it at checkout/booking time.
- Every checkout and booking request is re-validated server-side against current stock, pricing, discounts, and availability — a stale price or a slot someone else just took is rejected with a specific error (see Errors), not silently accepted.
- Payment happens on Stripe's infrastructure (Stripe Checkout, or the embedded Payment Element when
paymentMode: "embedded"is requested). BeniBrain never asks your site to collect or forward raw card details. - Order and booking confirmations are authoritative from the BeniBrain API — poll
GET /public/store/orderorGET /public/booking/{apiKey}/bookings/{id}rather than trusting a client-side payment redirect alone, since a customer can close the tab before the redirect completes.
Versioning & deprecation
The storefront and booking endpoints don't use a version prefix in the URL; the server API lives under /v1/ (see Server API). Fields are only ever added in a backward-compatible way — existing fields are not renamed or removed without a deprecation notice on this site and in the change log of the published OpenAPI document (see the info.version date field). Webhook payloads carry their own schemaVersion field for the same reason (see Webhooks). If a breaking change ever becomes necessary, it will ship as a new, separately versioned path rather than changing this one underneath existing integrations.
Errors
Errors are plain JSON with an error string and a standard HTTP status code. There is no proprietary error-code catalogue to learn — rely on the status code first, and show the error string to a developer/log, not necessarily to the end customer.
{ "error": "Insufficient stock for this item" }| Status | Meaning |
|---|---|
400 | Request failed validation (missing/malformed field) |
401 | A verified customer session is required for this call |
403 | Not permitted (e.g. review submitted without a qualifying order) |
404 | Unknown business, product, order or booking |
409 | Conflict with current state — out of stock, slot just taken, already reviewed |
429 | Rate limited — back off and retry (see below) |
Rate limits
Endpoints that trigger an email, a payment, or a write are rate-limited per caller, independently of any per-business plan limits. Current limits (subject to tightening if abused): checkout and booking creation 5/minute, discount/gift-card validation 10/minute, review submission 5/minute, order lookup by ID 60/minute. A 429 response means wait and retry rather than hammering the endpoint.
Security
- All endpoints require HTTPS.
- The storefront/booking
apiKeyonly exposes data the business has already made public (active products, active services, storefront settings) — it is designed to be embedded in client-side code. - File uploads for custom order/booking fields go through a two-step flow: your site asks for a private upload token, uploads the file directly, and only ever passes an opaque
fileTokenat checkout — raw file storage paths are never accepted from the client. See Buyer extras. - Outbound webhook payloads are signed with HMAC-SHA256 so your endpoint can verify they really came from BeniBrain — see Webhooks.
What's intentionally not here
This reference documents the public storefront/booking surface, the server API for a business's own secret keys, and a business's own webhook and connected-website settings. It does not cover BeniBrain's dashboard API (product/service authoring, staff, analytics, conversations), which requires an owner-level BeniBrain session and isn't intended for third-party integration.