Classes and waiting lists (add-on)
Classes and workshops, their dates and registers, and the waiting list behind each date.
A class is a service with dates and seats rather than open time. See Classes and waiting lists.
List classes
/api/v1/kahunacart/bookings/sessions
Every class and workshop the shop runs, with the dates coming up, how many places are left on each and whether a date is open, full or closed.
Parameters
| Name | Type | Description |
|---|---|---|
| days optional | integer | How far ahead to look, in days. Ninety by default. |
Read a class
/api/v1/kahunacart/bookings/sessions/{serviceId}
One class, its recurrence rule and its exceptions, with every date in the range and the places left on each.
Parameters
| Name | Type | Description |
|---|---|---|
| serviceId required | integer | The class, which is the id of its booking rule. |
| from optional | string | The earliest date to answer about. Unix seconds, or a date and time. |
| to optional | string | The latest date to answer about. Unix seconds, or a date and time. |
| days optional | integer | Used instead of `to`. How far ahead to look, in days. |
Read a class register
/api/v1/kahunacart/bookings/sessions/{serviceId}/register
Who is coming on one date of a class and who is waiting behind them, in the order places would be offered.
Parameters
| Name | Type | Description |
|---|---|---|
| serviceId required | integer | The class. |
| occurrence optional | string | Which date, as the class's own start time. Unix seconds, or a date and time. |
Fill the places that came free
/api/v1/kahunacart/bookings/sessions/{serviceId}/promote
Give away or offer every place that has come free on one date of a class. On a free class the next person waiting gets the place; on a paid one it is held for them while they pay for it. Works on a store set to do this by hand.
Parameters
| Name | Type | Description |
|---|---|---|
| serviceId required | integer | The class. |
| occurrence optional | string | Which date. Unix seconds, or a date and time. |
Call off one date of a class
/api/v1/kahunacart/bookings/sessions/{serviceId}/cancel-date
Call one date of a class off. Everybody booked on it is cancelled and the people waiting are let go too. Nothing is refunded — the orders that were paid come back in the answer so a person can refund each one.
Parameters
| Name | Type | Description |
|---|---|---|
| serviceId required | integer | The class. |
| occurrence optional | string | Which date. Unix seconds, or a date and time. |
| reason optional | string | Why, for the audit trail and the message that goes out. |
Mark a whole class register
/api/v1/kahunacart/bookings/sessions/{serviceId}/mark
Mark everybody on one date of a class at once, as having come or as not having come. A register with thirty names on it is not thirty separate calls.
Parameters
| Name | Type | Description |
|---|---|---|
| serviceId required | integer | The class. |
| occurrence optional | string | Which date. Unix seconds, or a date and time. |
| action optional | string |
Whether the room came or did not.
One of:
attended, no_show |
Offer a place to somebody waiting
/api/v1/kahunacart/bookings/{id}/offer
Hold a place for one person who is waiting and tell them it is theirs if they pay for it. The hold lasts as long as the store's offer window and the place goes to the next person if they let it run out.
Parameters
| Name | Type | Description |
|---|---|---|
| id required | integer | The waitlisted booking. |
Give somebody waiting a place
/api/v1/kahunacart/bookings/{id}/promote
Give one person who is waiting a place outright, whatever the class costs. This is the shop deciding to hand somebody a place without taking money for it, which is sometimes exactly right and is never automatic.
Parameters
| Name | Type | Description |
|---|---|---|
| id required | integer | The waitlisted booking. |