Activities overview
How activity items, classes and courts are synced to your activity listing and booked by customers.
Your activity listing offers three kinds of bookable thing. Set the listing up once in the Partner
Portal; until then a write answers 409 activity_not_set_up.
| Kind | Customers book | Endpoint |
|---|---|---|
| Item | A slot — a go-kart session, a bowling lane | PUT /activity/items/:externalId |
| Class | A seat in one session of a weekly class | PUT /activity/classes/:externalId |
| Court | A time slot on a space — a futsal pitch | PUT /activity/courts/:externalId |
All three share one set of operations to list, retrieve, publish, unpublish and delete.
The flow#
- Your server → Localoy: PUT /activity/courts/pitch-1
- Localoy → Your server: 201 created — a draft
- Your server → Localoy: POST …/pitch-1/publish
- Localoy → Customer: The court appears for booking
- Customer → Localoy: Book a slot
- Localoy → Your server: Inventory check, if enabled
- Localoy → Customer: Booking created
- Localoy → Your server: Webhook: booking.created
- — If your own checkout is enabled —
- Note: The booking stays pending until it is paid
- Your server → Localoy: POST /payments/sessions/…/result
- Localoy → Your server: Webhook: booking.updated
PUTthe whole listing. The firstPUTof anexternalIdcreates a draft (201); later ones replace it (200). Send everything; options you leave out go back to their defaults.- Publish it. Customers cannot see a draft, and a
PUTnever changes whether it is published. - Customers book. Localoy asks your inventory endpoint first, with
moduleactivity,classorcourt. While your production checkout is enabled, a new booking stays pending until your payment report confirms it. - Delete when you stop. An item with bookings cannot be deleted (
409 listing_has_bookings) — unpublish it. Classes and courts delete normally and their past bookings stay.
Rules to remember#
- A class needs
days, a start time and spots; errors name the field (days_required,startTime_invalid,spots_invalid, …). - A court's price rules are matched on a slot's start time, and overlapping rules are refused
(
priceRules_overlap). - A sandbox key validates everything and changes nothing (
"dryRun": true). - A Technology Provider needs the Activities module.
Guide: Sync your listings.