---
title: Markdown Module Dataset
slug: markdown-module-dataset
createdAt: 2026-03-18T16:36:31.768Z
---

Markdown Module allows to plan and execute price reductions with respect to the stock levels, set timeframe, and expected demand. There are two different processes for the optimal discount calculation that require slightly different data inputs:

1. **Short-term Expiration Markdown**
   - A specialized option for near-real-time calculation of optimal discounts for fresh assortment with short shelf life. To work optimally it needs stock data per Batch = how many items are in stock for each sell by date.
2. **Long-term Markdown**
   - A more general option for other types of markdowns (clearances) – seasonal, end-of-life, overstock. This process works with total stock regardless of batches.



## Stores table extension

The standard stores file shall be extended with two additional columns specifying the warehouses assigned to each store.

The markdown discount is calculated for each warehouse. For physical stores the best results can be achieved if it is calculated for each store individually based on the local stock level. In that case each store should be also its own warehouse (1 to 1 relationship, same name and id can be used too).

| **Column**      | **Data Type** | **Description**       |
| --------------- | ------------- | --------------------- |
| warehouse\_id   | string        | Warehouse identifier  |
| warehouse\_name | string        | Name of the warehouse |

::File{src="https://api.archbee.com/api/presign/xX31HJQLjJcLNeK2EhfOl/xpm45nqNOqsV0UUQ0iNjv-20260323-150815.csv" label="stores_extended.csv"}



## Stock levels per Batch

This table contains information about remaining stock per product, warehouse, and batch. Needed for expiration markdowns. Not needed for other markdown types.

:::hint{type="info"}
Primary keys of the tables are highlighted in **bold**.
:::

| **Column**        | **Data type** | **Description**      |
| ----------------- | ------------- | -------------------- |
| **product\_id**   | string        | Product identifier   |
| **warehouse\_id** | string        | Warehouse identifier |
| **batch\_id**     | string        | Batch identifier     |
| expiration\_date  | date          | Expiration date      |
| quantity          | decimal(2)    | Latest stock level   |

::File{src="https://api.archbee.com/api/presign/xX31HJQLjJcLNeK2EhfOl/tEk2StBjGS6PgQeHUPGGy-20260323-150815.csv" label="batches.csv"}

:::hint{type="warning"}
**Data Checks**

Quantity must not be negative.

The expiration date must be in the future.
:::



## Stock levels

This table contains information about remaining stock per product and warehouse.

:::hint{type="info"}
Primary keys of the tables are highlighted in **bold**.
:::

| **Column**        | **Data type**       | **Description**                                       |
| ----------------- | ------------------- | ----------------------------------------------------- |
| **product\_id**   | string              | Product identifier                                    |
| **warehouse\_id** | string              | Warehouse identifier                                  |
| valid\_at         | datetime (ISO 8601) | Date and time as of which the stock data was recorded |
| quantity          | decimal(2)          | Stock level                                           |

**Optional Columns**

| **Column**           | **Data type**      | **Description**                                                                                                                                                                                         |
| -------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| stock\_detail        | string             | Optional text information that shows in the application with the stock level (e.g. ordering status)                                                                                                     |
| availability\_factor | decimal, 0.00-1.00 | Optional factor indicative of lower expected demand, for example when the product will be available to fewer customers than normally (0.5 = algorithm should expect initially only half of usual sales) |

:::hint{type="warning"}
**Data Checks**

Quantity must not be negative.

Valid\_at must not be in the future.

Availability\_factor must be between 0 and 1, if provided.
:::



## Product Shelf Life

For expiration markdowns only. Defines rules for when expiration markdown must be initiated per each product.

| **Column**      | **Data Type** | **Description**                                                                                                                                                                                                |
| --------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **product\_id** | string        | Product identifier                                                                                                                                                                                             |
| day\_sale\_rule | integer       | The minimum number of days before expiration when markdown should be initiated (in days).<br />If the field is left blank, the system will automatically determine the start date for the expiration markdown. |
| shelf\_life     | integer       | Typical shelf life of the product (in days).                                                                                                                                                                   |

::File{src="https://api.archbee.com/api/presign/xX31HJQLjJcLNeK2EhfOl/g_jVa_DqFbbh-zQoRyJ2Q-20260323-150815.csv" label="product_expiration.csv"}

:::hint{type="warning"}
**Data Checks**

day\_sale\_rule and shelf\_life must be greater than 0.

shelf\_life must always be greater than day\_sale\_rule.
:::

**Other Options for Export**

Add the columns day\_sale\_rule and shelf\_life as new columns in the products table.



## Sales Extension

Optional for expiration markdowns only. The standard sales file shall be extended with one additional column to indicate the product batch. Typically not available in case of physical store transactions.

| **Column** | **Data Type** | **Description**  |
| ---------- | ------------- | ---------------- |
| batch\_id  | string        | Batch identifier |



## Write-Offs

Optional dataset, not needed for demand modelling or markdown price calculation. Used only for custom reporting.

- **Historical data** – One-time export of the write-offs history (1-2 years) into a single file named write-offs-history.csv.
- **Daily incremental data** – Export write-offs for the last X days (minimum 1, maximum 30) into the file writeoffs.csv.

| **Column**        | **Data Type** | **Description**                        |
| ----------------- | ------------- | -------------------------------------- |
| **product\_id**   | string        | Product identifier                     |
| **warehouse\_id** | string        | Warehouse identifier                   |
| date              | date          | Date when the product was written-off. |
| quantity          | decimal(2)    | Quantity of written-off product.       |

**Optional Columns**

| **Column** | **Data Type** | **Description**                                                |
| ---------- | ------------- | -------------------------------------------------------------- |
| reason     | string        | Reason for write-offs (e.g., expired products, damaged goods). |

::File{src="https://api.archbee.com/api/presign/xX31HJQLjJcLNeK2EhfOl/twty3y26FGXEtDppt75wX-20260323-150815.csv" label="writeoffs.csv"}

:::hint{type="warning"}
**Data Checks**

Quantity must not be negative.

The date must be in the past.
:::

