Some dates on item dont have timeslots

edited November 8 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

  • JayCoughlanJayCoughlan Checkfront
    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 16

    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?
  • BrettBrett Checkfront
    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
Sign In or Register to comment.