The Scenario
Campaign planning meeting is next Thursday. The promotions manager wants to go into it with a clear picture of every active price rule and which codes are being used, which ones are sitting unused, and which ones have already expired. She has a Google Sheet ready for the audit data. What she doesn't have is the data.
Shopify's admin shows price rules one at a time. Discount codes within each rule are listed below the rule, also one at a time. There's no export button on the discounts screen that gives you rule details and code usage in a single file.
The bad version:
- Open the first price rule in Shopify, note the discount type and value.
- Scroll through the codes attached to the rule, note the usage count for each one.
- Navigate back, open the next rule, repeat.
- After 12 rules, you've been in the admin for 40 minutes and have 200 codes to go.
The campaign planning meeting cannot be pushed. The audit data needs to exist before it.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent that lives inside your Google Sheet. It pulls all price rules and their associated discount codes from Shopify and writes them into the sheet in one operation — one row per code, with all the fields the promotions manager needs.
Fetch all Shopify price rules and for each one list its discount codes with code, usage count, and expires_at — write everything into my Promotions Audit Google Sheet, one row per code
What You Get
- One row per discount code, with the parent price rule's discount type and value, the code string, usage count, and expiry date.
- All price rules and codes pulled in one operation — no rule-by-rule navigation.
- The promotions manager can sort by usage count to find unused codes, filter by expiry date to find stale rules, and start the planning meeting with actual data.
What If the Data Is Not Quite Ready
You only need active price rules — expired ones should be excluded
Fetch all Shopify price rules where ends_at is null or in the future, and for each list all discount codes with code, usage count, and expires_at — write into my Promotions Audit sheet, one row per code
Unused codes should be flagged automatically
Fetch all Shopify price rules and their discount codes — write price rule title, discount value, code string, usage count, and expires_at into my Promotions Audit sheet — add a flag column that says 'unused' if usage count is 0
You also need the total redemption count per price rule
Fetch all Shopify price rules and their discount codes — write price rule title, discount type, value, code, usage count, and expires_at into my Promotions Audit sheet — add a column with the total usage count summed across all codes for that price rule
Full audit: active rules only, unused flag, per-rule totals, and sort by usage count ascending
Fetch all Shopify price rules where ends_at is null or future — for each, list all discount codes with code, usage count, expires_at — write price rule title, type, value, code, usage count, expires_at into my Promotions Audit sheet — add 'unused' flag if usage count is 0 — add per-rule total usage — sort by usage count ascending so unused codes appear at the top
Running the sort and flag logic alongside the pull means the promotions manager walks into the campaign meeting with a ranked audit, not a raw list to sort manually.
Try It
Get the 7-day free trial of SheetXAI and open the promotions audit sheet before next Thursday's campaign planning meeting, then ask SheetXAI to pull all price rules and codes in one operation. Future campaign cycles will start the same way. Also worth reading: how to bulk create discount codes for the next campaign, or the hub overview for all Shopify workflows.
