BookingSync / bookingsync-api-docs

BookingSync API Documentations
http://developers.bookingsync.com/
12 stars 6 forks source link

Include rental_url in rentals #340

Closed bkniffler closed 3 years ago

bkniffler commented 3 years ago

I found that rentals can't be fetched with rental_url included, but rental_urls can be fetched with the rentals. Wouldn't it make sense to include rental_url into the /rentals endpoint?

Azdaroth commented 3 years ago

@bkniffler You mean you would like to sideload rental_urls relationship when fetching rentals? In general, that's not a recommended approach and that's why at some point new associations were stopped from getting added. Sideloading is ok when you have a strict transaction boundary (e.g. booking + bookings taxes + bookings fees in a context of anything related to price as it might be a problem when using booking's final price if the sum of all its components doesn't match). Otherwise, the recommended approach is to fetch resources separately using update since flow as described here: http://developers.bookingsync.com/guides/updated-since-flow/

bkniffler commented 3 years ago

Makes sense. So your recommendation is to fetch all rentals and all rental_urls separately, keep them updated with updated-since flow and make the appropriate associations in our own systems.