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.

KindCustomers bookEndpoint
ItemA slot — a go-kart session, a bowling lanePUT /activity/items/:externalId
ClassA seat in one session of a weekly classPUT /activity/classes/:externalId
CourtA time slot on a space — a futsal pitchPUT /activity/courts/:externalId

All three share one set of operations to list, retrieve, publish, unpublish and delete.

The flow#

An activity listing, from draft to booking
An activity listing, from draft to bookingYour serverLocaloyCustomer1. PUT /activity/courts/pitch-12. 201 created — a draft3. POST …/pitch-1/publish4. The court appears for booking5. Book a slot6. Inventory check, if enabled7. Booking created8. Webhook: booking.createdIf your own checkout is enabledThe booking stays pending until it is paid9. POST /payments/sessions/…/result10. Webhook: booking.updated
  1. Your server → Localoy: PUT /activity/courts/pitch-1
  2. Localoy → Your server: 201 created — a draft
  3. Your server → Localoy: POST …/pitch-1/publish
  4. Localoy → Customer: The court appears for booking
  5. Customer → Localoy: Book a slot
  6. Localoy → Your server: Inventory check, if enabled
  7. Localoy → Customer: Booking created
  8. Localoy → Your server: Webhook: booking.created
  9. — If your own checkout is enabled —
  10. Note: The booking stays pending until it is paid
  11. Your server → Localoy: POST /payments/sessions/…/result
  12. Localoy → Your server: Webhook: booking.updated
  1. PUT the whole listing. The first PUT of an externalId creates a draft (201); later ones replace it (200). Send everything; options you leave out go back to their defaults.
  2. Publish it. Customers cannot see a draft, and a PUT never changes whether it is published.
  3. Customers book. Localoy asks your inventory endpoint first, with module activity, class or court. While your production checkout is enabled, a new booking stays pending until your payment report confirms it.
  4. 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.