Issue : Creating Invoice with deposit option activated with createinvoice()

Hello Wix Velo Community,

I am working on a project where I need to create invoices with a 25% deposit of the total using Wix Velo. Here is my current code:

let createInvoiceFields = {
    "status": "PartialAndOverdue",
    "title": title,
    "customer": customer,
    "currency": "EUR",
    "lineItems": lineItems,
    "metadata": metadata,
    "dates": dates,
    "totals": {
        "subtotal": totalLineItems, // Initial total amount
        "total": depositAmount       // 25% of the total amount
    }
};

Unfortunately, this is not working as expected. I am struggling to make the invoice reflect the 25% deposit correctly. Do you have any suggestions or corrections to my approach? Any advice or example code would be greatly appreciated.

Thank you in advance for your help!

Does someone has an idea?