Options
All
  • Public
  • Public/Protected
  • All
Menu

An item that can be booked at a certain time.

Hierarchy

Index

Properties

addons

Addons available for that item.

discountAmount

discountAmount: any

Total discount amount on the price.

discountCode

discountCode: string

Valid discount code that was applied, either the cart's code or one that was applied separately to the item. An invalid code results in a null value.

errors

errors: CartItemError[]

Current item validation errors.

guestId

guestId: string

ID of the guest associated with this item.

A null value implies the default guest, i.e. the booking client.

This field is more efficient than guest when only the ID is required.

id

id: string

ID of the item.

item

Original item details.

lineTotal

lineTotal: any

Total for the item after discounts and taxes.

price

price: any

Price before discounts and taxes.

startTime

startTime: any

Selected starting time for the item.

This value is reserved temporarily. Once the reservation expires, the value reverts to null and needs to be selected again. See the parent cart’s expiresAt field for more information.

taxAmount

taxAmount: any

Total tax amount on the discounted price.

Methods

getAvailablePaymentMethods

getGuest

  • Guest associated with this item.

    A null value implies the default guest, i.e. the booking client.

    Returns Promise<CartGuest>

getSelectedOptions

getSelectedPaymentMethod

getSelectedStaffVariant

  • Selected staff variant for the item.

    You can set the preferred variant when adding the item. Leaving the variant unset indicates no preference.

    Once a time is reserved, a variant is automatically set if none was set earlier. Once the reservation expires, any automatically set value reverts back to null.

    Returns Promise<CartAvailableBookableItemStaffVariant>

update

  • Update the item.

    This invalidates existing reservations when the guest, staff variant, or options are updated.

    async

    Parameters

    • Optional opts: { discountCode?: string; guest?: CartGuest; options?: CartAvailableBookableItemOption[]; staffVariant?: CartAvailableBookableItemStaffVariant }
      • Optional discountCode?: string

        Optional discount code applied to the item. Invalid discount codes are ignored without an error, check discountCode on the selected item to see if the code was valid.

      • Optional guest?: CartGuest

        The guest this item is booked for. A null value indicates the cart owner, or current client. When finding available times for bookable items, it's assumed that two items having different guests can be booked simultaneously.

      • Optional options?: CartAvailableBookableItemOption[]

        Selected bookable item options. Note that the selections must conform to the option group requirements, e.g. limits on the number of options. Otherwise an error is returned.

      • Optional staffVariant?: CartAvailableBookableItemStaffVariant

        The selected bookable item staff variant.

    Returns Promise<Cart>

    Promise containing the updated cart

Generated using TypeDoc