> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - 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.                        |