Skip to content

Shopify tutorials for the person running the store. Orders, discounts, fulfilment, returns.

Export your discount codes to CSV in Shopify

A discount export gives a broad overview of your discount code history in one file. This tutorial exports all the store's discounts to CSV from the Discounts page, then opens the file in Google Sheets.

Written · Shopify admin, desktop steps · 4 minutes read

The worked example

Export fromDiscounts page
ScopeAll discounts
FormatCSV for Excel, Numbers and other programs
ResultA .csv download
NoteExport only: codes cannot be imported back

Download the planner: sample-discount-export.csv (141 bytes).

A sample discount export in the format Shopify produces: code, type, value, status, and uses. The three codes add up to 204 uses.

1Open Discounts

From your Shopify admin, go to Discounts. The discounts you created display on the Discounts page of your Shopify admin.

2Click Export

From the Discounts page, click Export. A dialog opens with the export options.

3Pick the export scope

Click one of the export options. Current page exports the discounts showing in your admin. All discounts exports all your store's discounts. Selected discounts exports discounts you have selected. Current search exports a filtered list of discounts. This tutorial uses All discounts.

4Pick the file format

Select which file format you want to export. 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.

5Click Export discounts

Click Export discounts to download your discounts CSV. The file downloads to your computer.

6Open it in Google Sheets

After you export your discount codes to a CSV file, you can import it into Google Sheets to view a formatted version. Log in to your Google account and start a new spreadsheet. From the Untitled Spreadsheet page, go to File, then Import. Locate and select the CSV file you want to edit. In the Import file dialog, select your preferred options under Import action, Separator character, and Convert text to numbers and dates. Click Import. From here you can edit your CSV, and when you finish, you can export it from Google Sheets as a CSV file.

The arithmetic

The sample export in the download holds three codes. Their uses add up to 204:

CodeTypeUses
SAVE25Fixed amount34
LAUNCH100Percentage58
BUY2GET1Buy X get Y112
Total3 codes204

The export is a snapshot: run it again after a sale to see the new counts. Discounts export to CSV only, so the file cannot be imported back into Shopify.

Held at the counter

Export only: codes cannot be imported back. Shopify accepts the import and export of CSV files for products, customers, orders, and discounts, but orders and discounts are export only. A code list from another system has to be entered one by one, or created through an app or the API.

Current search exports the filtered list. If you filtered the Discounts page first, Current search exports only the discounts that match the filter. Check the filter before you export, or the file will hold fewer codes than you expected.

Tags in a CSV need quotation marks. When you format a CSV file in a text editor, the list of tags must be wrapped in quotation marks, and different records must be separated by line breaks. Column headers must be separated by commas.

Sources

  • Exporting discounts — Shopify's help pages: the export steps, the four export scopes, the two file formats, and the Google Sheets import steps.