onBookingScheduleUpdated( )


An event that fires when a booking's schedule is updated.

The onBookingScheduleUpdated() event handler runs when a booking's schedule is updated.

The event object includes a trigger property that describes the action that triggered the event. The trigger value is one of:

  • "OWNER_UPDATED_SESSION": The booking's session was updated by the business.
  • "MEMBER_RESCHEDULED_BOOKING": The booking was rescheduled by the member.
  • "OWNER_CANCELED_SESSION_IN_SET": A session in a set of sessions was canceled by the business. A session is part of a set when it belongs to a schedule that has "course" as one of its tags.

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

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

Information about a booking with an updated schedule.

An event when a booking schedule is updated
JavaScript
// Place this code in the events.js file // of your site's Backend section. export function wixBookings_onBookingScheduleUpdated(event) { const eventTrigger = event.trigger; const bookingId = event.booking._id; } /* Full event object * { * "trigger": "OWNER_UPDATED_SESSION", * "booking": { * "_id": "98edaf1a-6dcf-4cd5-90c7-02983649227c", * "bookedResources": [{ * "id": "3eaef8e0-465f-47a0-a686-16620dfb20dc", * "name": "Harold Snow", * "email": "hs@a.com" * }], * "status": "CONFIRMED", * "createdDate": "2021-02-28T17:58:45.568Z", * "bookingSource": { * "appDefId": "13d21c63-b5ec-5912-8397-c3a5ddb27a97", * "appName": "Wix Bookings" * }, * "bookedEntity": { * "serviceId": "b71df756-309f-468e-aec2-f82b9a9a9441", * "scheduleId": "53616b1f-0c3c-45a1-b282-675acd248179", * "singleSession": { * "sessionId": *"193ZPR9ppP9emJUCLevcLf6orynNEIDt5nc0520xjGQILnPPaF5s62yK3BWz7ExgIRM1HunZjEPUQ0IeScwcTFJNXEmLG2g *6Q8tvUJQZrPhU6XKhVrlLZraC3YcVfygADFiCPyyy5IVhgtDpF30FnQEWHzPMns58Sr8MvMAWkXSK8uJwh6UEdKaJSUymSrx *fZLltS56uD8nF6wfFUUkwcJNPklOZY3iwdK69i4mBxWWKleDBJrtctN2M4M3JVsi9kJ5cH8fSCPxUUQyqeKqquHxIyAF7TAe *wiEN6ID3HACgTwE6n5FaQ6cDssdarwuTWaqsFQ0GEhtgJvZ", * "start": "2021-03-18T16:30:00.000Z", * "end": "2021-03-18T17:00:00.000Z" * }, * "title": "Yoga Class", * "rate": { * "labeledPriceOptions": { * "general": { * "amount": "50", * "currency": "USD", * "downPayAmount": "0" * } * } * }, * "tags": ["GROUP"], * "location": { * "address": "123 West Street, New York, New York", * "customAddress": { * "formatted": "123 West Street, New York, New York" * }, * "locationType": "OWNER_CUSTOM" * } * }, * "paymentDetails": { * "balance": { * "finalPrice": { * "amount": "50", * "currency": "USD", * "downPayAmount": "0" * }, * "amountReceived": "0" * }, * "state": "PENDING_MARK_AS_PAID", * "wixPayMultipleDetails": [{ * "txId": "dccef7b1-0b8a-47a2-af8a-4cd349a3f8cb", * "orderId": "c3e0e57a-b8fc-48a8-9869-e0839aed92ce", * "orderAmount": "50", * "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": "98edaf1a-6dcf-4cd5-90c7-02983649227c", * "bookedResources": [{ * "id": "3eaef8e0-465f-47a0-a686-16620dfb20dc", * "name": "Harold Snow", * "email": "hs@a.com" * }], * "status": "CONFIRMED", * "createdDate": "2021-02-28T17:58:45.568Z", * "bookingSource": { * "appDefId": "13d21c63-b5ec-5912-8397-c3a5ddb27a97", * "appName": "Wix Bookings" * }, * "bookedEntity": { * "serviceId": "b71df756-309f-468e-aec2-f82b9a9a9441", * "scheduleId": "53616b1f-0c3c-45a1-b282-675acd248179", * "singleSession": { * "sessionId": *"193ZPR9ppP9emJUCLevcLf6orynNEIDt5nc0520xjGQILnPPaF5s62yK3BWz7ExgIRM1HunZjEPUQ0IeScwcTFJNXEmLG2g *6Q8tvUJQZrPhU6XKhVrlLZraC3YcVfygADFiCPyyy5IVhgtDpF30FnQEWHzPMns58Sr8MvMAWkXSK8uJwh6UEdKaJSUymSrx *fZLltS56uD8nF6wfFUUkwcJNPklOZY3iwdK69i4mBxWWKleDBJrtctN2M4M3JVsi9kJ5cH8fSCPxUUQyqeKqquHxIyAF7TAe *wiEN6ID3HACgTwE6n5FaQ6cDssdarwuTWaqsFQ0GEhtgJvZ", * "start": "2021-03-18T16:00:00.000Z", * "end": "2021-03-18T16:30:00.000Z" * }, * "title": "Yoga Class", * "rate": { * "labeledPriceOptions": { * "general": { * "amount": "50", * "currency": "USD", * "downPayAmount": "0" * } * } * }, * "tags": ["GROUP"], * "location": { * "address": "123 West Street, New York, New York", * "customAddress": { * "formatted": "123 West Street, New York, New York" * }, * "locationType": "OWNER_CUSTOM" * } * }, * "paymentDetails": { * "balance": { * "finalPrice": { * "amount": "50", * "currency": "USD", * "downPayAmount": "0" * }, * "amountReceived": "0" * }, * "state": "PENDING_MARK_AS_PAID", * "wixPayMultipleDetails": [{ * "txId": "dccef7b1-0b8a-47a2-af8a-4cd349a3f8cb", * "orderId": "c3e0e57a-b8fc-48a8-9869-e0839aed92ce", * "orderAmount": "50", * "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?