Exporting discount codes
You can export your discount codes to a CSV file from the Discounts page of your Shopify admin to see a broad overview of your discount code history.
On this page
CSV stands for Comma Separated Values, and it's a file format (.csv) for spreadsheets. Shopify accepts the import and export of CSV files for the products, customers, orders (export only), and discounts (export only) of your store.
CSV files might seem intimidating at first, but when you understand what the text and characters represent in a spreadsheet, you might use it to perform some bigger tasks (such as bulk editing products and discounts).
In a CSV file, each entry represents a cell in a spreadsheet, each line represents a new row, and each comma indicates where one entry ends and another one begins.
For example, the entries in this customer CSV file:
look like this in a spreadsheet program:
Shopify recommends using Google Sheets to view a formatted version of your CSV files. To use Google Sheets, you must import the CSV file into the program. CSVs are useful for stores that:
- are switching to Shopify from another e-commerce platform
- have a list of customer accounts
- prefer to upload products using a spreadsheet
- temporarily have limited internet connectivity.
Export your discount codes
From your Shopify admin, go to Discounts.
From the Discounts page, click Export.
Click one of the following export options:
- Current page to export the discounts showing in your admin
- All discounts to export all your store's discounts
- Selected discounts to export discounts you have selected
- Current search to export a filtered list of discounts.
Select which file format you would like:
- Select CSV for Excel, Numbers, and other spreadsheet programs if you plan to use a spreadsheet program with your discount CSV.
- Select Plain CSV file if you plan to use a plain-text editor with your discount CSV.
Click Export discounts to download your discounts CSV.
After you export your discount codes to a CSV file, you can import it into Google Sheets to view a formatted version of your discounts CSV.
Import your discounts CSV into Google Sheets
Log in to your Google account and start a new spreadsheet.
From the Untitled Spreadsheet page, go to File > Import...:
Locate and select the CSV file that you want to edit.
In the Import file dialog, select your preferred options under the Import action, Separator character, and Convert text to numbers and dates sections.
From here you can edit your CSV. When you finish, you can export it from Google Sheets as a CSV file.
Use a text editor to edit your discounts CSV file
If you don't have a spreadsheet program, then you can edit CSV files using a text editor.
Most computers have text editors that can open CSV files. You can also use a program like Visual Studio Code or Sublime Text to edit and debug your CSV file.
When you format your CSV file in a text editor, observe the following considerations:
- Column headers must be separated by commas (for example,
First Name,Last Name,Email,Company,Address1).
- The list of tags must be wrapped in quotation marks (for example,
- Tags are not case sensitive.
- Different records must be separated by line breaks.