Can I code the deposit recalculating as percent of total price on checkout? and as a bike hire business is there a way to add a select number of days hire option

Question:
Can I code the deposit recalculating as percent of total price on checkout? and as a bike hire business is there a way to add a select number of days hire option

Product:
Wix Editor
What are you trying to achieve:
we ask our customers to pay a 50% deposit of the total cost of their booking, currently there isn’t an option to do this? is this possible? Also as a bike hire business I would like the customers to be able to select the number of days hire they require and then add the extras they can have, at the moment I have had to list the hire days as sessions then add the extras in the booking

What have you already tried:
there is not an option to select the number of days hire required

Additional information:

Hi @Loz_Braiden ,

Yes, you can configure a deposit. For that you need to use the pricing SPI.

Here is a code example for the calculatePrice function:

export const calculatePrice = async (options, context) => {
    const booking = options.booking
    // YOUR WIX BOOKINGS PRICING LOGIC HERE
    return {
        calculatedPrice: 100,
        deposit: 50
    };
};