Search...
items
Returns an array of bookings that match the query.
Description
Type:
Array<Booking>Read Only
NAME
TYPE
DESCRIPTION
_id
string
Booking ID.
bookedEntity
BookedEntity
An object describing the entity that was booked.
bookedResources
Array<BookedResource>
List of booked resources. Currently, only one is supported. The booked resource would be the staff-member giving the session.
formInfo
Form
Form information submitted when booking. FormInfo contains contact details, participants, and other form fields, set up for the service.
paymentDetails
PaymentDetails
Payment Details.
status
string
Booking status.
One of:
"PENDING_CHECKOUT"
The booking is waiting to be checked out."CONFIRMED"
The booking has beed approved by the owner."CANCELED"
The booking has been canceled."PENDING"
The booking has been created."PENDING_APPROVAL"
The booking is waiting for the owner to approve or decline."DECLINED"
The booking was declined by the owner.
attendanceInfo
AttendanceInfo
Attendance information.
bookingSource
BookingSource
An object describing the platform and application that made the booking.
externalUserId
string
External ID provided by the client app on creation.
_createdDate
Date
Date and time the booking was created.
Was this helpful?
Perform a query and get the booking items from the result
Copy Code
1import { bookings } from "wix-bookings-backend";23// ...4bookings.queryBookings()5 .find()6 .then((results) => {7 if (results.items.length > 0) {8 let items = results.items; // see below9 } else {10 // handle case where no matching items found11 }12 })13 .catch((error) => {14 console.error(error);15 });161718/* items:19 * [20 * {21 * "_id": "3bab599d-c032-4f4c-89b1-c73dc51f013c",22 * "bookedEntity": {23 * "serviceId": "57daccbf-0fc9-4f3d-9c9e-1969947f33fa",24 * "scheduleId": "b5c9d6f1-8606-4378-9f4b-7e94d98de91f",25 * "setOfSessions": {26 * "firstSessionStart": "2021-01-20T14:30:00Z",27 * "lastSessionEnd": "2021-03-24T14:30:00Z"28 * },29 * "title": "12 Part Meditation Course",30 * "location": {31 * "locationType": "OWNER_BUSINESS"32 * },33 * "rate": {34 * "labeledPriceOptions": {35 * "general": {36 * "amount": "5000",37 * "currency": "USD",38 * "downPayAmount": "50"39 * }40 * }41 * },42 * "tags": [43 * "COURSE"44 * ]45 * },46 * "bookedResources": [47 * {48 * "_id": "76570209-101f-409b-af97-b445bdb63125",49 * "name": "John Smith",50 * "email": "jsmith@gmail.com"51 * }52 * ],53 * "status": "CONFIRMED",54 * "_createdDate": "2021-01-11T08:46:20.703Z",55 * "bookingSource": {56 * "platform": "WEB",57 * "actor": "CUSTOMER",58 * "appDefId": "13d21c63-b5ec-5912-8397-c3a5ddb27a97",59 * "appName": "Wix Bookings"60 * },61 * "formInfo": {62 * "paymentSelection": [63 * {64 * "rateLabel": "general",65 * "numberOfParticipants": 166 * }67 * ],68 * "additionalFields": [69 * {70 * "_id": "00000000-0000-0000-0000-000000000008",71 * "label": "Add Your Message",72 * "valueType": "LONG_TEXT"73 * }74 * ],75 * "contactDetails": {76 * "contactId": "593da82a-9718-4d43-9db0-8414320b3aa0",77 * "firstName": "Frank White",78 * "email": "frankw@wmail.com",79 * "phone": "555 3456",80 * "timeZone": "America/New_York",81 * "countryCode": "US"82 * }83 * },84 * "paymentDetails": {85 * "balance": {86 * "finalPrice": {87 * "amount": "5000",88 * "currency": "USD",89 * "downPayAmount": "50"90 * },91 * "amountReceived": "5000"92 * },93 * "state": "COMPLETE",94 * "wixPayMultipleDetails": [95 * {96 * "txId": "eb804fc3-ecab-49c9-8785-0e12d71aaff8",97 * "orderId": "6fa06198-1c39-4cf0-91db-a01b10720f56",98 * "orderAmount": "4950",99 * "orderStatus": "UNDEFINED",100 * "orderApprovalTime": "2021-01-11T08:47:44.757Z",101 * "paymentVendorName": "inPerson"102 * },103 * {104 * "orderId": "aedcae46-844b-4091-b174-cf90f102629f",105 * "orderAmount": "50",106 * "orderStatus": "UNDEFINED"107 * }108 * ]109 * }110 * },111 * {112 * "_id": "7125331e-75e6-4889-809a-5dea10648b30",113 * "bookedEntity": {114 * "serviceId": "b71df756-309f-468e-aec2-f82b9a9a9441",115 * "scheduleId": "53616b1f-0c3c-45a1-b282-675acd248179",116 * "singleSession": {117 * "sessionId": * "193ZPR9ppP9emJUCLevcLf6orynNEIDt5nc0520xjGQILnPPaF5s62yK3BWz7ExgIRM1* HunZjEPUQ0IeScwcTFJNXEmLG2g6Q8tvUJQZrPhU6XKhVrlLZraC3YcVfygADFiCPyyy5* IVhgtDpF30FnQDoG8I60n21QAlhok4LHNlkBszoGZ67jGMeDOqxS8PXZgJx87ByXwfgsN* 3AfXbndYxESrFnttLnRSFzcsolPAjYhaRCdJBhUj8rAoBoj71MgiFi4Tw3FDyVZz2OeOH* GmfQwRi0ELuqZvw0Y5tmMXrIKa48SvG8sr2MyOQsaIbMHy8YX1Q8anAgfdt",118 * "start": "2021-01-22T10:30:00Z",119 * "end": "2021-01-22T11:00:00Z"120 * },121 * "title": "Yoga Class",122 * "location": {123 * "locationType": "OWNER_BUSINESS"124 * },125 * "rate": {126 * "labeledPriceOptions": {127 * "general": {128 * "amount": "50",129 * "currency": "USD",130 * "downPayAmount": "0"131 * }132 * }133 * },134 * "tags": [135 * "GROUP"136 * ]137 * },138 * "bookedResources": [139 * {140 * "_id": "76570209-101f-409b-af97-b445bdb63125",141 * "name": "John Smith",142 * "email": "jsmith@gmail.com"143 * }144 * ],145 * "status": "PENDING_CHECKOUT",146 * "_createdDate": "2021-01-11T08:45:00.214Z",147 * "attendanceInfo": {148 * "attendanceStatus": true,149 * "numberOfAttendees": 1150 * },151 * "bookingSource": {152 * "platform": "WEB",153 * "actor": "CUSTOMER",154 * "appDefId": "13d21c63-b5ec-5912-8397-c3a5ddb27a97",155 * "appName": "Wix Bookings"156 * },157 * "formInfo": {158 * "paymentSelection": [159 * {160 * "rateLabel": "general",161 * "numberOfParticipants": 1162 * }163 * ],164 * "additionalFields": [165 * {166 * : "00000000-0000-0000-0000-000000000008",167 * "value": "Cant wait to start",168 * "label": "Add Your Message",169 * "valueType": "LONG_TEXT",170 * "_id": "00000000-0000-0000-0000-000000000008"171 * }172 * ],173 * "contactDetails": {174 * "contactId": "a6d4c19e-1882-4e29-9eb3-411e1aeeb874",175 * "firstName": "Joe Green",176 * "email": "JoeGreen@hmail.com",177 * "phone": "9998765",178 * "timeZone": "America/New_York",179 * "countryCode": "US"180 * }181 * },182 * "paymentDetails": {183 * "balance": {184 * "finalPrice": {185 * "amount": "50",186 * "currency": "USD",187 * "downPayAmount": "0"188 * },189 * "amountReceived": "0"190 * },191 * "state": "PENDING_CASHIER",192 * "wixPayMultipleDetails": [193 * {194 * "orderId": "dd702e88-68e0-4faa-94b2-4996136a9828",195 * "orderAmount": "50",196 * "orderStatus": "UNDEFINED"197 * }198 * ]199 * },200 * }201 * ]202 */