Reservations
Take a reservation
Send in a booking your site took. It lands on the venue's reservation list; whether it is confirmed at once is the venue's own setting.
/public/v1/venues/{venueId}/reservationsWarning: There is no sandbox. A reservation taken with a real key is a real booking on a real venue's list, and its staff are told. Develop against a venue you run, and cancel what you make.
Send the booking your site took. The answer is 201 Created with a Location header pointing at GET /reservations/{reservationId}. The booking lands where every other one does: on the venue's reservation list at the till and in the staff app, with the notification a guest's own booking raises. More in Taking reservations.
Take the time from the availability call. startsAt is an instant in UTC; send the startsAt of a slot from the bookable times. guests is 1 to 20, the guest's name is at most 100 characters, the phone number 30 and the note 250.
Whether it is confirmed is the venue's setting. At a venue that confirms bookings as they are made the answer is Confirmed; otherwise it is Pending until somebody at the venue accepts or declines it. A request the venue has not answered by the time it was for is cancelled by the System. confirmsAutomatically in the availability answer says which to expect.
You tell the guest. Cibusy sends no text message about a reservation taken through the API: your site took the booking, and it is your site the guest expects to hear from. Give the guest the pageUrl of the answer, or its code: it is what the venue checks them in with at the door.
Sending it twice is safe, and needs no Idempotency-Key. A guest cannot sit at two tables at once, so a second request for the same phone number at the same venue for the same moment, while the first booking still stands, is the same booking. You get the one the first call made, as the venue has it now, with status 200 OK, and the venue is not told a second time. If your request times out, send it again unchanged. A repeat is answered before the venue's rules are looked at again, since the booking already exists.
The venue's booking rules decide whether the time can be taken, the same ones its own booking page holds a guest to: the venue takes bookings (RESERVATIONS_DISABLED), at most 20 guests (TOO_MANY_GUESTS), a time in the future (INVALID_RESERVATION_DATE), at least 30 minutes away (RESERVATION_TOO_SOON), at most 60 days ahead (RESERVATION_TOO_FAR) and one the venue seats at (RESERVATION_TIME_UNAVAILABLE). A time taken from the availability answer passes all of them. The venue also needs an active subscription (PUBLIC_API_RESERVATIONS_UNAVAILABLE). Where an error names a part of the request, validationErrors says which, by path (customer.phone).
Parameters
venueIdstring · uuidPath parameterrequiredThe venue, one of the ids GET /venues lists.
Accept-LanguagestringHeaderThe language of userMessage in an error: tr (the default), en, de, fr, it, es, ar or ru. The first language in the header decides, without its region (en-US reads as en) and without weighing q values; a language Cibusy does not offer is answered in Turkish. It does not choose the language of a menu: that is lang on the menu call.
Request body
A booking a venue's site took and sends in. The venue's own booking rules decide whether it can be taken: GET /venues/{venueId}/reservation-availability lists the times that will be accepted.
startsAtstring · date-timenullableWhen the table is for, as an instant in UTC. Take it from a slot's startsAt in the availability answer. Required.
guestsintegernullableHow many people are coming: 1 to 20. A larger party is booked by calling the venue. Required.
customerobjectnullableWho the table is for. Required.
Fields of Guest details
namestringnullableThe guest's name, at most 100 characters. Required.
phonestringnullableThe guest's phone number, in international form or the way it is written locally (+905321112233, 0532 111 22 33). At most 30 characters. Required: it is how the venue reaches the guest, and what tells a repeated request from a second booking.
notestringnullableA note for the venue, at most 250 characters.
Responses
A repeat: the reservation the same phone number, venue and time already made, as the venue has it now.
The reservation was taken. Location points at it; status says whether it is confirmed (Confirmed) or waiting for the venue (Pending).
LocationWhere the reservation can be read: /public/v1/reservations/{reservationId}.
PUBLIC_API_RESERVATION_INVALID, TOO_MANY_GUESTS or INVALID_RESERVATION_DATE.
The X-Api-Key header is missing (PUBLIC_API_KEY_MISSING), or the key is invalid or has been revoked (PUBLIC_API_KEY_INVALID).
PUBLIC_API_SCOPE_MISSING: the key was not made with the "Can take reservations" permission.
The venue does not exist, or this key cannot reach it (PUBLIC_API_VENUE_NOT_FOUND).
PUBLIC_API_RESERVATIONS_UNAVAILABLE, RESERVATIONS_DISABLED, RESERVATION_TOO_SOON, RESERVATION_TOO_FAR or RESERVATION_TIME_UNAVAILABLE.
The key's budget of about 30 orders, reservations and tests a minute is spent; wait Retry-After seconds.
Retry-AfterSeconds to wait. The next one-minute window opens within it.
The data of a successful answer
A reservation taken through the API, as the venue has it right now. The same body GET /reservations/{reservationId} returns and the webhook's reservation.updated event carries.
idstring · uuidThe reservation's id. Use it with GET /reservations/{reservationId}.
venueIdstring · uuidThe venue the table is booked at.
statusstringWhere the reservation has got to, worked out on every read, so the list, a read of one reservation and a webhook event cannot say different things about the same booking.
Pending- The venue has not answered yet. A venue that confirms bookings as they are made never shows this.
Confirmed- The venue accepted it, or confirms bookings as they are made. The table is expected.
Declined- The venue declined the request.
Cancelled- It was called off. `cancelledBy` says by whom.
Seated- The guest has arrived and was checked in at the door.
Completed- The visit is over.
NoShow- The venue accepted it and nobody came.
startsAtstring · date-timeWhen the table is for, as an instant in UTC.
guestsintegerHow many people are coming.
customerobjectWho the table is for, as the venue has it.
Fields of Reservation guest
namestringnullableThe guest's name.
phonestringnullableThe guest's phone number, in international form.
notestringnullableThe note the reservation was made with. null when there was none.
codestringnullableThe code the venue checks the guest in with at the door: eight characters the guest can read out, or show as the QR on pageUrl. Whoever holds it can see and cancel the booking, so give it to the guest and to nobody else.
pageUrlstringnullableThe reservation's own page on cibusy.com, which shows the booking and, once it is confirmed, the QR the venue scans at the door. Link to it or send it to the guest. null for a venue with no public address.
canCancelbooleanWhether the reservation can still be cancelled through the API: it stands, the guest has not been checked in and its time has not come.
checkedInAtstring · date-timenullableWhen the guest was checked in at the door, in UTC. null until then.
cancelledAtstring · date-timenullableWhen the reservation was called off, in UTC. null unless status is Cancelled.
cancelledBystringnullableWho called it off. null unless status is Cancelled.
Customer- The guest: through this API, on the reservation's own page, or in the Cibusy app.
Venue- The venue.
System- Cibusy, when the venue had not answered a request by the time it was for.
cancellationReasonstringnullableWhat was given as the reason for calling it off, in the words of whoever gave it. null unless status is Cancelled.
createdAtstring · date-timeWhen the reservation was made, in UTC.