Μετάβαση στο περιεχόμενο

1 λεπτά ανάγνωσης

Πακέτο Διαθεσιμότητα Κράτηση

Booking totals

For various purposes, people want to compute different kinds of totals on their bookings. Therefore, we don't include totals in the booking object directly. Instead, you can compute totals for some booking by using the line_items related to that booking.

First, you select a bookings line items including their tax lines using our API: GET https://api.bookingmood.com/v1/line_items?select=,line_item_taxes!line_item_id()&booking_id=eq.{{YOUR_BOOKING_ID}}

These line-items can be split into fees and deposits: fees = items.filter(item => item.fee_type === 'fee') deposits = items.filter(item => item.fee_type === 'deposit')

Furthermore, taxes can be extracted: taxes = items.flatMap(item => item.line_item_taxes) included_taxes = taxes.filter(tax => tax.type === "included') additive_taxes = taxes.filter(tax => tax.type === 'on-top')

If useful, you could group taxes by tax_id or (name.default).

Now here are some standard totals you might want to use: subtotal = sum(fees.map(item => item.amount item.quantity)) deposit = sum(deposits.map(item => item.amount item.quantity)) additive_tax = sum(additive_taxes.map(tax => tax.amount)) total = subtotal + deposit + additive_tax

Τελευταία τροποποίηση November 3, 2026


Αναλάβετε τον έλεγχο των κρατήσεών σας. Δημιουργήστε τη δική σας επιχείρηση.

Γίνετε μέλος της κοινότητας των 1200+ ανεξάρτητων επιχειρήσεων ενοικίασης καταλυμάτων διακοπών που χρησιμοποιούν το Bookingmood για να αυξήσουν τις απευθείας κρατήσεις και να δημιουργήσουν ισχυρότερες σχέσεις με τους επισκέπτες.

Ξεκινήστε δωρεάν δοκιμή 14 ημερών