> ## Documentation Index
> Fetch the complete documentation index at: https://docs2.zenskar.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reference

## Contract fields

| Field           | Description                                                                                                        |
| --------------- | ------------------------------------------------------------------------------------------------------------------ |
| Customer        | The customer the contract belongs to                                                                               |
| Start date      | Required. When the contract begins                                                                                 |
| End date        | Optional. Leaving this blank creates an open-ended contract                                                        |
| Business entity | The entity the contract is billed under                                                                            |
| Custom metadata | Key-value pairs for internal tracking                                                                              |
| Timezone        | Determines when billing cycles start and end. *Not yet implemented* — defaults to the customer's or org's timezone |

## Line item configuration

| Feature             | What it means                                                                           | Example                                                | Status                |
| ------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------ | --------------------- |
| Price versions      | Different prices for different time periods                                             | $10/seat for Jan–Jun, $12/seat for Jul–Dec             | Available             |
| Billing schedule    | How often invoices are generated and whether payment is due upfront or at end of period | Bill quarterly, payment due at end of quarter          | Available             |
| Discounts           | Flat dollar amount off, percentage off, or free units included                          | \$100 off per month, or 1,000 free API calls per month | Available             |
| Minimum commitments | Guaranteed minimum the customer pays, or a minimum quantity, even if usage is low       | Minimum \$10,000 per quarter                           | Available             |
| Anchor dates        | Align billing cycles to specific dates instead of contract start                        | Bill on the last day of the month                      | Available             |
| Quantities          | How many units the customer gets                                                        | 25 seats, or tracked by usage meter                    | *Not yet implemented* |
| Optional items      | Line items that can be turned on or off during the contract                             | Premium support, billed only when activated            | *Not yet implemented* |

## Pricing models

| Model    | How it works                                                           | Example                                                                      |
| -------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| Per unit | Fixed price per unit                                                   | \$10 per seat per month                                                      |
| Tiered   | Different rates for different usage bands, each band priced separately | First 1,000 API calls at $0.10, next 4,000 at $0.08, above 5,000 at \$0.05   |
| Volume   | Total usage determines the rate; that rate applies to all units        | 3,000 API calls falling in the 1,001–5,000 band — all 3,000 billed at \$0.08 |

See the dedicated pricing model docs for detailed behavior, including discount and commitment interactions.

## Contract operations

| Operation         | Status  | Description                                                                                                      |
| ----------------- | ------- | ---------------------------------------------------------------------------------------------------------------- |
| Create contract   | Done    | Create for a customer with a start date and optional end date; auto-populate or pick products manually           |
| View contracts    | Done    | View a single contract, or browse and filter the full list                                                       |
| Update contract   | Done    | Edit a draft contract in a single save, with concurrent-edit protection                                          |
| Change quantities | Done    | Adjust recurring or on-demand quantities over time                                                               |
| Activate contract | Partial | Moves draft to active and auto-generates the first invoice; pre-activation completeness checks not yet available |
| Invoice preview   | Done    | Preview invoices for a saved contract or an unsaved draft                                                        |

## Contract list filters

Contracts can be filtered by: customer, status, name, currency, business entity, and date ranges.

## Validation rules

| Rule                                                             | Status      |
| ---------------------------------------------------------------- | ----------- |
| End date must be after start date                                | Done        |
| Contract must have at least one product                          | Done        |
| Customer and business entity are valid                           | Done        |
| Anchor dates don't conflict with each other                      | Done        |
| Line item dates fall within contract dates                       | In progress |
| Prices cover the full line item period with no gaps              | In progress |
| Billing schedule doesn't have conflicts                          | In progress |
| Quantity configuration is consistent                             | In progress |
| Discount dates and ordering are valid                            | To do       |
| Commitment dates are valid                                       | To do       |
| Quantity entries form a complete timeline (for recurring)        | To do       |
| Activation periods cover the full line item (for optional items) | To do       |
| All referenced products and prices exist                         | To do       |

## Invoice correction handling

| Correction on an approved invoice        | Available options                                                                                                          | Default                     |
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
| Positive arrear (customer under-charged) | Separate back-dated invoice for the period, or redate forward onto the next invoice                                        | Separate back-dated invoice |
| Negative amount (customer over-charged)  | Carry forward across upcoming invoices, or a standalone credit note against the original invoice *(credit note: upcoming)* | Carry forward               |

## Minimum commitment evaluation modes

| Mode                       | Behavior                                                                                                                                     |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| Greedy (per-period)        | Each billing period must independently hit its share of the commitment; shortfalls are charged every period until the full commitment is met |
| Cumulative (running total) | The commitment tracks across the full window; a heavy period banks credit toward future ones                                                 |

## Not yet available

* Contract-level discounts and minimum commitments (currently line-item level only)
* Custom attributes and tags on contracts
* Contract-level settings: billing address, shipping address, invoice template, payment method
* Contract amendment history
* Lifecycle states: trial periods, eternal/forever contracts, expiry, pause/suspend, auto-renewal
* Parent–child or third-party billing
* Bulk contract export
* *(Placeholder: confirm current status of any items above before publishing externally.)*
