API-Dokumentation
Ersetze <kunde> durch deinen Kurznamen (siehe Einstellungen → Widgets). Alle Endpunkte sind öffentlich, liefern nur veröffentlichte Daten und erlauben Aufrufe von jeder Webseite.
REST-API
https://tery.ch/api/public/v1/<kunde>RSS-Feed
…/v1/<kunde>/events.rssMCP-Server
https://tery.ch/mcpFür KI-Assistenten (MCP)
Trage https://tery.ch/mcp in Claude, Cursor oder einem anderen MCP-Client ein. Werkzeuge: list_offerings, get_free_slots, list_events, get_integration_guide. Die Buchung selbst erfolgt über die REST-API im Browser der buchenden Person.
Endpunkte
Alle Pfade hängen an https://tery.ch/api/public/v1/<kunde>. Antworten sind JSON (UTF-8), Zeiten als Epoch-Millisekunden und ISO-8601, Preise in CHF.
/offeringsAlle buchbaren Behandlungen/Angebote mit Bild, Kurzbeschreibung, Kategorie, Bezahlarten (online/vor Ort), Zusatzoptionen, Standorten und – falls die Anbieterin es erlaubt – wählbaren Personen.
Aufruf
curl https://tery.ch/api/public/v1/<kunde>/offerings
Antwort 200
{
"offerings": [
{ "slug": "klassische-massage", "title": "Klassische Massage", "short": "Lockert Verspannungen",
"description": "…", "category": "Massage", "duration": 60, "price": 120, "location": "",
"image": "https://tery.ch/api/public/files/12/bild.jpg", "thumb": "…/13/thumb.jpg",
"payOnline": true, "payOnsite": true,
"addons": [{ "id": 3, "title": "Hot Stone", "price": 20, "minutes": 15, "allowQty": false, "maxQty": 10 }],
"locations": [{ "id": 1, "name": "Zürich", "slug": "zuerich", "address": "…" }],
"staff": [{ "id": 4, "name": "Anna", "photo": "" }] }
]
}/slots?offering=<slug>Freie Startzeiten eines Angebots für die nächsten Wochen. Dauer inkl. Zusatzoptionen, Vor-/Nachbereitung, Arbeitszeiten des Teams, Schliesszeiten sowie Räume/Geräte sind berücksichtigt.
Parameter
offering– Slug aus /offeringsaddons– optional, z.B. 3:1,5:2 (ID:Menge)location– optional, Standort-IDstaff– optional, Personen-ID (nur wenn wählbar)
Aufruf
curl "https://tery.ch/api/public/v1/<kunde>/slots?offering=erstgespraech"
Antwort 200
{
"offering": { "slug": "erstgespraech", "title": "Erstgespräch", "duration": 30, "price": 0, "location": "Telefon" },
"total": { "price": 0, "minutes": 30 },
"slots": [
{ "start": 1767600000000, "iso": "2026-01-05T08:00:00.000Z" }
]
}/eventsKommende veröffentlichte Workshops und Webinare.
Aufruf
curl https://tery.ch/api/public/v1/<kunde>/events
Antwort 200
{
"events": [
{ "id": 12, "kind": "workshop", "title": "Atem & Ruhe", "date": "2026-12-01", "time": "19:00",
"place": "Jona", "price": "CHF 22.–", "text": "…", "full": false, "image": "…" }
]
}/events.rssDieselben Veranstaltungen als RSS-2.0-Feed (für Newsletter-Tools, Zapier, Feedreader).
Aufruf
curl https://tery.ch/api/public/v1/<kunde>/events.rss
Antwort 200 (application/rss+xml)
<rss version="2.0"><channel> <title>Veranstaltungen – kunde</title> <item><title>Atem & Ruhe – 01.12.2026, 19:00</title> … </item> </channel></rss>
/challenge?purpose=call|registrationHolt eine Sicherheitsaufgabe für eine Buchung (call) oder Workshop-Anmeldung (registration).
Parameter
purpose– call oder registration
Aufruf
curl "https://tery.ch/api/public/v1/<kunde>/challenge?purpose=call"
Antwort 200
{ "challenge": "eyJwdXJwb3Nl….9f3a…", "rule": "find integer n so that sha256(...) starts with '000' ..." }/bookBucht einen freien Termin. Der Preis wird immer auf dem Server berechnet. Bei Bezahlart online kommt ein Zahlungslink zurück, bei «vor_ort» ist der Termin sofort bestätigt.
Parameter
offering– Slugstart– Startzeit aus /slots (Epoch ms)name, email– Pflichtphone, note– optionaladdons– optional, [{ id, qty }]location, staff– optional, IDspayment– optional: online oder vor_ortconsent– true (Datenschutz akzeptiert)website– leer lassenproof– { challenge, solution }
Aufruf
curl -X POST https://tery.ch/api/public/v1/<kunde>/book -H "Content-Type: application/json" -d '{
"offering": "erstgespraech", "start": 1767600000000,
"name": "Anna Muster", "email": "[email protected]", "consent": true,
"website": "", "proof": { "challenge": "…", "solution": 4711 } }'Antwort 201
{ "ok": true, "status": "aktiv", "checkoutUrl": null }
// oder bei Bezahlung: { "ok": true, "status": "zahlung offen", "checkoutUrl": "https://checkout.stripe.com/…" }/events/<id>/registerMeldet eine Person für einen Workshop oder ein Webinar an. Ist er voll, landet sie auf der Warteliste.
Parameter
id– aus /eventsname, email– Pflichtphone, note– optionalconsent, website, proof– wie bei /book (purpose=registration)
Aufruf
curl -X POST https://tery.ch/api/public/v1/<kunde>/events/12/register -H "Content-Type: application/json" -d '{
"name": "Anna Muster", "email": "[email protected]", "consent": true,
"website": "", "proof": { "challenge": "…", "solution": 815 } }'Antwort 201
{ "ok": true, "status": "bestätigt", "checkoutUrl": null }
// status: "bestätigt" | "neu" (Bezahlung vor Ort) | "zahlung offen" (mit checkoutUrl) | "warteliste"Sicherheitsaufgabe lösen
Schreibende Aufrufe brauchen eine gelöste Aufgabe (statt Captcha): Suche die kleinste ganze Zahl n, bei der sha256("<challenge>:n") als Hex mit 000 beginnt. Sende frühestens 2 Sekunden nach dem Abholen; jede Aufgabe gilt nur einmal. Das Feld website ist eine Falle für Bots und muss leer bleiben.
async function solve(challenge) {
for (let n = 0; ; n++) {
const h = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(challenge + ":" + n));
const hex = [...new Uint8Array(h)].map((b) => b.toString(16).padStart(2, "0")).join("");
if (hex.startsWith("000")) return n;
}
}Fehler
400Eingabe ungültig –{ error, issues }nennt die Felder404Kunde, Angebot oder Pfad unbekannt422Buchungsregel verletzt, z.B. Zeit nicht mehr frei, ausgebucht, Sicherheitsprüfung abgelaufen –errorist ein deutscher Text zum Anzeigen500Interner Fehler
Kurzfassung für KI-Assistenten (Markdown)
# Tery Headless API (v1)
Base: https://tery.ch/api/public/v1/<kunde>
CORS open (`*`), JSON only. Build native UI in the host site's design; no iframe needed.
## Read
- GET /offerings → { offerings: [{ slug, title, short, description, category, duration, price, location, image, thumb, payOnline, payOnsite,
addons: [{ id, title, description, price, minutes, allowQty, maxQty }], locations: [{ id, name, slug, address }], staff: [{ id, name, photo }] }] }
(staff is only filled when the provider lets customers choose a person; otherwise a free person is assigned automatically)
- GET /slots?offering=<slug>&addons=<id:qty,...>&location=<id>&staff=<id> → { offering, total: { price, minutes }, slots: [{ start (epoch ms), iso }] }
Slots already account for duration incl. add-on minutes, prep/follow-up time, staff working hours, closures, rooms/equipment. Ask for a location first when an offering has more than one.
- GET /events → { events: [{ id, kind, title, date, time, place, price, full, ... }] }
- GET /events.rss → RSS 2.0 feed of upcoming events (feed readers, newsletter tools, Zapier/Make)
## Write (bot-protected)
1. GET /challenge?purpose=call|registration → { challenge }
2. Find integer n ≥ 0 with sha256(`${challenge}:${n}`) hex starting with "000" (Web Crypto, a few ms). Submit ≥ 2 s after fetching; each challenge works once.
3. Send `proof: { challenge, solution: n }`, `website: ""` (honeypot, keep empty and hidden), `consent: true`.
- POST /book { offering, start, name, email, phone?, note?, addons?: [{ id, qty? }], location?: id, staff?: id, payment?: "online"|"vor_ort", consent, website, proof } → 201 { ok, status, checkoutUrl }
Price is always computed on the server. payment "vor_ort" (pay on site) only when payOnsite is true.
- POST /events/<id>/register { name, email, phone?, note?, consent, website, proof } → 201 { ok, status, checkoutUrl }
If checkoutUrl is set, redirect there for payment. Errors: { error } with 400/404/422.
## React recipe
```ts
const API = "https://tery.ch/api/public/v1/<kunde>";
async function solve(challenge: string) {
for (let n = 0; ; n++) {
const h = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(`${challenge}:${n}`));
const hex = [...new Uint8Array(h)].map((b) => b.toString(16).padStart(2, "0")).join("");
if (hex.startsWith("000")) return n;
}
}
export async function book(offering: string, start: number, person: { name: string; email: string; phone?: string; note?: string }) {
const { challenge } = await (await fetch(`${API}/challenge?purpose=call`)).json();
const solution = await solve(challenge);
const r = await fetch(`${API}/book`, { method: "POST", headers: { "Content-Type": "application/json" },
body: JSON.stringify({ offering, start, ...person, consent: true, website: "", proof: { challenge, solution } }) });
const data = await r.json(); if (!r.ok) throw new Error(data.error); return data;
}
```
Fetch the challenge when the form opens (so 2 s have passed at submit). Show times in Europe/Zurich, prices in CHF, a required consent checkbox linking the host's privacy policy.