> ## 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.

# Step pricing

## Concepts

**Step pricing** is a model where the cost remains constant across specific usage ranges and then "jumps" to a higher flat fee once a threshold is crossed. Unlike per-unit or tiered models where every additional unit adds to the cost, step pricing treats usage as a series of flat-fee plateaus.

### The logic of dimensions

Step pricing is a **1-dimensional** model. It depends on one factor: **quantity ()**.

Think of this as **"The plateau."** Imagine you are renting a moving truck. Whether you drive 1 mile or 50 miles, the price is exactly $40. As soon as you hit 51 miles, the price jumps to $80 and stays there until you hit the next limit. Your cost doesn't climb a slope; it rests on a flat plateau until you are forced to step up to the next level.

### SaaS example: Cloud log storage

A monitoring platform offers storage in fixed "service tiers." Each tier provides a wide capacity range for a single fixed price.

| Storage range (*q*) | Flat fee (*c*) |
| ------------------- | -------------- |
| **0 – 500 gb**      | \$100.00       |
| **501 – 2,000 gb**  | \$300.00       |
| **2,001+ gb**       | \$600.00       |

**The "Plateau" calculation:**
Zenskar identifies which range the total quantity falls into and applies the corresponding flat fee. The individual units within that range do not have a per-unit cost.

| Input metric (*q*) | Pricing logic                    | Final bill (*P*) |
| ------------------ | -------------------------------- | ---------------- |
| **1,500 gb**       | Falls into tier 2 (501–2,000 gb) | **\$300.00**     |

***

## Get Started

### Create a step-priced product

1. **Navigate to the Library:** Go to **Contracts** > **Products**.
2. **Create a Standalone Product:** Click **+ CREATE NEW** and choose Standalone Product from the dropdown. The Create Standalone Product page will appear. Fill in the required details and click **Save & Proceed** at the bottom right.
3. **Open Price Details:** You will be redirected to the Price Details page. Click **+ Add Price** to configure pricing for the product.
4. **Select Step Pricing Model:** In the Pricing Model dropdown, select **Step Pricing**.
5. **Configure Tiers and Save:** Click **+ Add Tier** to create pricing brackets. Define the **from** and **to** ranges and enter the **price** for each tier. Continue adding tiers as needed. Once complete, click **Confirm**, then click **Done** on the Price Details page to finalize the setup.

## How-to: Add step pricing to a contract

### 1. Via Contracts

1. Open the target contract in **Contracts** > **Contracts**.
2. In the Summary tab, click **+ ADD PRODUCT V3**.
3. Search for and select your configured step pricing product.
4. Click **ADD PRODUCT**. You will be redirected to the Summary page. Click **Publish**.

### Via Customer

1. Open the target customer in **Customers**.
2. Go to Contracts and click **+ CREATE CONTRACT**.
3. In the Summary tab, click **+ ADD PRODUCT V3**.
4. Search for and select your configured step pricing product
5. Click **ADD PRODUCT**. You will be redirected to the Summary page. Click **Publish**.

***

## Reference

### Technical specifications

| Attribute              | Specification                                                                                                            |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| **Dimensionality**     | **1-dimensional (univariate)**                                                                                           |
| **Math formula**       | **P = cᵢ**                                                                                                               |
| **Logic type**         | **Step function**: The output value is constant within intervals and changes only at discrete thresholds.                |
| **Boundary behavior**  | **Lower-inclusive**: A value exactly at a threshold belongs to the plateau starting at that value.                       |
| **Calculation engine** | **Range mapping**: The engine resolves the total , identifies the corresponding range , and returns the fixed constant . |
| **Data object**        | `pricing_model_type: step_pricing`                                                                                       |

### Comparison of bracket-based models

| Feature           | Step pricing                                        | Tiered with flat fee                                              | Volume with flat fee                                               |
| ----------------- | --------------------------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------ |
| **The metaphor**  | **The plateau**                                     | **The toll road**                                                 | **The membership club**                                            |
| **Billing logic** | You pay the flat fee of the **current** range only. | You pay the **cumulative sum** of flat fees for all tiers passed. | You "level up" the **entire volume** to a single new fee and rate. |
| **Math formula**  | ***P = cᵢ***                                        | ***P = Σ (cᵢ + (rᵢ × qᵢ))***                                      | ***P = cᵢ + (rᵢ × q)***                                            |
| **Marginal cost** | **\$0** (until you hit the next threshold).         | **\$0 + unit rate** (depends on the tier's ).                     | **Unit rate** (applies to all units from 1 to ).                   |

### System architecture

In Zenskar, all pricing models are governed by a hierarchical relationship between entities:

* **Contract:** The legal agreement between you and your customer.
* **Phase:** A specific time-bound period (e.g., Q1, implementation phase) within that contract.
* **Product:** The actual service or software module being sold.
* **Pricing model:** The specific logic (step pricing) that defines how that product is billed.

**Entity hierarchy:**

```mermaid theme={null}
flowchart LR
    CONTRACT[Contract] ---|"has one or more"| PHASE[Phase]
    PHASE ---|"has one or more"| PRODUCT[Product]
    PRODUCT ---|"has exactly one active"| PRICINGMODEL[Pricing model]

style PRICINGMODEL fill:#90ee90

```

### Price resolution flow

The following flow describes how step pricing calculates the final price:

1. **Product library:** Defines the various usage ranges and their respective flat fees (***cᵢ***).
2. **Contract:** Links the product to a customer and defines the quantity source (***q***).
3. **Data source:** Provides the value of  from a meter or product field.
4. **Billing engine:** Locates the single plateau (***i***) where ***q*** resides and injects the constant fee ***cᵢ*** into the invoice.

***

<br />
