# Import From File

The **Import from File** feature creates Shopify gift cards in bulk from a CSV file. You define value, code, expiration date, recipient, and message per row. Optionally, the app can email each gift card to its recipient after creation. Ideal for migrating from another platform, fulfilling corporate orders, or processing batches collected from external systems.

### 💡 **Common Use Cases**

* **Migrating gift cards from another platform** — bring existing gift cards into Shopify when moving from another e-commerce or POS system.
* **Corporate or bulk orders** — issue large numbers of gift cards for corporate clients, employee rewards, or event giveaways.
* **Physical gift card fulfillment** — upload pre-generated codes to be printed on physical cards for in-store or retail distribution.
* **External system handoff** — import orders collected via spreadsheets, forms, or tools like Typeform or Airtable without retyping.

### **🪜 Step-by-Step Instructions**

<figure><img src="/files/LUYLqsLhlnQHT8QbaIKK" alt=""><figcaption></figcaption></figure>

1. **Download a template.** A simple template (just the basics) and an extended template (every supported column) are available below.

{% hint style="info" %}
You can **remove** any column you don't need. The only required column is: `initial_value`.
{% endhint %}

{% file src="/files/osKFMemnvYY9zTBspw4g" %}

{% file src="/files/UmSs0AJ81vQqC6KsA4N4" %}

Optionally, copy our Google Sheet templates:

* [Simple](https://docs.google.com/spreadsheets/d/1dGLJE-ZTzG6AKl8Rz1xxXtbbwBZ2pWd9YcKv-OVGuvo/edit?usp=sharing)
* [Extended](https://docs.google.com/spreadsheets/d/1WTtCELmw76rVc0yN38Pka0XvT4U0HmWAyyrphxXcPvg/edit?usp=sharing)

2. **Fill in your data.** See [CSV Columns](#csv-columns) below for all supported fields.
3. **Upload the file.** The form accepts `.csv`, `.tsv`, and `.txt` files up to **10 MB**. After upload, a summary shows the detected separator, row count, and column names. Validation errors (if any) are listed.
4. **Resolve ambiguous dates.** If `expires_on` contains dates like `01/05/2026`, the form asks whether the first number is the day or the month, and applies that to all rows.
5. **Configure customer handling and delivery (optional).** When the file contains an `email` or `customer_id` column, additional options appear (see below).
6. **Choose internal delivery options.** Allow data download and / or send yourself a summary email.
7. **Click Import now or Schedule.**

### **📋 CSV Columns**

#### Required

* **`initial_value`** — The value of the gift card in your store's main currency. Use a dot as the decimal separator (e.g. `25.50`). Commas are auto-converted to dots, but more than two decimal places will be rejected.

#### Optional

* **`code`** — The gift card code. Must be **8–20 characters**, letters / numbers / hyphens only. Must be unique and not already used in your store. If empty or omitted, a code is auto-generated.
* **`prefix`** — Adds a fixed prefix to auto-generated codes (or to the imported code). Used for organizing or branding.
* **`email`** — Recipient email address. Required if you want to email this row's gift card to a person.
* **`customer_id`** — Numeric Shopify customer ID. Alternative to `email`.
* **`expires_on`** — Expiration date. Supported formats: `YYYY-MM-DD` (recommended), `DD/MM/YYYY`, `MM/DD/YYYY`, `DD-MM-YYYY`, or `MM-DD-YYYY`. Leave blank for no expiration.
* **`note`** — Internal note attached to the gift card. Visible to staff only, not customers.
* **`message`** — Custom message included in the gift card email. Wrap multi-word messages in double quotes in the CSV to avoid parsing errors.

### **🪪 Customer Handling (when `email` or `customer_id` is in the file)**

When the file includes one of these columns, two extra sections appear in the form:

**If a customer doesn't exist in your store** — choose what happens for rows whose customer can't be matched:

* **Skip creating gift card** — that row is skipped.
* **Create customer and create gift card** — a new customer is created and the gift card is issued to them.

**Assign recipients to gift card** — choose where the customer is attached on each gift card:

* **Recipient field** — the customer is set as the recipient (they get the notification with the message).
* **Customer field** — the customer is set as the owner of the gift card. *Note: assigning to the customer field ignores the message.*
* **Customer and Recipient field** — both.

### **✉️ Sending the Gift Cards (when `email` or `customer_id` is in the file)**

Enable **Send to customer** to email each row's gift card to its recipient. Choose a sending method:

* **Shopify Email** — uses Shopify's built-in gift card notification email.
* **App Email** — uses Gift Card Factory's email infrastructure with a customizable template (built from the **Import from file** or **Custom** template type). Preview before sending.
* **Shopify Flow** — fires a Flow trigger; you configure the action that sends the email.
* **Klaviyo** — fires a Klaviyo metric; you configure a flow that responds to the metric.

[Read more about each sending option](/misc/sending-customer-notifications.md).

### **📤 Internal Delivery Options**

Independent of customer notifications:

* **Allow gift cards data download**: Creates a download link in the **Bulk Operations** section. Expires after **3 days**.
* **Send internal email with all generated gift cards codes**: Sends the full list of codes to an email address you specify (multiple addresses allowed, comma-separated).

### **▶️ Running the Operation**

* **Import now**: Runs the operation immediately.
* **Schedule**: Runs the operation at a future date and time you select.

The submit button stays disabled until a file is uploaded. You can still proceed with rows that have validation warnings — the warning banner lets you choose to fix and re-upload, or run the import as-is (rows with errors will be skipped during execution).

### **🔁 Multiple Imports per File**

If you need to split a single CSV across multiple imports (for example, to schedule batches at different times), see [Multiple Imports From a Single File](/bulk-operations/import-from-file/multiple-imports-from-a-single-file.md).

### **FAQ**

**Can I upload more than one file?**\
Only one file at a time. If you have multiple sources, combine them in a spreadsheet first or run separate imports.

**My `initial_value` rows are being rejected.**\
Use a dot as the decimal separator (`25.50`, not `25,50`). Currency symbols and more than two decimal places are not accepted.

**Imported codes don't match what I had in my CSV.**\
Codes you supply must be 8–20 characters, letters / numbers / hyphens only. Rows with invalid codes are flagged before import.

**No customer-handling options appeared.**\
Those options only appear if the uploaded file contains an `email` or `customer_id` column.

**The recipient didn't get their gift card email.**\
Confirm **Send to customer** was enabled, the row had a valid `email` or `customer_id`, and your sending method is configured (Shopify Email enabled / App Email domain validated / Flow configured / Klaviyo flow listening on the metric). Have the recipient check spam.


---

# 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://docs.giftcardfactory.app/bulk-operations/import-from-file.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.
