# How to cancel booking by API

**URL:** <https://forum.youcanbook.me/t/how-to-cancel-booking-by-api/889>\
**Category:** API\
**Created:** [August 13, 2020, 11:11am UTC](https://forum.youcanbook.me/t/how-to-cancel-booking-by-api/889 "2020-08-13T11:11:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevin.quoc](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.youcanbook.me/kevin.quoc/32/127_2.png) [@kevin.quoc](https://forum.youcanbook.me/u/kevin.quoc)\
**Post date:** [August 13, 2020, 11:11am UTC](https://forum.youcanbook.me/t/how-to-cancel-booking-by-api/889/1 "2020-08-13T11:11:46Z")

</div>

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

How to cancel booking by API?

Thanks!

---

<div class="post-metadata">

**Author:** ![Ben](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.youcanbook.me/ben/32/772_2.png) [@Ben](https://forum.youcanbook.me/u/Ben)\
**Post date:** [August 14, 2020, 9:59pm UTC](https://forum.youcanbook.me/t/how-to-cancel-booking-by-api/889/2 "2020-08-14T21:59:12Z")

</div>

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}](http://embedurl.com?c=%7BID%7D) which you can add to the booking confirmation and notification.

---

<div class="post-metadata">

**Author:** ![kevin.quoc](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.youcanbook.me/kevin.quoc/32/127_2.png) [@kevin.quoc](https://forum.youcanbook.me/u/kevin.quoc)\
**Post date:** [October 8, 2020, 5:28am UTC](https://forum.youcanbook.me/t/how-to-cancel-booking-by-api/889/4 "2020-10-08T05:28:11Z")

</div>

Thanks @Ben.

It worked fine.

---

<div class="post-metadata">

**Author:** ![theapidev](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@theapidev](https://forum.youcanbook.me/u/theapidev)\
**Post date:** [September 5, 2024, 1:34pm UTC](https://forum.youcanbook.me/t/how-to-cancel-booking-by-api/889/5 "2024-09-05T13:34:41Z")

</div>

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}](https://api.youcanbook.me/v1/bookings/%7BbookingId%7D)? I tried both and none work.

---

<div class="post-metadata">

**Author:** ![Ben](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.youcanbook.me/ben/32/772_2.png) [@Ben](https://forum.youcanbook.me/u/Ben)\
**Post date:** [September 5, 2024, 6:24pm UTC](https://forum.youcanbook.me/t/how-to-cancel-booking-by-api/889/6 "2024-09-05T18:24:42Z")

</div>

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