> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Standalone Invoice Calculations

## Article: Standalone Invoice Calculations

## Article Link: https://dev.wix.com/docs/api-reference/business-management/get-paid/invoices/standalone-invoice-calculations.md

## Article Content:

# Invoice Calculations

Invoices support deposit payments and automatic total calculations based on line items, taxes, and shipping.

## Deposits

You can configure a deposit to collect a partial upfront payment. Set the deposit as a fixed amount or a percentage of the invoice total. When a customer opens the payment checkout, the initial payment amount shown is limited to the deposit. Subsequent payments cover the remaining balance.

## Total fields

The `totals` object is populated at invoice creation and updated throughout the invoice lifecycle.

| Total field  | When populated         | Dependencies                                     | Notes                                                     |
|--------------|------------------------|--------------------------------------------------|-----------------------------------------------------------|
| `total`      | At creation.           | `subtotal` - `discount` + `tax` + `shipping`.   | Represents the final amount due.                          |
| `subtotal`   | At creation.           | Sum of all `lineItems`.                          | Populated even if no taxes or discounts are applied.      |
| `discount`   | When discounts apply.  | Line item or invoice-level discounts.            | Can be empty if no discounts are provided.                |
| `shipping`   | When shipping or shipment is used. | `shippingInfo.address` or `shipmentInfo.logistics.pickupDetails.address`.      | If `shipmentInfo.logistics.pickupDetails.address` isn't provided, the `shippingInfo.address` is used. |
| `exempt`     | When taxes apply.      | Tax-exempt amounts from line items and shipping. | Can be empty if no tax exemptions apply.                  |
| `tax`        | When taxes apply.      | Regional settings, business location.            | Can be empty if no taxes apply to line items or shipping. |
| `paidAmount` | After each payment.    | Confirmed payments from eCommerce.               | Updated asynchronously via order payment changes.         |
| `balance`    | After each payment.    | `total` - `paidAmount`.                          | Represents the outstanding amount.                        |