CSV Upload
Use CSV Upload to import POS sales data from a CSV file and convert it into inventory movements. CSV Upload is useful when you do not use a direct POS integration or when sales data comes from another system as an export file. The CSV upload can:- Read sales data from a CSV file
- Extract POS item codes from selected columns
- Read quantities from a quantity column
- Read dates from a date column
- Match POS codes to POS mappings
- Explode recipe mappings into ingredients
- Create inventory ledger entries
How it works
Mathership reads the uploaded CSV file row by row. For each row, Mathership applies the configured CSV rules and extracts sold POS items. The basic flow is:- Create a CSV integration
- Configure CSV rules
- Create POS mappings
- Upload a CSV file
- Mathership reads the file
- Sold POS items are matched to mappings
- Ingredient deductions are created in the inventory ledger
Before you start
Make sure you already have:- A company in Mathership
- Ingredients created in Mathership
- Recipes created if you want to map POS items to recipes
- Storage units created
- POS mappings configured
- A CSV file with sales data
Create a CSV integration
CSV upload uses a POS integration with the integration typeCSV.
To create it:
- Go to Manage → Integrations
- Select CSV Upload
- Create a new CSV integration
- Configure the data schema rules
- Save the integration
CSV rules
CSV rules define which columns Mathership should read from the uploaded file. The supported rule type is:
A rule can use:
Example CSV file
A simple CSV file could look like this:
In this example:
pos_codeis the source columnqtyis the quantity columndateis the date column
Example rule
Example rule configuration:
With this rule, Mathership reads each POS code from the
pos_code column.
Multiple POS codes in one cell
If one CSV cell contains multiple POS codes, use a delimiter. Example CSV:
Example rule:
Mathership splits the value and processes both POS codes.
Quantity handling
If a quantity column is configured, Mathership uses the value from that column. If no quantity column is configured, Mathership uses1 as the default quantity.
Example:
Date handling
If a date column is configured, Mathership uses that date for the inventory movement. If no date column is configured, Mathership uses the current date and time. The date should be readable as an ISO-style date or datetime, for example:POS mappings
Before uploading sales data, create POS mappings. A POS mapping connects a POS item code or name to a Mathership ingredient or recipe. Examples:
Without mappings, Mathership cannot convert POS sales into inventory deductions.
Ingredient mapping
Use ingredient mapping when a POS item should deduct one ingredient directly. Example:Recipe mapping
Use recipe mapping when a POS item consists of multiple ingredients. Example:
When the CSV file contains
BURGER_CLASSIC, Mathership explodes the recipe and deducts all recipe ingredients.
Upload a CSV file
To upload a file:- Open Manage → Integrations
- Open the CSV integration
- Choose the CSV file
- Start the upload
- Review the result
What happens during upload
When a CSV file is uploaded, Mathership:- Reads the CSV file
- Applies the configured rules to each row
- Extracts POS codes, quantities, and dates
- Matches POS codes to POS mappings
- Explodes recipe mappings into ingredients
- Calculates ingredient quantities
- Creates inventory ledger entries
- Updates the integration’s last run time
- Returns a processing summary
Upload result
A successful upload returns a summary of created inventory deductions. The result can include:- Ingredient name
- Deducted quantity
- Storage unit
- Date of the inventory movement
Inventory ledger entries
CSV uploads create inventory ledger entries with transaction typeISSUE.
That means the uploaded sales reduce inventory.
Each created entry includes:
- Company
- Ingredient
- Storage unit
- Transaction type
- Quantity
- Unit cost
- Value
- Date
Storage unit selection
For CSV uploads, Mathership determines the storage unit from the mapped ingredient or recipe logic. The system tries to resolve a storage unit from:- The recipe line issue storage
- The ingredient preferred issue storage
- The recipe default issue storage
- A storage unit with available stock
- The first available storage unit as fallback
Common setup order
Use this order for a clean CSV setup:- Create storage units
- Create ingredients
- Create recipes if needed
- Create the CSV integration
- Configure CSV rules
- Create POS mappings
- Upload a small test CSV
- Check the inventory ledger
- Upload the full CSV file
Test with a small file first
Before uploading a large export, test with a small CSV file. Use only a few rows, for example:
After upload, check whether:
- The upload completed successfully
- The correct ingredients were deducted
- The quantities are correct
- The correct storage units were used
- The ledger entries have the correct date
Common errors
File not provided
This happens when no CSV file was attached. Upload a CSV file and try again.CSV integration not found
This happens when the selected integration does not exist or is not a CSV integration. Check that:- The integration exists
- The integration belongs to the selected company
- The integration type is
CSV
Processing exceptions
This happens when Mathership finds problems during processing. Common causes are:- POS code has no mapping
- Recipe has a cycle
- Storage unit cannot be resolved
- Ingredient no longer exists
- Recipe line is incomplete
Unmapped POS code
This means the CSV file contains a POS code that has no POS mapping. Example:Wrong quantity
Check:- The quantity column in the CSV
- The configured quantity source column
- The POS mapping quantity
- The recipe line quantities
- The base unit of the ingredient
Wrong date
Check:- The date column in the CSV
- The configured date source column
- Whether the date format can be read correctly
Best practices
- Use stable POS codes instead of product names if possible
- Keep CSV headers consistent
- Avoid changing column names after setup
- Test with a small file first
- Map high-volume POS items first
- Use recipes for prepared dishes
- Use direct ingredient mappings for simple items
- Review the inventory ledger after every first upload
- Keep a copy of uploaded CSV files for traceability
Example CSV setup
Example CSV headers:
Example rule:
Example mappings:
Related pages
POS Mapping
Map POS codes to ingredients or recipes.
Integrations Overview
Return to the integrations overview.
Storage Units
Manage storage units used for inventory deductions.
Inventory Ledger
Review inventory movements created by CSV uploads.