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

# Order Line

> Understand Order Lines: the immutable, executable units of commercial obligation that drive billing and contract mutation.

An Order Line is the executable unit of commercial obligation within an Order. It represents a single product at a specific quantity and finalized price within an [Order Phase](/get-started/orders/order-phase). Order Lines are the result of promoting [Quote Lines](/get-started/calculator/quote-line) -- they contain the same data but in a form that is no longer dynamic or recalculable.

When the pricing engine runs during quoting, it produces calculated values (list price, system adjustments, discounts, net price). At promotion, those calculated values are materialized into immutable fields on the Order Line. The Order Line does not reference the pricing engine, the price book, or any rules. It is a self-contained record of what was committed.

***

## What an Order Line contains

| Field                            | Description                                                                                                                             |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **Product**                      | The SKU from the price book. Identifies what was sold.                                                                                  |
| **Final quantity**               | The committed number of units (or driver value). No longer editable.                                                                    |
| **Final net price**              | The price after all adjustments and discounts. Authoritative for billing and revenue.                                                   |
| **Discount amount**              | The total discount applied, preserved for audit and reporting.                                                                          |
| **Billing frequency**            | How this line is billed: monthly, quarterly, annual, or one-time.                                                                       |
| **Service period**               | Start and end dates, inherited from the parent Order Phase.                                                                             |
| **Revenue categorization**       | Classification for revenue recognition (new, expansion, renewal, etc.).                                                                 |
| **Contract impact instructions** | How this line should affect the Contract at activation: create a new Contract Line, modify an existing one, or replace an expiring one. |
| **Parent Order Phase**           | The Phase this line belongs to.                                                                                                         |

***

## How Order Lines are created

Order Lines are produced during [promotion](/get-started/calculator/quote-options#from-quote-to-order-promotion). Each Quote Line is transformed into an Order Line through a process that materializes the final commercial values:

| Quote Line                     | → | Order Line                  |
| ------------------------------ | - | --------------------------- |
| Calculated net price (dynamic) | → | Final net price (immutable) |
| Calculated quantity            | → | Final quantity              |
| Applied discount %             | → | Discount amount             |
| Billing frequency              | → | Billing frequency           |
| Phase association              | → | Order Phase association     |
| Product reference              | → | Product reference           |

The transformation is not a simple copy. The Quote Line's pricing depends on the pricing engine -- tier lookups, rule adjustments, data sheet references, and formula evaluations. The Order Line contains the resolved output of all that logic, flattened into fixed values.

After promotion, the Order Line is the authoritative record. If the price book is updated, if pricing rules change, if data sheets are modified -- none of it affects existing Order Lines.

***

## Immutability

Order Lines are designed to be immutable once the Order is activated. This is a deliberate architectural choice that preserves financial integrity:

* **Billing systems** operate on the Order Line's final net price. If that price could change retroactively, invoices would be unreliable.
* **Revenue recognition** depends on stable, committed values. Mutable Order Lines would make rev rec impossible to audit.
* **Contract state** is derived from Order Lines. If Order Lines could change, the Contract would be indeterminate.

The only way to change a commercial commitment after an Order is activated is through a new Order -- an [amendment](/get-started/contract-management/overview#amendment), [renewal](/get-started/contract-management/overview#renewal), or [cancellation](/get-started/orders/overview#commercial-classifications). This ensures a complete, auditable trail of every change.

***

## Order Lines and Contract Lines

When an Order is [activated](/get-started/orders/overview#order-creation-vs-activation), each Order Line produces a **Contract Line** on the associated Contract. The behavior depends on the Order's commercial classification and the contract impact instructions on the line:

**New Business.** The Order Line creates a new Contract Line defining the initial entitlement: active quantity, contracted price, service boundaries, billing cadence.

**Amendment -- add product.** The Order Line creates a new Contract Line for a product that wasn't on the Contract before.

**Amendment -- modify existing.** The Order Line adjusts an existing Contract Line: increasing quantity, changing the price prospectively, or extending the service period. The [contracted price](/get-started/contract-management/overview#contracted-price-preservation) from the prior commitment is preserved as the baseline.

**Renewal.** The Order Line replaces an expiring Contract Line with a new one that may have updated pricing, quantity, or terms.

```text theme={null}
OrderLine (activated)
    ↓
ContractLine (created or modified)
    ↓
Entitlement state updated
```

***

## Order Lines and billing

If [Stripe](/get-started/quickstart/connect-your-stripe-account) is connected, activated Order Lines drive billing orchestration:

* **Recurring lines** generate invoices according to their billing frequency (monthly, quarterly, annual).
* **One-time lines** generate a single invoice at activation.
* **Transactional lines** (flagged as transactional on the product) are billed in arrears based on actual usage.

The Order Line's final net price is what appears on the invoice. Stripe receives the committed values directly -- there is no recalculation at billing time.

***

## Custom fields

Like other Veles objects, Order Lines can carry custom field values. Custom fields defined on [Quote Lines](/get-started/calculator/quote-line) propagate to Order Lines at promotion, and from Order Lines to Contract Lines at activation.

This means deal-specific metadata (implementation priority, customer configuration notes, cost basis) flows through the entire lifecycle without manual re-entry.

***

## What's next

<CardGroup cols={2}>
  <Card title="Order Phases" icon="clock" href="/get-started/orders/order-phase">
    The commitment intervals that Order Lines belong to.
  </Card>

  <Card title="Order Overview" icon="file-lines" href="/get-started/orders/overview">
    The full Order object: classifications, activation, and creation.
  </Card>

  <Card title="Contract Management" icon="file-contract" href="/get-started/contract-management/overview">
    How Order Lines create and mutate Contract Lines.
  </Card>

  <Card title="Quote Lines" icon="calculator" href="/get-started/calculator/quote-line">
    The simulation-layer lines that Order Lines are promoted from.
  </Card>
</CardGroup>
