Updates the booking status to CANCELED
.
For appointments, the corresponding event is removed from the Bookings calendar.
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.
You can specify a participantNotification.message
for the customer. To send
the message, you must also specify participantNotification.notifyParticipants
as true
.
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:
MANAGE BOOKINGS - ALL PERMISSIONS
.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.
ID of the booking to cancel.
Information about whether to notify the customer about the cancellation and the message to send.
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.
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.
Canceled booking.
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"
}'
{
"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"
}
}
There are 2 errors with this status code.
There is 1 error with this status code.
There are 2 errors with this status code.
There is 1 error with this status code.
This method may also return standard errors. Learn more about standard Wix errors.