Discount Codes Import From File

The Discount Codes Import from File feature allows you to bulk import discount codes into your Shopify store using a CSV file. This powerful tool enables you to create multiple discount codes with custom settings, active dates, usage limits, and automatically send them to customers via email.

When to Use This Feature

  • Bulk Code Creation: Create hundreds or thousands of discount codes at once

  • Pre-generated Codes: Import existing discount codes from external systems

  • Customer-Specific Discounts: Send unique discount codes to specific customers

  • Seasonal Campaigns: Set up multiple campaigns with different active dates in one import

  • Advanced Requirements: Configure minimum purchase amounts, quantity limits, and combination rules per code

Getting Started

Step 1: Prepare Your CSV File

Download one of our templates to get started:

  • Simple Template - Basic discount codes with dates

  • Advanced Template - All available options

Step 2: Fill in Your Data

Edit the CSV file with your discount code data. See the Column Reference below for details on each field.

Step 3: Upload and Import

  1. Navigate to Bulk OperationsNew Bulk Operation

  2. Select Discount Codes tab

  3. Click Import From File

  4. Upload your CSV file

  5. Review any validation errors

  6. Configure email sending (optional)

  7. Click Import now or Schedule for later

CSV Column Reference

Required Columns

These columns must be present in your CSV file:

Column
Description
Example

title

Internal title/description for the discount code

"Summer Sale 2026"

discount_type

Type of discount: fixed or percentage

percentage

discount_value

Discount value (dollar amount or percentage)

20 (for 20% or $20)

Optional Columns

Add these columns to customize your discount codes:

Basic Settings

Column
Description
Format
Example

code

Discount code customers will use. If empty, auto-generated

Alphanumeric, 3-20 chars

SUMMER20

prefix

Prefix for auto-generated codes (only if code is empty)

Max 4 characters

FALL

Date & Time

Column
Description
Format
Example

starts_at

When the discount becomes active

YYYY-MM-DD or DD/MM/YYYY

2026-06-01

ends_at

When the discount expires

YYYY-MM-DD or DD/MM/YYYY

2026-08-31

Supported Date Formats:

  • YYYY-MM-DD (recommended): 2026-12-25

  • DD/MM/YYYY: 25/12/2026

  • MM/DD/YYYY: 12/25/2026

  • DD-MM-YYYY: 25-12-2026

  • MM-DD-YYYY: 12-25-2026

Note: If your file contains ambiguous dates (like 01/05/2026), you'll be asked to specify if the first number represents day or month.

Usage Limits

Column
Description
Format
Example

usage_limit

Total number of times code can be used

Integer

100

once_per_customer

Limit to one use per customer

true or false

true

once_per_order

For fixed discounts: apply once per order vs per item

true or false

false

Minimum Requirements

Column
Description
Format
Example

minimum_purchase_amount

Minimum order amount required (in shop currency)

Decimal number

50.00

minimum_quantity

Minimum quantity of items required

Integer

5

Note: Only one minimum requirement can be set per discount code. If both are provided, minimum_purchase_amount takes precedence.

Purchase Type

Column
Description
Format
Example

purchase_type

What the discount applies to

one-time, subscription, or both

one-time

  • one-time (default): Only one-time purchases

  • subscription: Only subscription purchases

  • both: Both one-time and subscription purchases

Combination Settings

Control whether this discount can be combined with other discounts:

Column
Description
Format
Example

combines_with_product_discounts

Can combine with product discounts

true or false

true

combines_with_order_discounts

Can combine with order discounts

true or false

false

combines_with_shipping_discounts

Can combine with shipping discounts

true or false

false

Customer Notification

Column
Description
Format
Example

email

Customer email to send discount code to

Valid email address

customer_id

Shopify customer ID (alternative to email)

Numeric ID

123456789

Note: Email sending must be enabled in the import form. The app will send the discount code to customers listed in the CSV.

Examples

Example 1: Simple Seasonal Discounts

Create basic discount codes with active dates:

Example 2: Customer-Specific Discounts

Send unique discount codes to specific customers:

Example 3: Advanced Configuration

Full control with minimum requirements and combination rules:

Auto-Generated Codes

If you don't provide a code column or leave it empty, the system will automatically generate unique codes for you.

Without Prefix

Generated code example: AbC123xY

With Prefix

Generated code example: FLASHabc123 (prefix + random characters)

Prefix Rules:

  • Maximum 4 characters

  • Only used when code column is empty or not provided

  • Helps organize and identify discount codes

Best Practices

1. Test with Small Batches First

Start with a CSV file containing 5-10 discount codes to ensure everything is configured correctly before importing thousands of codes.

2. Use Clear, Descriptive Titles

Titles are internal and help you identify discount codes in your Shopify admin:

  • ✅ Good: "Summer Sale 2026 - 20% Off", "VIP Customer - $50 Off"

  • ❌ Poor: "Discount 1", "Code ABC"

3. Set Appropriate Usage Limits

Consider your campaign goals:

  • Single Use: Set usage_limit=1 and once_per_customer=true for one-time offers

  • Limited Campaign: Set usage_limit=500 to cap total uses

  • Unlimited: Leave usage_limit empty for unlimited uses

4. Plan Your Active Dates

  • Set starts_at in the future to schedule campaigns

  • Set ends_at to automatically expire codes

  • Leave ends_at empty for codes that never expire

5. Be Strategic with Combinations

  • Enable combines_with_shipping_discounts=true for free shipping offers

  • Disable all combinations for exclusive offers

  • Use once_per_order=true for fixed discounts to prevent stacking per item

6. Validate Before Importing

The app will show validation errors before import. Common issues:

  • Missing required columns (title, discount_type, discount_value)

  • Invalid discount types (must be fixed or percentage)

  • Invalid date formats

  • Invalid boolean values (must be true or false)

Common Use Cases

Use Case 1: Welcome Discount Campaign

Send unique 15% off codes to new customers:

Use Case 2: Bulk Order Incentives

Encourage larger orders with minimum purchase requirements:

Use Case 3: Flash Sale Event

Create time-limited discounts:

Use Case 4: Free Shipping Promotion

Combine fixed discount with shipping discount combination:

Troubleshooting

Issue: Import fails with "No file uploaded"

Solution: Make sure you've selected a CSV file and the file is not corrupted.

Issue: "Row X: title is required"

Solution: Every row must have a title. Check that the title column is filled in for all rows.

Issue: "Row X: discount_type must be 'fixed' or 'percentage'"

Solution: Check the discount_type column. Valid values are exactly fixed or percentage (lowercase).

Issue: "Row X: discount_value must be a number"

Solution: Ensure discount_value contains only numbers (no currency symbols like $ or %).

Issue: Dates are interpreted incorrectly

Solution: Use the YYYY-MM-DD format (e.g., 2026-12-25) or specify your date format when prompted.

Issue: Codes not sent to customers

Solution:

  1. Check that "Send discount codes to customers" is enabled in the import form

  2. Verify email addresses in the CSV are valid

  3. Ensure you've selected an email sender and template

Issue: Generated codes are too similar

Solution: The system generates random unique codes. If you need specific patterns, provide your own codes in the code column.

Limitations

  • Product/Collection Targeting: Currently, imported codes apply to all products. For product-specific discounts, use the Bulk Create feature.

  • Customer Eligibility: Imported codes are available to all customers. Customer segment targeting is not supported via import.

  • Code Format: Codes must be 3-20 characters, alphanumeric with hyphens and underscores only.

Additional Resources

Need Help?

If you have questions or need assistance:

Last updated