Booking a custom time length in bookings calendar

New to velo (this is literally my first attempt at using it) but my client from the marketplace wants users to be able to book a custom time slot through the site. It needs to generate some sort of invoice or option to pay based on the total - whether it’s a different form on the site or through the invoice system. Haven’t thought that far ahead.

Looking for suggestions based on my plan so I don’t fall into traps that maybe more experienced velo devs know.
So basically the plan is to get available time slots into a dropdown- then use a little algorithmic magic to get the available times between the first one and the next one that’s booked. So if there’s a booking at 5 and a booking at 10, it will return all the slots in between for the end time. Then based on the service category it’ll total the time and save it into a database collection for bookings payments.

Then, as long as the invoicing system’s API isn’t as limited as the bookings one is :sweat_smile: I will generate a custom invoice. Otherwise they’ll either have to generate one or, if possible, login to make the payment on a fancy form.

Based on my experience thus far with Velo, I’m nervous that certain aspects of this just… won’t work. Can anyone comment on my plan? I have plenty of javascript experience but the API seems very limited, and I’m surprised nobody has posted a solution to this even though some threads were opened a couple years ago on it. Also, not to pound onto the negativity train, but I was very disappointed that the tutorial on YouTube for using the bookings API has code that literally cannot work. Maybe there was an update since that video was created, but there is a bug in the code that would make it impossible to work.