APIv1.4.0

Multiple locations

A custom website for a venue with more than one location: one key per location, and the visitor first chooses where to book.

One key per location

For the API, every location is a separate venue. A key belongs to exactly one location and determines which location you read and book. There is no key for all locations together and no location ID in the URL.

  1. At the top of the dashboard, choose the location (the location switcher).
  2. Go to /integrations → API & own website (API & eigen website) → Create key (Sleutel aanmaken), as in Getting started.
  3. Repeat this for every location. Put the same domains of your site on every key.

Every key has its own limits, domain list and bot check. GET /venue with a key returns the name, address and opening hours of that one location.

On your site

First let the visitor choose a location, then use that location's key for every call of that booking: services, availability, hold and booking.

js
const KEYS = {
  centrum: 'cal_pk_live_…', // key of the Centrum location
  noord: 'cal_pk_live_…',   // key of the Noord location
};

function apiFor(location) {
  const key = KEYS[location];
  return (path, init = {}) => fetch(`https://www.callyndar.com/api/v1${path}`, {
    ...init,
    headers: { 'Authorization': `Bearer ${key}`, 'Content-Type': 'application/json', ...(init.headers ?? {}) },
    body: init.body ? JSON.stringify(init.body) : undefined,
  }).then(r => r.json());
}

// The visitor chose "centrum":
const api = apiFor('centrum');
const venue = await api('/venue');

If a partner sets up a new location as a draft, that location's key already works for reading, but it rejects holds and bookings (venue_in_setup) until the owner activates the venue. See Testing.

Never switch keys in the middle of one booking: a hold from the Centrum location does not exist for the Noord key.

Staff members who work at multiple locations

If the same staff member works at two locations, the API takes that into account. If that person has an appointment at the Noord location, they are unavailable at the Centrum location at that time: not in GET /availability, and a POST /holds or POST /bookings at that time is rejected like any other occupied time. You don't need to do anything for this.

What is not (yet) possible

  • One key that serves all locations of a venue together.
  • An endpoint that lists a venue's locations. For now, put the list of locations in your site yourself.

This may be added in a later version of v1; see the Changelog.

This page as Markdown: /developers/en/multiple-locations.mdEverything in one file: /developers/en/llms-full.txt