onBookingUpdated( )


An event that fires when a booking's details are updated.

The onBookingUpdated() event handler runs when a booking's details are updated.

The event object includes a trigger property that describes the action that triggered the event. The trigger value for this event is "OWNER_UPDATED_ATTENDANCE" when the business updates the booking's attendance information.

Note: Backend events don't work when previewing your site.

Method Declaration
Copy
function onBookingUpdated(event: BookingEvent): void;
Method Parameters
eventBookingEventRequired

Information about an updated booking.

An event when a booking is updated
JavaScript
// Place this code in the events.js file // of your site's Backend section. export function wixBookings_onBookingUpdated(event) { const eventTrigger = event.trigger; const bookingId = event.booking._id; } /* Full event object * { * "trigger": "OWNER_UPDATED_ATTENDANCE", * "booking": { * "_id": "9f5a05d6-2fb4-4de8-990d-12db585d25c5", * "bookedResources": [{ * "_id": "6dd5e48d-9e6d-4e74-bf61-e103e8d52575", * "name": "Jane Doe", * "email": "Doe" * }], * "status": "CONFIRMED", * "_createdDate": "2021-02-28T18:11:56.177Z", * "attendanceInfo": { * "attendanceStatus": true, * "numberOfAttendees": 3 * }, * "bookingSource": { * "platform": "WEB", * "actor": "BUSINESS", * "appDefId": "13d21c63-b5ec-5912-8397-c3a5ddb27a97", * "appName": "Wix Bookings" * }, * "bookedEntity": { * "serviceId": "2e80e5e0-2385-49c7-9f9f-2e59a3566809", * "scheduleId": "f1945fde-d567-4ebc-85ef-dd1d52327c11", * "singleSession": { * "sessionId": "2mmoW0vwKcSFyxtOfCdMhFC1gAivXqAQVAQP0hHoOUADs242fBtwKRY3sHLMmbVxJ75TQ4G6BkCe6z1E1fVT6gUPWDDNF4WX2S6P", * "start": "2021-03-18T19:00:00.000Z", * "end": "2021-03-18T20:00:00.000Z" * }, * "title": "Appointment service", * "rate": { * "labeledPriceOptions": { * "general": { * "amount": "10", * "currency": "USD", * "downPayAmount": "0" * } * } * }, * "tags": ["INDIVIDUAL"], * "location": { "locationType": "OWNER_BUSINESS" } * }, * "paymentDetails": { * "balance": { * "finalPrice": { * "amount": "10", * "currency": "USD", * "downPayAmount": "0" * }, * "amountReceived": "0" * }, * "state": "PENDING_MARK_AS_PAID", * "wixPayMultipleDetails": [{ * "txId": "c1cef510-e382-4c1c-aeec-4300cfea219a", * "orderId": "179c361c-8a04-4f78-b28f-065b62cf4806", * "orderAmount": "10", * "paymentVendorName": "inPerson", * "orderApprovalTime": null * }] * }, * "formInfo": { * "paymentSelection": [{ * "rateLabel": "general", * "numberOfParticipants": 1 * }], * "additionalFields": [{ * "_id": "00000000-0000-0000-0000-000000000008", * "label": "Add Your Message", * "valueType": "LONG_TEXT" * }], * "contactDetails": { * "contactId": "baf3cd37-c32c-4f01-9e1a-c8ab152af490", * "firstName": "Adam Smith ", * "email": "asmith@amail.com", * "phone": "9998765", * "timeZone": "America/New_York", * "countryCode": "US" * } * } * }, * "previousBooking": { * "_id": "9f5a05d6-2fb4-4de8-990d-12db585d25c5", * "bookedResources": [{ * "_id": "6dd5e48d-9e6d-4e74-bf61-e103e8d52575", * "name": "Jane Doe", * "email": "Doe" * }], * "status": "CONFIRMED", * "_createdDate": "2021-02-28T18:11:56.177Z", * "attendanceInfo": { * "attendanceStatus": true, * "numberOfAttendees": 1 * }, * "bookingSource": { * "platform": "WEB", * "actor": "BUSINESS", * "appDefId": "13d21c63-b5ec-5912-8397-c3a5ddb27a97", * "appName": "Wix Bookings" * }, * "bookedEntity": { * "serviceId": "2e80e5e0-2385-49c7-9f9f-2e59a3566809", * "scheduleId": "f1945fde-d567-4ebc-85ef-dd1d52327c11", * "singleSession": { * "sessionId": "2mmoW0vwKcSFyxtOfCdMhFC1gAivXqAQVAQP0hHoOUADs242fBtwKRY3sHLMmbVxJ75TQ4G6BkCe6z1E1fVT6gUPWDDNF4WX2S6P", * "start": "2021-03-18T19:00:00.000Z", * "end": "2021-03-18T20:00:00.000Z" * }, * "title": "Appointment service", * "rate": { * "labeledPriceOptions": { * "general": { * "amount": "10", * "currency": "USD", * "downPayAmount": "0" * } * } * }, * "tags": ["INDIVIDUAL"], * "location": { "locationType": "OWNER_BUSINESS" } * }, * "paymentDetails": { * "balance": { * "finalPrice": { * "amount": "10", * "currency": "USD", * "downPayAmount": "0" * }, * "amountReceived": "0" * }, * "state": "PENDING_MARK_AS_PAID", * "wixPayMultipleDetails": [{ * "txId": "c1cef510-e382-4c1c-aeec-4300cfea219a", * "orderId": "179c361c-8a04-4f78-b28f-065b62cf4806", * "orderAmount": "10", * "paymentVendorName": "inPerson", * "orderApprovalTime": null * }] * }, * "formInfo": { * "paymentSelection": [{ * "rateLabel": "general", * "numberOfParticipants": 1 * }], * "additionalFields": [{ * "_id": "00000000-0000-0000-0000-000000000008", * "label": "Add Your Message", * "valueType": "LONG_TEXT" * }], * "contactDetails": { * "contactId": "baf3cd37-c32c-4f01-9e1a-c8ab152af490", * "firstName": "Adam Smith ", * "email": "asmith@amail.com", * "phone": "9998765", * "timeZone": "America/New_York", * "countryCode": "US" * } * } * } * } */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?