> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Package: reservations # Namespace: reservations # Webhook link: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/reservations/reservations/reservation-updated.md ## Introduction Triggered when a reservation is canceled. --- ## REST API ### Schema ``` Webhook: Reservation Updated Description: Triggered when a reservation is canceled. Event body: - name: id | type: string | description: Unique event ID. Allows clients to ignore duplicate events. - name: entityFqdn | type: string | description: Fully qualified domain name of the entity associated with the event. - name: slug | type: string | description: Event name. - name: entityId | type: string | description: ID of the entity associated with the event. - name: eventTime | type: string (date-time) | description: Event timestamp. - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application such as GDPR. - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event. - name: updatedEvent | type: object | description: Updated event details. - name: currentEntity | type: Reservation | description: The entity after the update. - name: id | type: string | description: Reservation GUID. - name: status | type: Status | description: Status of the reservation. See the [Reservation Lifecycle article](https://dev.wix.com/docs/rest/api-reference/wix-restaurants/reservations/reservations/the-reservation-lifecycle.md) for an explanation of the role of statuses in the reservation lifecycle. - enum: - HELD: A customer has begun the reservation flow, a temporary reservation is created and will expire in 10 minutes unless the customer moves forward with the reservation flow. This phase temporarily reserves the required number of seats and tables for a given party size at a chosen time while a customer enters details and/or confirms their reservation request. - RESERVED: The reservation is confirmed. - CANCELED: The reservation is canceled. - FINISHED: The reservation completed successfully. - NO_SHOW: The customer didn't show up for their reservation. - SEATED: The customer is currently occupying the table. - REQUESTED: A customer finished requesting this reservation, meaning they have added all necessary details and confirmed the request. Restaurant staff can now either approve or decline the reservation request. - DECLINED: The restaurant’s owner or staff declined the customer’s request to make the reservation. - PAYMENT_INFORMATION_PENDING: The reservation is awaiting payment. It will expire in 10 minutes from the created time unless the customer provides payment information. This phase temporarily reserves the required number of seats and tables for the given party size at the chosen time. - name: source | type: Source | description: Reservation source. This indicates how the reservation was made. - enum: - OFFLINE: The reservation was made by a restaurant employee, for example when a customer calls to make a reservation. - ONLINE: The reservation was made through a website or app. - WALK_IN: The reservation was made by a restaurant employee when the customer arrived at the restaurant without a prior reservation. - name: details | type: Details | description: Reservation details. - name: reservationLocationId | type: string | description: GUID of the reservation location at which this reservation will be made. - name: tables | type: Tables | description: Tables used for this reservation. - name: ids | type: array | description: IDs of tables used for this reservation. If you don't specify an `ids` array, or you specify an empty array, no tables are assigned. - name: startDate | type: string | description: Start date and time of the reservation. - name: endDate | type: string | description: End date and time of the reservation. - name: partySize | type: integer | description: Party size. - name: reservee | type: Reservee | description: Information about the person the reservation is being made for. A reservation created with any `source` other than `WALK_IN` requires the `reservation.reservee.phone` and `reservation.reservee.firstName` fields. Attempting to create a reservation without these fields results in an error. - name: firstName | type: string | description: First name. This field is required if the reservation's `source` is anything other than `WALK_IN`. - name: lastName | type: string | description: Last name. - name: email | type: string | description: Email address. - name: phone | type: string | description: Phone number. This property should begin with a +, followed by the country code, and then the rest of the phone number. For example, `"+972555555555"`. This field is required if the reservation's `source` is anything other than `WALK_IN`. - name: marketingConsent | type: boolean | description: Whether the reservee has given marketing consent. - name: customFields | type: object | description: Custom fields for the reservee in key-value pairs. The key is the custom field's GUID, and the value is the custom field's value. For example, a custom field for allergies might have the key-value pair `f4283b2d-6340-4cf9-bae7-8769e6b62127 : "Nuts, Seafood"`. Empty fields are not returned. - name: contactId | type: string | description: Contact GUID. If a contact with this GUID does not exist on the site, one will be created. - name: reservedBy | type: ReservedBy | description: Information about the person making the reservation. This field is required if the reservation's `source` is anything other than `WALK_IN`. - name: contactId | type: string | description: Contact GUID for the person who made the reservation. If a contact with this GUID does not exist on the site, one will be created. - name: teamMessage | type: string | description: Team message. A message for the restaurant staff containing any additional information regarding the reservation, such as special requirements for the guests. - name: createdDate | type: string | description: Date and time the reservation was created. - name: updatedDate | type: string | description: Date and time the reservation was changed. - name: revision | type: string | description: Revision number, which increments by 1 each time the reservation is updated. To prevent conflicting changes, the current revision must be specified when updating the reservation. Ignored when creating a reservation. - name: declineReason | type: string | description: The reason the reservation was declined. - name: paymentStatus | type: PaymentStatus | description: Payment status. - enum: - FREE: A reservation is free of charge. - NOT_PAID: Payment is not received yet. - PAID: The corresponding reservation order was fully paid. - PARTIALLY_REFUNDED: The corresponding reservation order was refunded, but the refund amount is less than the order total price. - FULLY_REFUNDED: The corresponding reservation order was fully refunded. The refund amount equals the total price. - PARTIALLY_PAID: The corresponding reservation order was partially paid. - name: extendedFields | type: ExtendedFields | description: Custom field data for the reservation object. [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md) must be configured in the app dashboard before they can be accessed with API calls. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: archived | type: boolean | description: Whether the reservation is archived. Archived reservations aren't shown in the dashboard along with other reservations. However, they can still be viewed in a separate section. Archived reservations can't be updated with Update Reservation. - name: modifiedFields | type: Map | description: Fields that were updated and their values before the update. ``` ### Examples ```curl { "entityId": "09b9ed74-ce92-4102-82dd-24c1c4941c3c", "slug": "updated", "id": "1d034196-3347-4a66-988a-3f30d7e51b9d", "updatedEvent": { "currentEntity": { "reservation": { "id": "09b9ed74-ce92-4102-82dd-24c1c4941c3c", "status": "RESERVED", "details": { "reservationLocationId": "28bca9ee-e5b9-4081-9f45-a6dded8593a1", "tables": { "ids": ["c215fb2a-0eb9-43d9-b7a7-8957e24c66e7"] }, "startDate": "2023-07-22T12:30:00Z", "endDate": "2023-07-22T14:00:00Z", "partySize": 2 }, "reservee": { "firstName": "John", "lastName": "Doe", "email": "john.doe@mail.com", "phone": "+38055325555", "marketingConsent": false, "contactId": "91c03323-c8bb-41e1-967c-bbf182e99be4" }, "reservedBy": { "contactId": "0274f02a-2170-452f-bfe8-452aacc70d0a" }, "createdDate": "2023-04-06T14:52:13.915Z", "updatedDate": "2023-04-06T15:50:10.115Z", "revision": "2" } } }, "entityFqdn": "wix.table_reservations.v1.reservation", "eventTime": "2023-04-06T15:50:10.115Z", "triggeredByAnonymizeRequest": false } ``` --- ## JavaScript SDK ### Schema ``` Webhook: onReservationUpdated Description: Triggered when a reservation is canceled. Payload: ReservationUpdatedEnvelope - name: entity | type: Reservation | description: none - name: _id | type: string | description: Reservation GUID. - name: status | type: Status | description: Status of the reservation. See the [Reservation Lifecycle article](https://dev.wix.com/docs/rest/api-reference/wix-restaurants/reservations/reservations/the-reservation-lifecycle.md) for an explanation of the role of statuses in the reservation lifecycle. - enum: - HELD: A customer has begun the reservation flow, a temporary reservation is created and will expire in 10 minutes unless the customer moves forward with the reservation flow. This phase temporarily reserves the required number of seats and tables for a given party size at a chosen time while a customer enters details and/or confirms their reservation request. - RESERVED: The reservation is confirmed. - CANCELED: The reservation is canceled. - FINISHED: The reservation completed successfully. - NO_SHOW: The customer didn't show up for their reservation. - SEATED: The customer is currently occupying the table. - REQUESTED: A customer finished requesting this reservation, meaning they have added all necessary details and confirmed the request. Restaurant staff can now either approve or decline the reservation request. - DECLINED: The restaurant’s owner or staff declined the customer’s request to make the reservation. - PAYMENT_INFORMATION_PENDING: The reservation is awaiting payment. It will expire in 10 minutes from the created time unless the customer provides payment information. This phase temporarily reserves the required number of seats and tables for the given party size at the chosen time. - name: source | type: Source | description: Reservation source. This indicates how the reservation was made. - enum: - OFFLINE: The reservation was made by a restaurant employee, for example when a customer calls to make a reservation. - ONLINE: The reservation was made through a website or app. - WALK_IN: The reservation was made by a restaurant employee when the customer arrived at the restaurant without a prior reservation. - name: details | type: Details | description: Reservation details. - name: reservationLocationId | type: string | description: GUID of the reservation location at which this reservation will be made. - name: tables | type: Tables | description: Tables used for this reservation. - name: ids | type: array | description: IDs of tables used for this reservation. If you don't specify an `ids` array, or you specify an empty array, no tables are assigned. - name: startDate | type: Date | description: Start date and time of the reservation. - name: endDate | type: Date | description: End date and time of the reservation. - name: partySize | type: integer | description: Party size. - name: reservee | type: Reservee | description: Information about the person the reservation is being made for. A reservation created with any `source` other than `WALK_IN` requires the `reservation.reservee.phone` and `reservation.reservee.firstName` fields. Attempting to create a reservation without these fields results in an error. - name: firstName | type: string | description: First name. This field is required if the reservation's `source` is anything other than `WALK_IN`. - name: lastName | type: string | description: Last name. - name: email | type: string | description: Email address. - name: phone | type: string | description: Phone number. This property should begin with a +, followed by the country code, and then the rest of the phone number. For example, `"+972555555555"`. This field is required if the reservation's `source` is anything other than `WALK_IN`. - name: marketingConsent | type: boolean | description: Whether the reservee has given marketing consent. - name: customFields | type: object | description: Custom fields for the reservee in key-value pairs. The key is the custom field's GUID, and the value is the custom field's value. For example, a custom field for allergies might have the key-value pair `f4283b2d-6340-4cf9-bae7-8769e6b62127 : "Nuts, Seafood"`. Empty fields are not returned. - name: contactId | type: string | description: Contact GUID. If a contact with this GUID does not exist on the site, one will be created. - name: reservedBy | type: ReservedBy | description: Information about the person making the reservation. This field is required if the reservation's `source` is anything other than `WALK_IN`. - name: contactId | type: string | description: Contact GUID for the person who made the reservation. If a contact with this GUID does not exist on the site, one will be created. - name: teamMessage | type: string | description: Team message. A message for the restaurant staff containing any additional information regarding the reservation, such as special requirements for the guests. - name: _createdDate | type: Date | description: Date and time the reservation was created. - name: _updatedDate | type: Date | description: Date and time the reservation was changed. - name: revision | type: string | description: Revision number, which increments by 1 each time the reservation is updated. To prevent conflicting changes, the current revision must be specified when updating the reservation. Ignored when creating a reservation. - name: declineReason | type: string | description: The reason the reservation was declined. - name: paymentStatus | type: PaymentStatus | description: Payment status. - enum: - FREE: A reservation is free of charge. - NOT_PAID: Payment is not received yet. - PAID: The corresponding reservation order was fully paid. - PARTIALLY_REFUNDED: The corresponding reservation order was refunded, but the refund amount is less than the order total price. - FULLY_REFUNDED: The corresponding reservation order was fully refunded. The refund amount equals the total price. - PARTIALLY_PAID: The corresponding reservation order was partially paid. - name: extendedFields | type: ExtendedFields | description: Custom field data for the reservation object. [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md) must be configured in the app dashboard before they can be accessed with API calls. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: archived | type: boolean | description: Whether the reservation is archived. Archived reservations aren't shown in the dashboard along with other reservations. However, they can still be viewed in a separate section. Archived reservations can't be updated with Update Reservation. - name: modifiedFields | type: Map | description: Fields that were updated and their values before the update. - ONE-OF: - name: nullValue | type: | description: - name: numberValue | type: number | description: - name: stringValue | type: string | description: - name: boolValue | type: boolean | description: - name: structValue | type: object | description: - name: listValue | type: ListValue | description: - name: values | type: array | description: - name: metadata | type: EventMetadata | description: none - name: instanceId | type: string | description: App instance GUID. - name: eventType | type: string | description: Event type. - name: identity | type: IdentificationData | description: The identification type and identity data. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site. - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site. - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.). - name: appId | type: string | description: GUID of an app. - name: identityType | type: WebhookIdentityType | description: - enum: UNKNOWN, ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP - name: accountInfo | type: AccountInfo | description: Details related to the account - name: accountId | type: string | description: GUID of the Wix account associated with the event. - name: parentAccountId | type: string | description: GUID of the parent Wix account. Only included when accountId belongs to a child account. - name: siteId | type: string | description: GUID of the Wix site associated with the event. Only included when the event is tied to a specific site. - name: _id | type: string | description: Event GUID. With this GUID you can easily spot duplicated events and ignore them. - name: entityFqdn | type: string | description: Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. - name: slug | type: string | description: Event action name, placed at the top level to make it easier for users to dispatch messages. For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. - name: entityId | type: string | description: GUID of the entity associated with the event. - name: eventTime | type: Date | description: Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application (for example, GDPR). - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event. - name: entityEventSequence | type: string | description: A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number. You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it. ``` ### Examples ```javascript import { reservations } from '@wix/table-reservations'; reservations.onReservationUpdated((event) => { // handle your event here }); ``` ```javascript import { createClient, AppStrategy } from '@wix/sdk'; import { reservations } from '@wix/table-reservations'; const wixClient = createClient({ auth: AppStrategy({ appId: 'MY-APP-ID', publicKey: 'YOUR_APP_PUBLIC_KEY', }), modules: { reservations, }, }); wixClient.reservations.onReservationUpdated((event) => { // handle your event here }); ``` ---