---
title: "Bulk-import articles (invoice items) from a CSV/Excel spreadsheet"
method: POST
path: "/invoice-items/import"
tags: ["Invoice Items (Products/Articles)"]
---

# Bulk-import articles (invoice items) from a CSV/Excel spreadsheet

`POST /invoice-items/import`

Imports many articles/products at once from an uploaded spreadsheet (CSV or Excel). The pipeline auto-detects the file's structure, then uses Claude to map each row onto the invoice-item model (name, price, units, vatRate). Rows with no usable name and rows the model flags as non-article are skipped, and duplicates are skipped by matching the normalised name against the user's existing items (and earlier rows in the same file). Surviving items are written in batches.

## Response `201`

Spreadsheet processed; returns a summary of how rows were classified and how many were imported.

## Other responses

- `400` — Invalid multipart request, empty file, or unparseable spreadsheet
- `401` — Unauthorized
- `500` — Internal Server Error
- `502` — Firestore batch write failed

---

[API](https://skmtc.dev/vocal/apis/magic-heidi-invoicing-software-api.md) · [All operations](https://skmtc.dev/vocal/apis/magic-heidi-invoicing-software-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/vocal/magic-heidi-invoicing-software-api/revisions/591ae048f0a0/schema)
