Players joining and leaving bookings

BookingParticipantJoinedV1 and BookingParticipantLeftV1 tell you which MATCHi players come onto a court booking, or go off it, after the booking was made. Subscribe to them with the event types BOOKING_PARTICIPANT_JOINED and BOOKING_PARTICIPANT_LEFT. Like the booking events, they are sent only for bookings at the venues in your subscription.

What they carry

  • BookingParticipantJoinedV1: the booking (ID, court, start and end time), the venue, and the player’s MATCHi user ID and the email of their MATCHi account.
  • BookingParticipantLeftV1: the same booking and venue, and the player’s user ID only. It carries no email.

The user ID is the player’s MATCHi user ID, the same kind of ID the booking events use for MATCHi users. A player who joins after the booking was made is not added to the booking’s players, so do not expect them in BookingCreatedV2.

When they are sent

BookingParticipantJoinedV1 is sent when a player with a MATCHi account:

  • accepts an invite to a booking, or
  • takes their part of a split booking while invited to it, and pays it.

BookingParticipantLeftV1 is sent when a player who joined this way goes off the booking: they leave it, the booker removes them, they decline, or they remove their own paid part of a split booking. A left can arrive for a user ID you never received a BookingParticipantJoinedV1 for, for example when the player is removed while they are accepting. Ignore it.

When they are not sent

No player event is sent for:

  • players who add themselves to a booking they were not invited to;
  • players whose request to join is approved by the booker;
  • invited players who have not accepted;
  • players without a MATCHi account;
  • players under the minimum age for sharing in their own or the venue’s market, or whose account email is not verified;
  • players a venue adds in its own booking tools or to a subscription;
  • the players on the booking when it is created (BookingCreatedV2 carries them);
  • a cancelled booking (BookingCancelledV2 covers it, with no left event per player);
  • a change made more than two hours after the booking ended.

So these events do not give you every player on a booking: use them together with the booking events.

Delivery

Delivery is best-effort, as for the other events:

  • an event can be lost;
  • an event can arrive more than once: treat a repeated event as harmless;
  • there is no order across event types: a player event can arrive before BookingCreatedV2 for the same booking, and a BookingParticipantLeftV1 can arrive before the BookingParticipantJoinedV1 it ends. Accept a player event for a booking you have not seen.

Linking a player to your own records

A BookingParticipantJoinedV1 holds both the player’s MATCHi user ID and their account email, so you can store the two as a link to your own member record. Match a later BookingParticipantLeftV1 on the user ID: it carries no email. The email is the one on the account when the player joined; a later change of address is not sent.