POST

Cancel Booking


Updates the booking status to CANCELED.

Appointments

For appointments, the corresponding event is removed from the Bookings calendar.

Class and course bookings

For class or course bookings, the relevant participants are removed from the class session or the course. However, the class session or course remain on the business calendar.

Notify customers

You can specify a participantNotification.message for the customer. To send the message, you must also specify participantNotification.notifyParticipants as true.

Admin overwrites

There are small but important differences when you specify special flowControlSettings:

  • {"ignoreCancellationPolicy": true}: The call succeeds even if the service's cancellationPolicy doesn't allow it.
  • {"withRefund": true}: The customer is refunded even if the service's refundPolicy doesn't allow it.
  • {"waiveCancellationFee": true}: The customer doesn't have to pay the cancellation fee, even if the service's cancellationPolicy requires it.

When using special flowControlSettings, ensure you have sufficient permissions. If you encounter failed calls due to insufficient permissions, consider the following options:

  • App developers can use a higher permission, such as MANAGE BOOKINGS - ALL PERMISSIONS.
  • Site developers can utilize elevation.

Granting additional permissions and using elevation permits method calls that would typically fail due to authorization checks. Therefore, you should use them intentionally and securely.

Permissions
Manage Bookings - all permissions
Manage Bookings
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/_api/bookings-service/v2/bookings/{bookingId}/cancel

Path Params
bookingIdstringRequired

ID of the booking to cancel.

Body Params
participantNotificationParticipantNotification

Information about whether to notify the customer about the cancellation and the message to send.


flowControlSettingsFlowControlSettings

Whether to ignore specific standard procedures of the Wix Bookings flow. For example, whether to allow a cancellation even though the service's policy doesn't allow it.


revisionintegerRequiredformat int64

Revision number, which increments by 1 each time the booking is updated.

To prevent conflicting changes, the current revision must be specified when managing the booking.

Response Object
bookingBooking

Canceled booking.

Cancel a booking
Request
cURL
curl -X POST \ 'https://www.wixapis.com/bookings/v2/bookings/b4d80fb5-2e8f-4174-91fd-dfededcb50d2/cancel' \ -H 'Authorization: <AUTH>' \ -d '{ "participantNotification": { "notifyParticipants": false }, "bookingId": "b4d80fb5-2e8f-4174-91fd-dfededcb50d2", "revision": "2" }'
Response
JSON
{ "booking": { "id": "b4d80fb5-2e8f-4174-91fd-dfededcb50d2", "bookedEntity": { "slot": { "sessionId": "193ZPR9ppP9emJUCLevcLf6orynNEIDt5nc0520xjGQILnPPaF5s62yK3BWz7ExgIRM1J49URLikdZT6CJLXZyZiJ7aRrbW5aOeFxjRhhZJydZySpZBsBvsCZIZfrMri1ZcwXXdaTgP9Up7myfU92Ic9cvx8Xk510wlYUMlf3XQdE2pXlHaLep9pppNCgTrbjFnYWy7qz8v1j0LzPipoXvAXdH6HZZhiQSJBLrBdPlbmi7XeV2eASBUxfbDYT3nJJZq2x5fUGw7vOqVn83AlJzbvrD0z0ZSJIZEPMg8GcJ5WN3JtFKKDRObj1ZM7jVahiubGWKUouZavvx", "eventId": "65a5776e-37f1-45f7-8e4c-f22d01b23254", "serviceId": "8cab7d8c-7f9f-4f32-b584-8e8fe4cf0310", "scheduleId": "9b50b858-7275-401c-bb58-4290b608f8e8", "startDate": "2022-02-03T11:30:00.000Z", "endDate": "2022-02-03T12:30:00.000Z", "resource": { "id": "5a79026c-36f9-4839-ad4a-9a3132af5895", "name": "Sharon", "scheduleId": "860676bf-b2c0-44e8-9ee4-3f36767fbb7e" }, "location": { "id": "5bdcd0e4-d329-4e99-8f5f-d056eae64999", "name": "Location 1", "locationType": "OWNER_BUSINESS" } }, "title": "Class_Online", "tags": ["GROUP"] }, "contactDetails": { "contactId": "a2ca1bc8-76e4-4295-8803-ab15aa506149", "firstName": "Carlos", "lastName": "Smith", "email": "Carlos@example.com" }, "additionalFields": [], "totalParticipants": 1, "status": "CANCELED", "paymentStatus": "UNDEFINED", "selectedPaymentOption": "OFFLINE", "createdDate": "2022-02-01T14:47:21.297Z", "revision": "3", "createdBy": { "wixUserId": "58b3acc8-9393-45a7-ab11-d81593662c1f" }, "startDate": "2022-02-03T11:30:00Z", "endDate": "2022-02-03T12:30:00Z" } }
Errors
403Permission Denied

There are 2 errors with this status code.

404Not Found

There is 1 error with this status code.

428Failed Precondition

There are 2 errors with this status code.

429Resource Exhausted

There is 1 error with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Event TriggersThis method triggers the following events:
Did this help?