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

# 4.3: Multiple Batch Types for Different Stages

> Create input, production, and output batch types that feed into corresponding ledgers to track material across your project's stages.

<Panel>
  <Card title="Accounting Academy" className="accounting-academy-card">
    <div className="accounting-academy-content">
      <Steps className="my-0">
        <Step title="MODULE 1: Fundamentals" icon="bookmark" iconType="solid" stepNumber={1} titleSize="p">
          * [1.1: Core Concepts & the Data Lifecycle](/accounting-academy/module-1/1-1-core-concepts-data-lifecycle)
          * [1.2: Translating Methodologies to Mangrove](/accounting-academy/module-1/1-2-translating-methodologies-to-mangrove)
          * [1.3: Events and Datapoints](/accounting-academy/module-1/1-3-events-and-datapoints)
          * [Exercise: Design and Build](/accounting-academy/module-1/1-exercise-design-and-build)
        </Step>

        <Step title="MODULE 2: Calculations" icon="bookmark" iconType="solid" stepNumber={2} titleSize="p">
          * [2.1: Calculation Architecture](/accounting-academy/module-2/2-1-calculation-architecture)
          * [2.2: Expanding Your Data Model](/accounting-academy/module-2/2-2-expanding-your-data-model)
          * [Exercise: Multi-Step Calculations](/accounting-academy/module-2/2-exercise-multi-step-calculations)
        </Step>

        <Step title="MODULE 3: Batch Partitioning & LCA" icon="bookmark" iconType="solid" stepNumber={3} titleSize="p">
          * [3.1: What Is a Batch?](/accounting-academy/module-3/3-1-what-is-a-batch)
          * [3.2: Batch Partitioning Strategies](/accounting-academy/module-3/3-2-batch-partitioning)
          * [3.3: Life Cycle Assessment & Emissions](/accounting-academy/module-3/3-3-lca-and-emissions)
          * [3.4: Allocating Emissions to Batches](/accounting-academy/module-3/3-4-allocating-emissions-to-batches)
          * [Exercise: Batch Partitioning & LCA](/accounting-academy/module-3/3-exercise-batch-partitioning-and-lca)
        </Step>

        <Step title="MODULE 4: Mass Balance with Ledgers" icon="bookmark" iconType="solid" stepNumber={4} titleSize="p">
          * [4.1: Introduction to Mass Balance](/accounting-academy/module-4/4-1-intro-to-mass-balance)
          * [4.2: Designing the Ledger Structure](/accounting-academy/module-4/4-2-designing-the-ledger-structure)
          * [4.3: Multiple Batch Types for Different Stages](/accounting-academy/module-4/4-3-multiple-batch-types)
          * [Exercise: Design & Build Mass Balance](/accounting-academy/module-4/4-exercise-design-and-build-mass-balance)
        </Step>

        <Step title="MODULE 5: Integration Testing" icon="bookmark" iconType="solid" stepNumber={5} titleSize="p">
          * [5.1: The Complete Model Assembly](/accounting-academy/module-5/5-1-the-complete-model-assembly)
          * [5.2: Testing Patterns](/accounting-academy/module-5/5-2-testing-patterns)
          * [5.3: Common Integration Pitfalls](/accounting-academy/module-5/5-3-common-integration-pitfalls)
          * [Exercise: Integration Testing](/accounting-academy/module-5/5-exercise-integration-testing)
        </Step>

        <Step title="MODULE 6: Advanced Patterns & Production" icon="bookmark" iconType="solid" stepNumber={6} titleSize="p">
          * [6.1: Model Design Best Practices](/accounting-academy/module-6/6-1-model-design-best-practices)
          * [6.2: Advanced Techniques](/accounting-academy/module-6/6-2-advanced-techniques)
          * [6.3: Production Readiness](/accounting-academy/module-6/6-3-production-readiness)
          * [Exercise: Production Deployment](/accounting-academy/module-6/6-exercise-production-deployment)
        </Step>
      </Steps>
    </div>
  </Card>
</Panel>

<Check>
  **What you'll learn in this lesson:**

  * Understand the three categories of batch types: input, production, and output
  * Map each batch type to its corresponding ledger
  * Configure multiple batch types in Mangrove
  * See how batch types work together to create end-to-end traceability
</Check>

In Module 3, you worked with a single batch type — typically a delivery batch that credited one ledger. Now that you're tracking material across multiple stages with multiple ledgers, you need **different batch types** for each stage.

## The three batch type categories

Each stage in your process has its own batch type. These fall into three categories:

| Category               | Purpose                                        | Example (Biochar)                                   | Example (RNG)                                        |
| ---------------------- | ---------------------------------------------- | --------------------------------------------------- | ---------------------------------------------------- |
| **Input batches**      | Record what comes into the system              | Feedstock Receipt (dry tonnes of biomass received)  | Feedstock Intake (lbs of organic waste received)     |
| **Production batches** | Record what's created through processing       | Biochar Produced (tonnes of biochar from pyrolysis) | RNG Injected (MMBtu of gas injected into pipeline)   |
| **Output batches**     | Record what leaves the system as final product | Carbon Delivered (tCO2e of sequestered carbon)      | RNG Transmitted (MMBtu of gas delivered to end-user) |

<Note>
  Not every project needs all three categories. A project with two ledgers might only need input and output batch types. The number of batch types should match the number of ledgers — each batch type feeds exactly one ledger.
</Note>

## How batch types map to ledgers

Each batch type **credits** exactly one ledger. When a batch is created, it adds to that ledger's balance. Material then flows to the next ledger through **allocations**.

```mermaid theme={null}
flowchart LR
    subgraph Stage1["Stage 1"]
        BT1["Feedstock Receipt<br/>(batch type)"] --> L1["Feedstock Inventory<br/>(ledger)"]
    end

    subgraph Stage2["Stage 2"]
        BT2["Biochar Produced<br/>(batch type)"] --> L2["Biochar Production<br/>(ledger)"]
    end

    subgraph Stage3["Stage 3"]
        BT3["Carbon Delivered<br/>(batch type)"] --> L3["Carbon Delivered<br/>(ledger)"]
    end

    L1 -->|"Allocation<br/>(conversion factor)"| L2
    L2 -->|"Allocation<br/>(carbon content)"| L3

    style BT1 fill:#42a5f5,stroke:#1976d2,stroke-width:2px,color:#000
    style BT2 fill:#ffa726,stroke:#f57c00,stroke-width:2px,color:#000
    style BT3 fill:#66bb6a,stroke:#388e3c,stroke-width:2px,color:#000
    style L1 fill:#e1f5ff,stroke:#0066cc,stroke-width:2px
    style L2 fill:#fff4e1,stroke:#cc8800,stroke-width:2px
    style L3 fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px
```

The key relationship: **batch type → credits ledger → allocation → next ledger**. This chain creates the mass balance tracking from input to output.

## Configuring multiple batch types in Mangrove

To set up multiple batch types, go to the <a href="/production-accounting/fundamentals" target="_blank" rel="noopener noreferrer">Production Accounting</a>

section of your project and create a batch type for each stage.

For each batch type, you'll configure:

<Steps>
  <Step title="Name and description">
    Give the batch type a clear name that identifies the stage (e.g., "Feedstock Receipt", "Biochar Produced", "Carbon Delivered").
  </Step>

  <Step title="Target ledger">
    Select which ledger this batch type credits. Each batch type feeds exactly one ledger.
  </Step>

  <Step title="Partition strategy">
    Choose how batches are created — per-event (each delivery = one batch), time-based (daily, monthly), or manual. This is the same partitioning you configured in Module 3.
  </Step>

  <Step title="Output datapoints">
    Define what each batch calculates. Input batches might track mass received; output batches might track tCO2e delivered.
  </Step>

  <Step title="Source event types">
    Link the batch type to the event types that provide its data. Feedstock Receipt batches pull from feedstock delivery events; Production batches pull from production run events.
  </Step>
</Steps>

## Example: Mangrove Biochar multi-stage batch types

Here's what the three batch types look like for the Mangrove Biochar project:

<Tabs>
  <Tab title="Feedstock Receipt">
    **Credits:** Feedstock Inventory ledger (dry tonnes)

    | Field              | Value                                    |
    | ------------------ | ---------------------------------------- |
    | **Partition**      | Per-delivery (each shipment = one batch) |
    | **Tracking ID**    | Supplier delivery ticket number          |
    | **Primary output** | Dry mass received (tonnes)               |
    | **Source events**  | Feedstock Delivery events                |

    Each feedstock delivery creates a batch that adds to the Feedstock Inventory ledger.
  </Tab>

  <Tab title="Biochar Produced">
    **Credits:** Biochar Production ledger (biochar tonnes)

    | Field              | Value                          |
    | ------------------ | ------------------------------ |
    | **Partition**      | Per production run             |
    | **Tracking ID**    | Production run ID              |
    | **Primary output** | Biochar mass produced (tonnes) |
    | **Source events**  | Production Run events          |

    Each production run creates a batch that adds to the Biochar Production ledger. The feedstock consumed is debited from Ledger 1 through allocation.
  </Tab>

  <Tab title="Carbon Delivered">
    **Credits:** Carbon Delivered ledger (tCO2e)

    | Field              | Value                                            |
    | ------------------ | ------------------------------------------------ |
    | **Partition**      | Per-delivery (each application trip = one batch) |
    | **Tracking ID**    | Delivery ticket number                           |
    | **Primary output** | Net tCO2e sequestered                            |
    | **Source events**  | Biochar Delivery events                          |

    Each delivery creates a batch that adds to the Carbon Delivered ledger. The biochar consumed is debited from Ledger 2 through allocation.
  </Tab>
</Tabs>

## End-to-end traceability

With multiple batch types feeding multiple ledgers, you get full traceability from input to output:

```mermaid theme={null}
flowchart TB
    FD["Feedstock Delivery Event<br/>(5 dry tonnes biomass)"] --> FR["Feedstock Receipt Batch<br/>+5 dry tonnes to Ledger 1"]
    FR -->|"Allocation"| BP["Biochar Produced Batch<br/>+1.5 biochar tonnes to Ledger 2"]
    BP -->|"Allocation"| CD["Carbon Delivered Batch<br/>+4.2 tCO2e to Ledger 3"]
    CD -->|"Report"| R["Verification Report<br/>(4.2 tCO2e claimed)"]

    style FD fill:#78909c,stroke:#455a64,stroke-width:2px,color:#000
    style FR fill:#42a5f5,stroke:#1976d2,stroke-width:2px,color:#000
    style BP fill:#ffa726,stroke:#f57c00,stroke-width:2px,color:#000
    style CD fill:#66bb6a,stroke:#388e3c,stroke-width:2px,color:#000
    style R fill:#ab47bc,stroke:#7b1fa2,stroke-width:2px,color:#000
```

A verifier can trace any credit claim back through the chain: **Report → Carbon Delivered batch → Biochar Produced batch → Feedstock Receipt batch → source event data**. At every step, the ledger balances confirm that outputs don't exceed inputs.

***

### Check your understanding

<Accordion icon="circle-question" title="How many ledgers does each batch type credit?">
  Each batch type credits **exactly one ledger**. This is a 1:1 relationship — a Feedstock Receipt batch type credits the Feedstock Inventory ledger, a Production batch type credits the Production ledger, and so on.
</Accordion>

<Accordion icon="circle-question" title="What creates the traceability chain from input to output?">
  The chain is: **batch type → credits ledger → allocation → next ledger**. Each batch type creates batches that credit one ledger, and allocations move material between ledgers. A verifier can trace any output claim back through this chain to the original source events.
</Accordion>

***

You're now ready to put it all together. Head to the [Module 4 Exercise: Design & Build Mass Balance with Ledgers](/accounting-academy/module-4/4-exercise-design-and-build-mass-balance) to build a multi-ledger project in Mangrove.
