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.

CSV files

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

Steps:

  1. From your Shopify admin, go to Discounts.

  2. From the Discounts page, click Export.

  3. 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.
  4. Select which file format you would like:

  5. 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

Steps:

  1. Log in to your Google account and start a new spreadsheet.

  2. From the Untitled Spreadsheet page, go to File > Import...:

  3. Locate and select the CSV file that you want to edit.

  4. In the Import file dialog, select your preferred options under the Import action, Separator character, and Convert text to numbers and dates sections.

  5. Click Import.

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, "tag1,tag2,tag3").
  • Tags are not case sensitive.
  • Different records must be separated by line breaks.
Ready to start selling with Shopify?Try it free