# Import and export invoicing data with CSV

Every invoicing list has Import and Export buttons. Import accepts Invoice Ninja, Xero or a generic CSV, detects the format from the header row, shows a preview, and reports created, skipped and errored rows. Export downloads the current collection.

Source: https://help.pigi.io/guides/invoicing/import/csv-import-and-export

## Quick answers

**How do I import data into Invoicing?**
Open the list you want to fill — Invoices, Quotes, Payments, Customers, Contacts or
Items — and click **Import**. Choose a `.csv` file, check the preview, then click
**Import N rows**.

**Which CSV formats are supported?**
Invoice Ninja, Xero and a generic CSV. The format is detected from the header row
and shown as a badge on the preview step, so you do not choose it.

**Why do my imported invoice numbers have a prefix?**
Every imported document gets a source prefix stamped on: `IN-` for Invoice Ninja,
`XE-` for Xero, `IMP-` for a generic CSV. This is what keeps an imported `0001` from
colliding with your own `INV-0001`.

**What does the import report tell me?**
Counts of **Created**, **Skipped** (duplicates) and **Errors**, plus the first ten
of each with a reason. Nothing is written for a skipped or errored row.

**Are duplicate invoices skipped?**
Yes — an invoice or quote whose number already exists in your company is skipped.

**Are duplicate payments skipped?**
**No.** The payments importer has no duplicate check at all. Re-importing the same
file records every payment a second time, adds it to the invoice's paid amount, and
double-counts the money in your revenue figures. Import a payments file once, and
only once.

**How does an imported payment find its invoice?**
By invoice number first. If that fails and the row has a customer name, PiGi picks
that customer's oldest invoice with money still outstanding. If neither matches, the
row is reported as an error.

**Does an imported payment update the booking?**
No. Imported payments reconcile the invoice but are not mirrored onto a linked
booking, so the booking still shows unpaid.

**Can I import invoices with their line items?**
From Xero, yes — Xero exports one row per line, and PiGi groups them back into
invoices with their lines. From Invoice Ninja or a generic CSV, no: each invoice gets
a single line for its total.

**What currency are imported invoices in?**
ZAR, always. The importer ignores any currency column.

**How do I export?**
Click **Export** on any invoicing list. The file downloads as
`<entity>_export_<date>.csv`.

**Does export respect my filters?**
No. Export always writes the whole collection for your company, not the filtered or
searched view.

## What each list imports

| List | Matches on | Duplicates |
|---|---|---|
| Invoices | Invoice number | Skipped |
| Quotes | Quote number | Skipped |
| Payments | Invoice number, else customer's oldest unpaid invoice | **Not detected** |
| Customers | Name, plus email when present | Updated in place |
| Contacts | Name + email | Skipped |
| Items | Name | Skipped; missing codes are generated |

## Steps

1. Export from your old system as CSV.
2. Import in this order so the links resolve: **Customers**, then **Items**, then
   **Invoices** and **Quotes**, then **Payments** last.
3. On each list click **Import**, pick the file, check the detected format badge and
   the preview table, then confirm.
4. Read the results panel. Investigate anything in **Errors** before re-importing —
   and never re-run a payments file.

## Column hints

The upload step lists the columns each importer looks for. For invoices those are
Number, Client, Amount, Date, Due Date and Status; for payments, Amount, Client,
Date, Type and Transaction Reference; for customers, Name, Email, Phone, VAT Number
and Country.

## Known limitations

- **Payments import has no duplicate protection.** This is the one that costs real
  money: a second import silently doubles what each invoice looks paid, and doubles
  that cash in your revenue figures.
- **Imported payments are not mirrored to bookings**, so an invoice can read Paid
  while its booking reads unpaid.
- **Customer addresses are not imported.** Street, city, region, postcode and country
  are parsed out of the CSV and then dropped.
- **Contacts are not linked to their customer on import**, even when the file has a
  company name.
- **Everything imports as ZAR**, whatever the source file says.
- **Import cannot be undone.** There is no rollback and no bulk delete.

## Related

- [Record a payment against an invoice](record-a-payment.md)
- [Manage customers and billing contacts](customers-and-contacts.md)
- [Manage your products and services catalogue](products-and-services.md)
