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
Property | Type | Description |
---|---|---|
id | string | The unique identifier of the booking. |
dateTime | Date | The date and time of the booking. |
covers | number | The number of guests booked. |
bookedAt | Date | The date and time when the booking was made. |
status | completed , noShow , cancelled , requested , pendingPayment , upcoming | The status of the booking (e.g., confirmed, cancelled). |
tag? | string | An optional tag associated with the booking. |
originalEmail | string | The email address used for the original booking. |
venue.id | string | The unique identifier of the venue. |
venue.name | string | The name of the venue. |
venue.town? | string | The town where the venue is located (optional). |
users | object[] | A list of users associated with the booking. |
users[].id | string | The unique identifier of the user. |
users[].isOwner | boolean | Indicates if the user is the owner of the booking. At least one user must be the owner of the booking. |
users[].email? | string | The email address of the user (optional). |
users[].phone? | string | The phone number of the user (optional). |
users[].firstName? | string | The first name of the user (optional). |
users[].lastName? | string | The last name of the user (optional). |
partner.id | string | The unique identifier of the booking partner. |
partner.name | string | The name of the booking partner. |
partner.logoUrl? | string | The logo URL of the booking partner (optional). |
deposit? | object | Information about the required deposit for the booking (optional). |
deposit.amountUnits | number | The amount of the deposit in units (e.g., minor currency units like cents). |
deposit.amountPer | 'guest' | Indicates that the deposit amount is applied per guest. |
deposit.currency | Currency | The currency of the required deposit. |
deposit.terms? | string | The 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 a Payment
To create a Payment Intent, post the booking with the status pendingPayment
. The response will include a booking with the pendingPayment
status and a paymentIntent
object in the response.
The paymentIntent should be used with the Stripe SDK or Stripe API to authorise a payment. 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
.