Back to Shopify in Excel
SheetXAI logo
Shopify logo
Shopify · Excel Guide

Bulk Create Shopify Discount Codes From a Excel Campaign List

2026-05-15
5 min read

The Scenario

Loyalty campaign launch is Monday. 500 discount codes, each unique, all under the same price rule. The marketing coordinator has them in column A of an Excel workbook — code strings ready, confirmed with the campaign manager. She needs them all created in Shopify and the confirmation IDs written back before the email personalization merge runs Sunday night.

Shopify's admin creates one discount code at a time. It is Sunday morning.

The bad version:

  • Open Shopify's discount code section, navigate to the price rule, click New discount code, type the first code string, save.
  • Click New discount code. Type the second code string. Save.
  • 500 times. By hand. On a Sunday morning before a Monday launch.

The merge runs at 10 PM. Every code needs to exist in Shopify before that.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent that lives inside your Excel workbook. It reads the code list and creates each Shopify discount code via the API, batch by batch, writing results back as it goes.

Read my Loyalty Codes Excel sheet and batch-create all 500 discount codes listed in column A for the price rule in cell A1, then write the discount code ID back into column B

What You Get

  • A Shopify discount code created for each value in column A, all tied to the price rule in cell A1.
  • The discount code ID written back into column B for each successfully created code.
  • Any codes that fail — typically duplicates that already exist in Shopify — get an error message in column B instead of a silent skip.

What If the Data Is Not Quite Ready

Some codes were already created from a partial run earlier in the week

Read my Loyalty Codes Excel sheet and create Shopify discount codes for all rows where column B is blank — use price rule from cell A1 — skip any code in column A that already exists in Shopify — write the discount code ID or 'duplicate' into column B

Each code needs a single-use limit

Read my Loyalty Codes Excel sheet and create Shopify discount codes for all rows in column A under price rule in cell A1 — set usage_limit to 1 for each — write the discount code ID into column B

Codes span two worksheets — Wave 1 and Wave 2 — under different price rules

Create Shopify discount codes for all rows in my Wave-1 Codes sheet (codes in column A, price rule ID in cell B1) and all rows in my Wave-2 Codes sheet (codes in column A, price rule ID in cell B1) — set usage_limit to 1 — write the discount code ID into column B of whichever sheet each row came from

Skip duplicates, set usage limit, create from both waves, and write back IDs with timestamps

For each row in my Loyalty Codes sheet where column B is blank, create a Shopify discount code for the value in column A under price rule ID in cell A1 — skip if the code already exists — set usage_limit to 1 — write the discount code ID and current timestamp into columns B and C

Combining the duplicate check, usage limit, and creation in one pass means you don't need a separate pre-check run before the batch.

Try It

Get the 7-day free trial of SheetXAI and open the loyalty campaign workbook before the Sunday night email merge, then ask SheetXAI to create all 500 codes in one operation. Future campaign launches will use the same pattern. Also worth reading: how to export all price rules for a promotions audit after the campaign, or the hub overview for all Shopify workflows.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more