Some dates on item dont have timeslots

edited November 2018 in Developers
Using the below query, I can get the item data, but only the first does have an inventory per timeslot:

/api/3.0/item/54/?start_date=2018-09-03&end_date=2018-10-01






I want to get all inventory per timeslot in all dates specified in date range. And querying each day can't help because what if I want to get timeslots for more than 100 days, that means requesting api 100 times.

Comments

  • Hi Glenn_wend

    Thank you for reaching out to us! You can use our item/{item_id}/cal endpoint to retrieve the availability for a single item and it's range of dates. You can also use item/cal to retrieve the availability for all your items. You can read more about both these endpoints on our public API documentation at api.Checkfront.com

    You can also use the parameter show_upcoming=true in your API item call to show you the availability for the next three available dates. For example; item/{item_id}/?start_date=20181110&show_upcoming=true will show you the items details. Please keep in mind this doesn't work on Child items, as those do not use show_upcoming on the backend, due to how they're designed.

    I hope that helps! If you have any more questions or concerns feel free to reply, or you can email our support directly at support@checkfront.com.

    Thank you for your time, I hope you have a great day and Happy Bookings!

    Jay Coughlan | Technical Support Specialist
  • Hi Jay,

    item/{item_id}/cal endpoint returns this






    But what I need is this below, I need timeslots in each dates. I want to get all inventory per timeslot in all dates specified in date range. Not just the first date but all dates.

                 
  • Hi Glenn_wend,

    Thank you for your response! You are correct, the /cal endpoint only retrieves availability per day. What customers often do is use the /cal endpoint to retrieve which days are available, then search the available days individually for the available time-slots. At this time our public API does not return the time-slots and availability for all selected dates. This is because having an endpoint that provides all the availabilities for an item over a time-span, especially a large time-span and for multiple items can be quite intensive and affect Checkfront's performance. Still, I understand this isn't an ideal solution, and I will make sure to let the product team know your feedback so this can be considered in future updates.

    I hope that helps! If you have any more questions or concerns feel free to reply, or you can email our support directly at support@checkfront.com.

    Thank you for your time, I hope you have a great day and Happy Bookings!

    Jay Coughlan | Technical Support Specialist 
  • edited November 2018

    If that's the case, then is there any API request limitations?

    Is it fine if I'm going to have a lot of requests like 100-500+ at once?
  • Hi @glenn_wend,

    Thank you for your question.

    We do have API limits, however they are set reasonably high, If you are wanting to maintain a list of all availability for all items, I would recommend building your integration in a way that reasonably queries the API for say a week at a time, caches the response, and then queries the following week in another batch of requests. Then, your application can read from your cache which you can update as needed (when there's a new booking during that week for example). You can either do this manually during your booking flow if all bookings are made through your integration, or you could set up webhooks that will bust the cache for a given week.

    This approach will allow you to maintain a large list of availability that can easily be read from without having to send an unreasonable number of requests to the API with each page view or availability check on your end.

    I hope this explanation helps, but let me know if you have any additional questions.

    Best Regards,

    Brett - Checkfront Support Team
  • edited July 16
    @Brett
    we tried a two-three days query but it still gives us an empty time slot for the second day.

    Best Regards,
    Raymon
  • Hello raymon_wend,

    Please try adding this parameter to your query: 'times=all'

    Such that the query will look something like this:
    /item/{item_id}?start_date={start}&end_date={end}&times=all

    This should allow you to retrieve all timeslots for each day of your query.

    I hope this helps, and please let me know if you have any more questions about this.

    All the best,

    Chase
    Technical Support Analyst
    Checkfront | www.checkfront.com/contact | Email: support@checkfront.com

  • Aye but this still doesn't have availability or even times so it's utterly worthless.
  • Hello jake,

    Thank you for using our forums.

    Using a query as described above will return availability for every timeslot for each date within the specified date range. Just as an example, here are two dates returned from the one query:
    https://cl.ly/f23df10436a2
    https://cl.ly/4c5ae40e3736

    All three of the timeslots for this item are shown for both dates, with their availabilities.

    If you have any more questions about this, please feel free to reach out to support@checkfront.com so I can take a closer look at your configuration and the queries you are making.

    All the best,
    Chase
    Technical Support Analyst
    Checkfront | www.checkfront.com/contact | Email: support@checkfront.com
Sign In or Register to comment.