Skip to main content

CSV Import of Shipping Cost Data

O
Written by Ondřej Průša
Updated over a week ago

CSV import allows uploading shipping cost data for calculating cost analysis and profit margins. This feature is useful for carriers without automatic invoice processing or for supplementing missing information.

When to use CSV import

  • Importing cost data from carriers without automatic processing

  • Completing customer price information not present in the order feed

  • Importing historical data for cost analysis

  • Testing cost analysis functionality with your own data

CSV file format

Technical requirements

  • Format: CSV (Comma Separated Values)

  • Encoding: UTF-8

  • Delimiter: Comma (,)

  • Quotes: Double quotes (") for fields containing commas or quotes

  • Header: The first row must contain column names (case-sensitive)

  • Structure: All 9 columns must be present in each row

Column specifications

Column

Required

Description

Example

tracking_number

Yes

Unique shipment identifier (max. 255 characters)

Z123456789

carrier_currency

Yes

ISO 4217 carrier currency code (3 uppercase letters)

EUR, CZK

carrier_price

Yes

Carrier costs (max. 4 decimal places)

15.50

weight

No

Weight in kg (max. 3 decimal places)

2.5

number_of_packets

No

Number of packages (default: 1)

1

invoice_date

No

Invoice date (YYYY-MM-DD format)

2025-01-15

customer_currency

No

ISO 4217 customer currency code

EUR

customer_price

No

Amount charged to the customer

18.50

customer_email

No

Customer email for matching shipments

Important: Columns customer_currency and customer_price must be provided together. If you enter one, you must enter the other as well.

Shipment matching

Critical: The tracking_number format must be identical to the format in the order integration. Any differences (spaces, hyphens, case) will prevent the shipment from being matched.

Rules for successful matching

  • Identical format: "ABC-123-456" in integration = "ABC-123-456" in CSV

  • Case sensitivity: "abc123" ≠ "ABC123"

  • Spaces and characters: "ABC 123" ≠ "ABC123"

  • Prefixes/suffixes: Maintain all (e.g., "CZ" before the number)

Improved matching using customer_email

In cases of duplicate shipments with the same tracking_number , the system will use customer_email for more precise matching. If multiple shipments share the same number, the system will attempt to match based on the customer email from the order.

Import methods

1. Email import (recommended)

  1. In Settings > Cost Analysis find the email address for import

  2. Send an email with the subject "CSV import" (exactly like this)

  3. Attach the CSV file

  4. The system will automatically process the file

2. Direct upload

  1. Use the section for CSV import

  2. Select the file and click import

CSV file examples

Minimal data (only carrier costs)

tracking_number,carrier_currency,carrier_price,weight,number_of_packets,invoice_date,customer_currency,customer_price,customer_email Z123456789,EUR,15.50,,,,,,

Complete data including customer prices

tracking_number,carrier_currency,carrier_price,weight,number_of_packets,invoice_date,customer_currency,customer_price,customer_email Z123456789,EUR,15.50,2.5,1,2025-01-15,EUR,18.50,[email protected] 12345678901,CZK,350.00,1.2,1,2025-01-15,CZK,420.00,[email protected]

Data processing

Currency conversion

  • All currencies are automatically converted to CZK

  • Exchange rate is determined by invoice_date or current date

  • Carrier and customer currencies are converted independently

Customer prices

  • CSV data takes precedence over data from the order feed

  • Allows margin calculation even without complete order data

  • Useful when the order feed does not contain precise shipping costs

Troubleshooting

Common errors

Error

Solution

Missing columns

CSV must contain all 9 columns

Invalid currency

Use ISO 4217 code (3 uppercase letters)

Incorrect date format

Use YYYY-MM-DD format

Shipment not matched

Verify tracking_number format in Tracking

Email not processed

Subject must be exactly "CSV import"

Tips for successful import

  1. Verify the tracking_number format in existing shipments before import

  2. Test with a small sample of data (5-10 rows) before bulk import

  3. Use customer_email for better matching of duplicate shipments

  4. Enter invoice_date for accurate exchange rates

  5. Check the results in Cost Analysis

Integration with cost analysis

Imported data will automatically appear in:

  • Cost analysis dashboard

  • Profit margin calculations

  • All charts and statistics

  • Overview of unmatched items (for identifying issues)

For details on using cost analysis, see the article Analytics: Cost Analysis.

Did this answer your question?