Skip to main content

Save Sessions

PUT 

/courses/:id/sessions

Save a member's desired future session selection for one existing registration in a single atomic write: add, remove, swap across series, leave many, or leave all.

series is the series of the member's registration (the registration_series from registration_state). course_session_ids is the desired set of future sessions on that registration. Omitting a session only removes it when it is booked on this registration, is not a drop-in, and is in the future; past sessions, drop-ins and sessions booked through another registration are never removed by omission, and selecting a session the member already attends is a no-op. An empty list made before this registration's series has started (its first active session), and while the registration holds no session that has already started, ends the registration and refunds the course purchase only, not other items bought with it (to the original payment method, or account credit when that isn't possible), like unregistering from an event. Otherwise an empty list only leaves the future sessions, keeping past ones, with no refund. Leaving some sessions never refunds.

Returns the future, non-drop-in sessions booked on the registration after the save.

Errors (nothing is applied):

  • 400 parameter_invalid: an invalid body field. field_errors.<field> is a list of messages (standard DRF shape), e.g. field_errors.customer when the member is not visible or not registered for series, field_errors.series when the series is not on this course.
  • 400 max_exceeded: the selection exceeds the series maximum.
  • 400 session_selection_invalid: one or more sessions can't be joined or left. Every failure is reported in field_errors.course_session_ids, keyed by session id, each with its own code (e.g. session_past, session_full, changes_not_allowed, series_registration_exists, session_not_available for a session this registration can't manage) and message.
  • 409 resource_conflict: a session became unbookable while the save was applied (e.g. filled by another booking); reload and retry.

Providers​

  • No access.

Customers​

  • Any customer can perform this action.

Unregistered Customers​

  • No access.

Request​

Responses​