> For the complete documentation index, see [llms.txt](https://help.supplyd.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.supplyd.co/supplyd-erp/products/understanding-product-costing-and-margins.md).

# Understanding Product Costing & Margins

If your margins don’t match what you expect, it’s usually due to how costs are calculated in Supply’d. This article explains how costing works and why margins can vary.

{% hint style="success" %}
**Costings** refer to the actual cost of a product or item, including what it costs to purchase or produce it. In Supply’d, this cost is based on inventory batches, meaning it can vary depending on when and how the stock was acquired.

**Margins** refer to the difference between the sale price and the cost of the product. It shows how much profit is made on each sale after the actual cost has been deducted.
{% endhint %}

***

#### Buy Price vs Actual Cost

The **Buy Price** is recorded when you purchase a product, but it is not always the cost used to calculate margins.

Supply’d uses **Inventory Batches** to determine the actual cost of goods.

{% hint style="success" %}
If a product has more than one supplier, the margins shown on its details page will depend on whether a preferred supplier has been set. The costing displayed is based on the preferred supplier assigned to that product, so margin calculations will reflect that supplier’s pricing.

👉 See the [Adding Products](/supplyd-erp/products/adding-products.md#sell-product) section of the [Adding Products](/supplyd-erp/products/adding-products.md) document.
{% endhint %}

<figure><img src="/files/wAUMhlTEeBQtzTB5T1x8" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/BRv9SSdYDjMeq4swcHFP" alt="" width="563"><figcaption></figcaption></figure>

***

#### What Are Inventory Batches?

A **batch** is a specific quantity of a product that is produced or received together at the same time, or have the same expiry date.&#x20;

Each time stock is received, it is stored as a separate batch. Each batch can have its own:

* Purchase price
* Supplier
* Date received
* Quantity

This means the same product can have multiple costs at the same time.

<figure><img src="/files/A1VrEK2VuVEpMIEF5Xzy" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="success" %}
Batches are the backbone of Supply’d inventory and are used to group products that share the same production or delivery history. Each batch is tracked separately and contains key information such as cost of goods, batch codes, production dates, expiry dates, quality control checks, temperature checks, and other relevant details. Every batch has its own inventory level, which increases when stock is received and decreases when stock is sold or used, based on matching batch details. This structure allows you to accurately trace production, manage expiry dates, monitor stock levels, and handle recalls or quality issues when needed.
{% endhint %}

***

#### How Costs Are Applied

When a product is sold or used in production, Supply’d:

1. Selects stock from a specific batch or batches.
2. Applies those batches' costs to the transaction.

This is typically based on FIFO (First In, First Out), depending on your setup.

<figure><img src="/files/XELiONSpnWRN1VQTU7zN" alt="" width="563"><figcaption></figcaption></figure>

***

#### Why Margins Change

Margins can vary because different batches of the same product may have different costs.

* The same product can have different costs over time.
* Margins will vary depending on which batch is used.

<figure><img src="/files/MTztmyUUbylMxJywg3RL" alt=""><figcaption></figcaption></figure>

***

#### Simple Example

You purchase:

* 100 units at $10 (Batch 1)
* 100 units at $12 (Batch 2)

You sell 150 units at $20.

**Result:**

* First 100 units use $10 cost → higher margin (50%)
* Next 50 units use $12 cost → lower margin (40%)

Even though the sale price is the same, the margin changes.

***

#### How It Works (Flow)

<figure><img src="/files/y6nSZfIyuLVzLJ8TFRl6" alt=""><figcaption></figcaption></figure>

***

#### Key Points

* Buy Price is a guide, not the final cost used.
* Costs come from inventory batches.
* Different batches can have different costs.
* Margins will vary based on batch usage.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.supplyd.co/supplyd-erp/products/understanding-product-costing-and-margins.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
