Bookings are created for a given availability slot.

The booking object represents the reservation made at a restaurant or bar.

Bookings are created by posting the details of a chosen Availability Slot along with a set of user details.

Some bookings are confirmed immediately, whilst others may require the venue to confirm the booking asynchronously. In addition, some bookings will require a successful payment. Such flows will be indicated by the selected Availability Slot.

Booking Object

PropertyTypeDescription
idstringThe unique identifier of the booking.
dateTimeDateThe date and time of the booking.
coversnumberThe number of guests booked.
bookedAtDateThe date and time when the booking was made.
statuscompleted, noShow, cancelled, requested, pendingPayment, upcomingThe status of the booking (e.g., confirmed, cancelled).
tag?stringAn optional tag associated with the booking.
originalEmailstringThe email address used for the original booking.
venue.idstringThe unique identifier of the venue.
venue.namestringThe name of the venue.
venue.town?stringThe town where the venue is located (optional).
usersobject[]A list of users associated with the booking.
users[].idstringThe unique identifier of the user.
users[].isOwnerbooleanIndicates if the user is the owner of the booking. At least one user must be the owner of the booking.
users[].email?stringThe email address of the user (optional).
users[].phone?stringThe phone number of the user (optional).
users[].firstName?stringThe first name of the user (optional).
users[].lastName?stringThe last name of the user (optional).
partner.idstringThe unique identifier of the booking partner.
partner.namestringThe name of the booking partner.
partner.logoUrl?stringThe logo URL of the booking partner (optional).
availability.timeSlot.requiredDeposit?objectInformation about the required deposit for the booking (optional).
availability.timeSlot.requiredDeposit.amountUnitsnumberThe amount of the deposit in units (e.g., minor currency units like cents).
availability.timeSlot.requiredDeposit.amountPer'guest'Indicates that the deposit amount is applied per guest.
availability.timeSlot.requiredDeposit.currencyCurrencyThe currency of the required deposit.
availability.timeSlot.requiredDeposit.typeauthenticate, paymentThe payment collection type, authenticatebeing a setupIntent (the card is held on file for future charges, paymentrequires a paymentIntent, and is charged immediately.
availability.timeSlot.requiredDeposit.terms?stringThe terms and conditions of the deposit (optional).

Payments For Bookings

Some availability slots indicate a payment is required for a booking. AllTheTables uses Stripe to process payments before placing the booking at the restaurant.

Working with Stripe to process payments

The public key used to tokenise a card with the Stripe SDK or API can be found at:

GET /partner/stripe/publishable-key

{
  publishableKey: "pk_stripe_public_key"
}

Capturing Setup & Payment Intents

The availability.timeSlot.requiredDeposit.typefield indicates whether the booking requires a card on file, or an initial payment to be injected. An example of a card on file availability.timeSlot.requiredDepositobject would look like this:

{
  "amountUnits": 0,
  "amountPer": "person",
  "currency": "GBP",
  "type": "authenticate",
  "terms": "TOS"
}

Alternatively, a booking that required an initial payment of £20 per head would show as:

{
  "amountUnits": 2000,
  "amountPer": "person",
  "currency": "GBP",
  "type": "payment",
  "terms": "TOS"
}

When fetching availability, the timeSlotobject returned will identify whether a Payment Intent (payment) or Setup Intent (authenticate) will be created.

To create the Intent, post the booking with the status pendingPayment. The response will include a booking with the pendingPayment status and an intent object in the response.

The Intent should be used with the Stripe SDK or Stripe API to authorise a payment/setup. Upon successful processing of the payment, AllTheTables will automatically fulfil the booking via the restaurant reservation book. There's no need to update AllTheTables that the payment was successful, as Stripe does this automatically.

Until a payment is captured, the booking will appear with the status pendingPayment.