API: get bookings for a specific item
in Developers
Hello Checkfront,
Is there a way to query bookings for a specific item? Something like /booking/item/[item_id] or /item/[item_id]/bookings. I can't find anything in the docs.
My use case is:
Items (properties/holiday cottages in this case) have owners. Property owners can log in to the website I am building and see the bookings for their properties.
I can of course query every single booking in the system and filter them at my end, but this seems sub-optimal; over time there will be thousands of bookings in the system.
Thanks.
Is there a way to query bookings for a specific item? Something like /booking/item/[item_id] or /item/[item_id]/bookings. I can't find anything in the docs.
My use case is:
Items (properties/holiday cottages in this case) have owners. Property owners can log in to the website I am building and see the bookings for their properties.
I can of course query every single booking in the system and filter them at my end, but this seems sub-optimal; over time there will be thousands of bookings in the system.
Thanks.
Comments
Thanks for reaching out on the Checkfront forums!
You can make a request for a list of bookings using the "booking/index" endpoint, but unfortunately, it doesn't currently include references to which items are listed in each booking, so there won't be a way to query the bookings for a specific item.
I can see how it would be less than ideal to query every single booking and would make more sense to retrieve a list of bookings for a specific item, so I've gone ahead and created a feature request on your behalf for our product team to review. You can learn more about how we manage feature requests here: https://www.checkfront.com/how-we-handle-feature-requests
Cheers,
Mitch
Checkfront Development
Thanks for the reply and feature request. I have a workaround in place as described above, filtering the bookings by item at my end. It feels like a bit of a hack though.
Rather than the endpoints I mentioned above, it makes more sense for item_id to be sent as a query parameter, something like GET /api/3.0/booking?item_id=23. But that's for your devs to decide!
Just wanted to let you know that we have recently added the item_id filter to the booking/index, as described here: http://api.checkfront.com/ref/booking/index.html
Thank you for this feature request!
Best Regards,
Brett - Checkfront Support Team