Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking Booking REST API Filtering
- This topic has 5 replies, 2 voices, and was last updated 1 month ago by
J. Davis.
- AuthorPosts
- December 17, 2024 at 4:17 am #1705414
Cian de Staic
ParticipantHi,
Does the API support filtering/parameterisation for checkin date? Would be very helpful
December 26, 2024 at 1:49 pm #1708219J. Davis
KeymasterHi Cian,
You can use the example below:{ "filter":{ "meta_query":{ "relation":"AND", "date":{ "key":"mphb_check_in_date", "value":[ "2024-10-26", "2024-10-27" ], "compare":"BETWEEN", "type":"DATE" } } } }
You need to add it as JSON to the request’s body.
January 15, 2025 at 12:59 am #1714520Cian de Staic
ParticipantHi,
Unfortunately thats not filtering as expected for me – is that correct formatting?
January 16, 2025 at 10:54 pm #1715455J. Davis
KeymasterHi Cian,
I’ve tested it using Postman API and it worked correctly https://prnt.sc/n8TFSYtUogMb I got 1 reservation with the proper ID. Here is a screenshot from the backed calendar https://prnt.sc/cwhj-1UYB9ONJanuary 19, 2025 at 2:26 am #1716170January 20, 2025 at 6:42 am #1716652J. Davis
KeymasterI need more details to be able to help you figure this out. For example – screenshots of the actual booking that you want to filter, screenshots of your API request from the software that you use, etc. If there is personal information on the screenshots you may submit a private request to our support team. Thanks
- AuthorPosts
- You must be logged in to reply to this topic.