Discount Codes Import From File
π₯ Import discount codes from a CSV file with full per-row configuration.
The Import from File feature lets you bulk-import discount codes from a CSV file. Each row in the file becomes one discount code, and you can configure value, dates, usage limits, minimum requirements, and combinations independently for each row. Optionally, the app can also email each code to the customer specified in the row.
When to use this vs other discount operations:
Use this when you have a list of codes (or per-row settings) coming from another system.
Use Bulk Create to generate a batch of codes that share the same rules.
Use Bulk Send to generate codes and email a unique one to each recipient with shared rules.
π‘ Common Use Cases
Import from another system β load codes generated outside Shopify.
Per-customer welcome codes β each row holds a unique customer email and a one-time code.
Mixed campaigns in one upload β different rules per row (different discount values, dates, limits).
Pre-staging seasonal campaigns β import codes with future
starts_atso they activate automatically.Bulk-order incentives β different
minimum_purchase_amounttiers per row.
πͺ Step-by-Step Instructions

Download a template. A simple template with the most common columns and an advanced template with every supported column are available below.
Fill in your data. Only
title,discount_type, anddiscount_valueare required. Remove columns you don't use.Upload the file. The form accepts
.csv,.tsv, and.txtfiles up to 10 MB. After upload, a summary shows the detected separator, row count, and column names. Validation errors (if any) are listed.Resolve ambiguous dates. If your
starts_atorends_atcolumns contain dates like01/05/2026, you'll be asked whether the first number is the day or the month.Configure customer delivery (if applicable). When the file contains an
emailorcustomer_idcolumn, a Send discount codes to customers checkbox appears. Enable it and choose a sending method to email each row's code to that row's customer.Choose internal delivery options. Allow data download and / or send yourself a summary email.
Click Import now or Schedule.
π CSV Columns
Required
title
Internal title shown in Shopify Admin β Discounts. Helps you identify the discount.
discount_type
fixed or percentage (lowercase).
discount_value
Numeric. For fixed it's the amount in your store currency; for percentage it's the percent (e.g. 20 for 20%). Decimal commas are auto-converted to dots.
Code
code
The discount code. 3β20 characters, letters/numbers/hyphens/underscores only. If empty or omitted, a code is auto-generated.
prefix
Optional prefix (max 4 characters) used only when code is empty.
Date & Time
starts_at
Date when the discount becomes active. See formats below.
ends_at
Date when the discount expires. Leave blank for no end date.
Supported date formats:
YYYY-MM-DD(recommended):2026-12-25DD/MM/YYYYorDD-MM-YYYY:25/12/2026/25-12-2026MM/DD/YYYYorMM-DD-YYYY:12/25/2026/12-25-2026
If the file contains ambiguous dates (e.g. 01/05/2026), the form asks you whether the first number represents day or month, and applies that interpretation to all rows.
Usage limits
usage_limit
Total number of times this code can be used. Leave blank for unlimited.
once_per_customer
true / false. Limits each customer to one redemption.
once_per_order
true / false. For fixed discounts: applies once per order vs. per item.
Minimum requirements
minimum_purchase_amount
Minimum order amount in your store currency.
minimum_quantity
Minimum number of items in the order.
Only one minimum requirement applies per discount code. If both columns are populated for the same row, behavior follows Shopify's rules β pick one per row to be safe.
Purchase type
purchase_type
one-time (default), subscription, or both.
Combinations
true / false flags controlling whether the discount can be combined with other discount types:
combines_with_product_discountscombines_with_order_discountscombines_with_shipping_discounts
Customer notification
email
Customer email. Used to send the row's code to that customer if delivery is enabled.
customer_id
Numeric Shopify customer ID. Alternative to email.
Adding
customer_idto your file enables the Send discount codes to customers option in the form. Without one of these columns, codes are still imported but no recipient emails are sent.
π¨ Customer Notification (Optional)
If your file has an email or customer_id column, you can email each row's code to its customer. Enable Send discount codes to customers, then pick a sending method:
App Email β uses Gift Card Factory's email infrastructure with a customizable template (built from the Discount codes 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.
Shopify Email is not available for discount codes β Shopify has no native discount-code email template. See Sending Customer Notifications for setup details.
π€ Internal Delivery Options
Independent of customer notifications, you can also receive the import results yourself:
Allow discount codes data download: Creates a download link in the Bulk Operations section. The link expires after 3 days.
Send internal email with all generated discount 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. The discount codes still respect each row's own
starts_at/ends_atfor when they are usable.
The submit button stays disabled until a file is uploaded.
π§ͺ Examples
Simple seasonal discounts
Customer-specific welcome codes (one-time per customer)
Tiered bulk-order incentives
Auto-generated codes with a brand prefix
Generated codes will start with FLSH followed by random characters.
π« Limitations
Product / collection targeting: Imported codes apply to all products and collections. For product- or collection-specific discounts, use Bulk Create.
Customer eligibility: Imported codes are available to all customers. Per-segment or per-customer eligibility is not supported via import.
Code format: Codes must be 3β20 characters, letters / numbers / hyphens / underscores only.
FAQ
Why was my row rejected with "code length must be between 3 and 20 characters"?
Codes you supply yourself must be 3β20 characters long, using letters, numbers, hyphens, and underscores only. Auto-generated codes (when code is empty) always conform.
Why doesn't discount_value=$10 work?
The value must be numeric β no currency symbols or %. Use 10, not $10 or 10%.
My file has dates like 05/06/2026 and the import got the months and days swapped.
The form asks for a "Date format" only when it detects ambiguous dates. If you imported with the wrong choice, fix the dates (or change the column to YYYY-MM-DD) and re-import. There's no way to retroactively flip the interpretation on already-imported codes.
Recipients didn't get their emails.
Confirm Send discount codes to customers is enabled, your file actually contains the email or customer_id column with valid values, and the chosen sender is configured (App Email enabled / Flow configured / Klaviyo flow listening on the metric).
Can I update or edit the imported codes later? Imported codes can't be edited from the app. Use Shopify Admin β Discounts to disable an individual code, then re-import or use Bulk Create for the corrected version.
Last updated