# CSV Import

CSV import lets you add large numbers of products to a draft order by uploading a CSV file.

### CSV file format

Your CSV file needs two columns:

#### Required columns

| Column Name                       | Description             | Example           |
| --------------------------------- | ----------------------- | ----------------- |
| `SKU` or `sku`                    | Product SKU/variant SKU | `WIDGET-A-BLU-LG` |
| `Quantity` or `Qty` or `quantity` | Number of units         | `10`              |

**Minimal example:**

```csv
SKU,Quantity
WIDGET-A,10
WIDGET-B,5
WIDGET-C,25
```

#### Optional: Include line item properties

You can also include properties using `Property_KeyName` columns:

```csv
SKU,Quantity,Property_Engraving,Property_GiftWrap
WIDGET-A,1,John Smith,Yes
WIDGET-B,2,Jane Doe,No
WIDGET-C,1,Happy Birthday!,Yes
```

Each `Property_` column becomes a line item property on the imported items.

[Learn about line item properties →](https://github.com/horselditty/draft-order-docs/blob/main/product/editor/line-item-properties/README.md)

### Creating a CSV file

#### Using Excel or Google Sheets

1. Open a new spreadsheet
2. Add headers in row 1: `SKU`, `Quantity`
3. Add products in subsequent rows
4. **Save as CSV** (not .xlsx)
   * Excel: File → Save As → CSV (Comma delimited)
   * Google Sheets: File → Download → Comma Separated Values (.csv)

\[Screenshot: Excel spreadsheet with SKU and Quantity columns]

#### Using a text editor

For simple orders, you can create CSV files in Notepad, TextEdit, or any text editor:

```
SKU,Quantity
WIDGET-A,10
WIDGET-B,5
WIDGET-C,25
```

Save with `.csv` extension.

#### From customer orders

If customers send orders as Excel files:

1. Open their file
2. Add `SKU` column (map from their part numbers)
3. Add or rename `Quantity` column
4. Remove unnecessary columns (optional)
5. Save as CSV

### How to import

1. Open a draft order in the Draft Order Magic editor
2. Click **CSV Import** button
3. Click **Choose File** or **Browse**
4. Select your CSV file
5. Click **Upload** or **Import**
6. Products are added to the draft order

CSV import adds items to the current draft order. If the draft already has items, the CSV items are added to the existing list.

### Limitations

#### 200 row maximum

Shopify API limits CSV imports to 200 line items per upload. For orders over 200 items, split the CSV into multiple files and import each one sequentially.

#### SKUs must exist in catalog

* Every SKU must exist in your Shopify product catalog
* Variant SKUs (not just product SKUs) are required for products with variants
* If a SKU doesn't exist, that row is skipped

#### File size limits

CSV files should be under 5 MB.

#### No custom pricing in CSV

CSV import brings items in at catalog prices. To set custom pricing, edit prices in the editor after import.

[Learn about custom pricing →](https://github.com/horselditty/draft-order-docs/blob/main/product/editor/custom-pricing/README.md)

### Troubleshooting

#### SKU not found errors

* Double-check SKU spelling in CSV
* Verify SKU exists in Shopify admin
* For products with variants, use the variant SKU, not product SKU
* Check for extra spaces before/after SKU in CSV

#### Invalid quantity errors

* Ensure all quantities are numbers (10, 25, 100)
* Remove commas from large numbers (use `1000` not `1,000`)
* No decimal points (use whole numbers)

#### CSV file won't upload

* Ensure file is saved as .csv (not .xlsx or .xls)
* Check file size (should be under 5 MB)
* Remove special characters from filename
* Close the CSV file in Excel before uploading

#### Some items missing after import

* Check error messages for SKUs not found
* Review CSV for blank rows
* Ensure all rows have both SKU and Quantity

#### Properties not importing

* Column name must start with `Property_` (case-sensitive)
* Example: `Property_Engraving` not `property_engraving`
* No spaces in column name: `Property_GiftWrap` not `Property_Gift Wrap`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://responsive-media.gitbook.io/draft-order-magic/draft-order-editor/csv-import.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
