Booking REST API Filtering

  • This topic has 5 replies, 2 voices, and was last updated 1 month ago by J. Davis.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1705414
    Cian de Staic
    Participant

    Hi,

    Does the API support filtering/parameterisation for checkin date? Would be very helpful

    #1708219
    J. Davis
    Keymaster

    Hi 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.

    #1714520
    Cian de Staic
    Participant

    Hi,

    Unfortunately thats not filtering as expected for me – is that correct formatting?

    #1715455
    J. Davis
    Keymaster

    Hi 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-1UYB9ON

    #1716170
    Cian de Staic
    Participant

    Not sure where I’m going wrong?

    #1716652
    J. Davis
    Keymaster

    I 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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.