CSV Import Guide
Complete guide to importing financial transactions in bulk using CSV files. Learn file formats, validation rules, and best practices for migrating data into PoultryPro.
Overview
The CSV Import feature allows you to bulk import financial transactions into your farm management system. This is ideal for:
- Migrating from another system
- Batch recording historical transactions
- Importing data from accounting software
- Updating multiple records simultaneously
What Can You Import?
The system supports importing the following transaction types:
| Transaction Type | Description | Creates |
|---|---|---|
| SALE | Product sales to customers | Order, Invoice, Payment, Inventory Transaction |
| EXPENSE | Business expenses and purchases | Expense Record, Payment |
| PURCHASE | Inventory purchases from suppliers | Purchase Order, Inventory Update |
| PAYMENT | Standalone payments | Payment Record |
| TRANSFER | Fund transfers between accounts | Transfer Record |
Key Benefits
- Bulk Operations - Import hundreds of records in minutes
- Data Validation - Automatic validation catches errors before import
- Audit Trail - Complete tracking of who imported what and when
- Error Recovery - Failed records can be corrected and re-imported
- Automatic Linking - System automatically links related records
Getting Started
Step 1: Access the Import Feature
- Log in to your farm management dashboard
- Navigate to Financial → Import
- Click "Import Transactions" button
Step 2: Download Template
Before creating your CSV file, download the official template:
- Click "Download Template" button
- Open the template in Excel, Google Sheets, or similar
- Review the column headers and example data
The template includes example rows showing correct formatting for each transaction type. Study these carefully before entering your data.
Step 3: Prepare Your Data
Organize your transaction data according to the template format. See the CSV File Format section for detailed specifications.
CSV File Format
Required Columns
Every CSV file must include these columns (exact column names required):
| Column Name | Required | Description | Example |
|---|---|---|---|
recordType | ✅ | Type of transaction | SALE, EXPENSE, PURCHASE |
date | ✅ | Transaction date (YYYY-MM-DD) | 2025-12-15 |
amount | ✅ | Transaction amount | 5000.00 |
description | ✅ | Transaction details | Sale of eggs to ABC Store |
Optional Columns (Recommended)
| Column Name | Description | Example |
|---|---|---|
referenceNumber | External reference/invoice number | INV-2025-001 |
customerName | Customer name (for sales) | ABC Grocery Store |
supplierName | Supplier name (for purchases) | Feed Supply Ltd |
productName | Product being sold/purchased | Large Eggs (Tray) |
quantity | Product quantity | 50 |
unitPrice | Price per unit | 350.00 |
category | Expense/income category | Feed, Sales, Medication |
paymentMethod | How payment was made | CASH, MPESA, BANK_TRANSFER |
accountName | Account to record against | Main Account, Petty Cash |
Transaction Type-Specific Fields
For SALE Transactions
Required additional fields:
customerName- Customer who purchasedproductName- Product soldquantity- Quantity soldunitPrice- Price per unit
Optional fields:
referenceNumber- Invoice/receipt numberpaymentMethod- Payment method usednotes- Additional details
For EXPENSE Transactions
Required additional fields:
category- Expense categorysupplierNameordescription- Who paid or what for
Optional fields:
referenceNumber- Receipt/voucher numberpaymentMethod- Payment methodallocatedFlockId- Specific flock to allocate to
For PURCHASE Transactions
Required additional fields:
productName- Product/item purchasedquantity- Quantity purchasedunitPrice- Price per unitsupplierName- Supplier name
Optional fields:
category- Item categoryreferenceNumber- Purchase order number
Example CSV Files
Example 1: Sales Import
recordType,date,amount,description,customerName,productName,quantity,unitPrice,paymentMethod
SALE,2026-01-15,17500.00,Egg sales,ABC Store,Large Eggs (Tray),50,350.00,MPESA
SALE,2026-01-16,14000.00,Egg sales,XYZ Market,Medium Eggs (Tray),40,350.00,CASH
SALE,2026-01-17,12000.00,Broiler sales,City Butchery,Live Broilers,20,600.00,BANK_TRANSFERExample 2: Expenses Import
recordType,date,amount,description,category,supplierName,paymentMethod
EXPENSE,2026-01-10,45000.00,Feed purchase for January,Feed,Unga Feeds Ltd,BANK_TRANSFER
EXPENSE,2026-01-12,3500.00,Veterinary consultation,Veterinary,Dr. Kamau Clinic,MPESA
EXPENSE,2026-01-14,2500.00,Layer mash 70kg,Feed,Local Agro Vet,CASHExample 3: Mixed Transactions
recordType,date,amount,description,customerName,supplierName,productName,quantity,unitPrice,category,paymentMethod
SALE,2026-01-20,21000.00,Egg sales,Eastleigh Market,,,Large Eggs (Tray),60,350.00,,MPESA
EXPENSE,2026-01-20,25000.00,Feed restocking,,,Pembe Feeds Ltd,,,Feed,BANK_TRANSFER
PURCHASE,2026-01-21,15000.00,Medication stock,,Agro Supplies,Tylosin 100g,30,500.00,Medication,CASH
SALE,2026-01-22,18000.00,Broiler harvest,Fresh Meats Ltd,,,Live Broilers,30,600.00,,MPESAImport Process
Step-by-Step Import
-
Prepare CSV File
- Format according to template
- Save as CSV (UTF-8)
- Double-check all required fields
-
Upload File
- Click "Choose File" button
- Select your CSV file
- Click "Validate" button
-
Review Validation Results
The system validates all data before import. Fix any errors shown in the validation report before proceeding.
Validation checks:
- ✅ Required fields present
- ✅ Date formats correct (YYYY-MM-DD)
- ✅ Amounts are valid numbers
- ✅ Products exist in inventory
- ✅ Customers/suppliers valid
- ✅ No duplicate transactions
-
Fix Validation Errors
If errors found:
- Download error report
- Fix issues in your CSV
- Re-upload and validate again
-
Import Records
Once validation passes:
- Review import summary
- Click "Import" button
- System processes records
- View import results
-
Verify Imported Data
After import:
- Check transaction list
- Verify account balances
- Review inventory changes
- Confirm customer invoices created
Validation Rules
Date Validation
Format: YYYY-MM-DD
✅ Valid:
- 2026-01-15
- 2025-12-31
- 2026-02-28
❌ Invalid:
- 15/01/2026 (wrong format)
- 2026-13-01 (invalid month)
- 2026-02-30 (invalid date)
Amount Validation
Format: Decimal number
✅ Valid:
- 5000.00
- 15000
- 350.50
❌ Invalid:
- 5,000.00 (no commas)
- $350 (no currency symbols)
- Five thousand (no text)
Product Name Validation
Products must exist in your inventory system before import. Create products first if importing sales of new items.
The system matches by exact name:
- "Large Eggs (Tray)" ≠ "Large Eggs"
- Case-sensitive matching
- Must be active products
Customer/Supplier Validation
Customer and supplier names are matched flexibly:
- System creates new entries if not found
- Case-insensitive matching
- Trims whitespace automatically
Advanced Features
Automatic Flock Allocation
For flocks with cost allocation enabled:
recordType,date,amount,description,allocatedFlockId,category
EXPENSE,2026-01-15,25000.00,Feed for Layer Flock 1,flock-uuid-here,FeedSystem automatically:
- ✅ Allocates expense to specified flock
- ✅ Updates flock cost tracking
- ✅ Calculates per-bird costs
- ✅ Includes in profitability reports
Inventory Synchronization
Sales and purchase imports automatically update inventory:
Sales:
- Reduces inventory quantity
- Records transaction in inventory history
- Updates cost of goods sold
- Triggers low-stock alerts if applicable
Purchases:
- Increases inventory quantity
- Updates average cost
- Records supplier information
- Creates inventory transaction
Payment Allocation
Payments can be automatically linked to invoices:
recordType,date,amount,description,referenceNumber,paymentMethod
PAYMENT,2026-01-20,15000.00,Payment for Invoice INV-001,INV-001,MPESASystem automatically:
- Links payment to matching invoice
- Marks invoice as paid/partially paid
- Updates customer balance
- Records payment history
Troubleshooting
Common Errors
"Required field missing"
Problem: One or more required columns are empty
Solution: Ensure every row has values for:
- recordType
- date
- amount
- description
"Invalid date format"
Problem: Date not in YYYY-MM-DD format
Solution: Convert dates to YYYY-MM-DD:
- Excel: Format Cells → Custom → yyyy-mm-dd
- Google Sheets: Format → Number → Custom date format
"Product not found"
Problem: Product name doesn't match inventory
Solution:
- Check exact spelling and capitalization
- Verify product exists in inventory
- Create product first if new item
"Duplicate transaction detected"
Problem: Same transaction already exists
Solution:
- Check for duplicate rows in CSV
- Verify transaction wasn't already imported
- Use unique reference numbers
"Invalid amount"
Problem: Amount format incorrect
Solution:
- Remove currency symbols ($, KES, etc.)
- Remove commas from numbers
- Use decimal point (not comma) for decimals
- Ensure positive numbers (no negative signs)
Validation Failed Checklist
If import validation fails:
- Check all required columns present
- Verify date format (YYYY-MM-DD)
- Confirm amounts are valid numbers
- Check products exist in inventory
- Ensure no special characters in amounts
- Verify CSV encoding is UTF-8
- Check for hidden characters or spaces
Best Practices
Before Import
-
Backup Your Data
Always backup your database before large imports. While imports are validated, backups provide safety.
-
Test with Small Batch
Import 5-10 records first to verify format and catch any issues before processing hundreds of records.
-
Clean Your Data
- Remove duplicate entries
- Standardize naming (customers, products)
- Verify all calculations
- Check date ranges reasonable
-
Use Consistent Naming
Standardize names across your CSV:
- "ABC Store" not "ABC store" or "Abc Store"
- "Large Eggs (Tray)" everywhere, not mixed formats
During Import
-
Review Validation Results Carefully
Don't skip the validation step. Fix all errors before proceeding.
-
Check Import Summary
Before final import, review:
- Number of records to import
- Total amounts
- Transaction types breakdown
- Date range
-
Monitor Progress
For large imports:
- Don't close browser window
- Wait for completion message
- Note any errors reported
After Import
-
Verify Key Totals
Check that imported totals match expectations:
- Total sales amount
- Total expenses
- Inventory quantities
- Account balances
-
Review Sample Transactions
Spot-check random imported records:
- Customer names correct
- Products linked properly
- Amounts accurate
- Dates correct
-
Check Related Records
Verify automatic links created properly:
- Sales created invoices
- Payments linked to invoices
- Inventory updated
- Flock allocations applied
File Size and Limits
Import Limits
- Maximum rows: 1,000 transactions per file
- Maximum file size: 5 MB
- Supported encoding: UTF-8
- Timeout: 5 minutes processing time
For imports >1,000 records, split into multiple files of ~500 records each. Process them sequentially with a few minutes between imports.
Performance Tips
For large imports:
- Split into smaller batches (500 records)
- Import during off-peak hours
- Process sequentially, not simultaneously
- Allow 2-3 minutes between batches
- Verify each batch before proceeding
Frequently Asked Questions
Can I import historical data?
Yes! You can import transactions from any date. The system properly handles:
- Past dates for historical records
- Future dates (not recommended)
- Multi-year imports
Will import overwrite existing data?
No. CSV import only creates new records. It never modifies or deletes existing transactions.
Can I import partial payment records?
Yes. Import payment records with partial amounts. System tracks remaining balances automatically.
How do I import transactions for multiple flocks?
Include the allocatedFlockId column with the flock UUID for each transaction. Or leave empty to allocate manually later.
Can I import in a different currency?
The system uses your organization's default currency. All amounts in CSV should be in that currency.
What happens if import fails halfway?
Only successfully validated records are imported. Failed records are reported in the error log. Fix and re-import failed records.
Get Support
Need help with CSV imports?
- Check validation errors - Most issues are formatting problems
- Review this guide - Common solutions documented above
- Download template - Use the official template as reference
- Contact support - Submit your CSV for review if stuck
Pro Tip: Create a "test organization" to practice imports without affecting your live data. Once comfortable with the process, perform the actual import in your production organization.
Last updated: January 28, 2026