How to cancel booking by API

Hello, I am implementing the function of canceling YCB booking on wordpress.

How to cancel booking by API?

Thanks!

1 Like

You can send a request through to the booking end point, with the PATCH and “cancelled”:true,

If you are looking to have cancellations go through your WordPress site, then there is a bit of code you can add to your embed to accept URL parameters and build out a cancel link like embedurl.com?c={ID} which you can add to the booking confirmation and notification.

2 Likes

Thanks @Ben.

It worked fine.

Hey @Ben this has stopped working. It’s also quite confusing in the docs that there are different ways to cancel it. Both PATCH /v1/intents/{intentId}/booking/cancel and PATCH https://api.youcanbook.me/v1/bookings/{bookingId}? I tried both and none work.

@theapidev I answered you in the other thread. I just tested this and it worked for me. Let’s catch up over there.