Discount codes guide
How to import discount codes into Shopify from a CSV
Why there’s no import button
Discounts > Export gives you a file of codes, but there’s no matching import. Most guides send you to a paid app. The API route is free because Shopify’s own GraphiQL app and Shopify CLI can run it on your store.
Steps
- In your admin, create the discount (Discounts > Create discount) with one code, the value, dates, limits and combinations you want. Every code you add later shares these settings.
- Find the discount’s ID with the lookup query in the tool (or copy the number at the end of the discount’s page address in your admin, then check it with the lookup query).
- Open the discount code importer, choose Paste or upload, and add your CSV. It reads a column named Code, or the first column.
- Paste the discount ID. The tool splits your codes into batches of 250.
- Run each batch in the GraphiQL app, or download the script for Shopify CLI.
- Paste Shopify’s responses back into the tool to see any codes that failed.
What your CSV needs
One code per row. Anything else in the file is ignored.
- A header named Code (or no header at all).
- No duplicates. Codes aren’t case sensitive, so SAVE10 and save10 clash.
- Up to 255 characters per code, ideally letters, numbers and dashes only.
More guides
- How to create thousands of unique discount codes in Shopify
- Add discount codes in bulk with the Shopify GraphiQL app
- Add thousands of discount codes with Shopify CLI
- Shopify discount code rules: length, capitals and limits
Sources: discountRedeemCodeBulkAdd, Shopify CLI store execute, Shopify Help Center: discount codes. Not affiliated with, endorsed by, or sponsored by Shopify Inc. Shopify is a trademark of Shopify Inc.