/shopify-admin-promo-code-bulk-generator
Bulk-creates a batch of unique discount codes for campaigns, giveaways, or partner distributions — each code is its own DiscountCodeBasic with single-use limit by default.
$ npx -y skills add 40rty-ai/shopify-admin-skills --skill shopify-admin-promo-code-bulk-generator --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/shopify-admin-promo-code-bulk-generator
Context preview
The summary Claude sees to decide when to auto-load this skill.
Bulk-creates a batch of unique discount codes for campaigns, giveaways, or partner distributions — each code is its own DiscountCodeBasic with single-use limit by default.
SKILL.md
shopify-admin-promo-code-bulk-generator.SKILL.mdname: shopify-admin-promo-code-bulk-generator
role: marketing
description: "Bulk-creates a batch of unique discount codes for campaigns, giveaways, or partner distributions — each code is its own DiscountCodeBasic with single-use limit by default."
toolkit: shopify-admin, shopify-admin-execution
api_version: "2025-01"
graphql_operations:
- discountCodeBasicCreate:mutation
status: stable
compatibility: Claude Code, Cursor, Codex, Gemini CLI
Purpose
Generates N unique discount codes (e.g., 100 codes for an influencer giveaway, 500 for a partner distribution drop) with a shared prefix and configurable value, usage limit, and validity window. Each code is created as a standalone `DiscountCodeBasic` discount node so it can be tracked independently in Shopify Admin and revoked individually if leaked. Typical use: handing each code to a different recipient where each redemption must be tied to one person.
Prerequisites
- Authenticated Shopify CLI session: `shopify store auth --store <domain> --scopes write_discounts`
- API scopes: `read_discounts`, `write_discounts`
Parameters
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | store | string | yes | — | Store domain (e.g., mystore.myshopify.com) | | format | string | no | human | Output format: `human` or `json` | | dry_run | bool | no | true | Preview the codes that would be created without executing mutations | | prefix | string | yes | — | Prefix for every generated code (e.g., `GIVEAWAY` produces `GIVEAWAY-A4F2X9`) | | count | integer | yes | — | Number of unique codes to generate (max 1000 per run) | | value_type | string | yes | — | Discount type: `percentage`, `fixed_amount`, or `free_shipping` | | value | float | conditional | — | Numeric value: percent off (1–100) for `percentage`; currency amount for `fixed_amount`; ignored for `free_shipping` | | usage_limit | integer | no | 1 | How many times each individual code can be redeemed | | starts_at | string | no | now | ISO8601 datetime when codes become valid | | ends_at | string | no | — | ISO8601 datetime when codes expire (omit for no expiry) | | applies_to | string | no | order | Code applies to: `order` (entire order) or `shipping_only` (with `free_shipping` value type) |
Safety
> ⚠️ Step 1 executes one `discountCodeBasicCreate` mutation per generated code. Once created, codes appear immediately in Shopify Admin and become redeemable at `starts_at`. Codes cannot be deleted in bulk via the Admin API — they must be removed individually with `discountCodeDelete`. Run with `dry_run: true` to confirm the count, prefix, and value before committing. The default is `dry_run: true`. For high counts (>100), confirm `usage_limit` matches intent — a single high-limit code is usually preferable to N single-use codes if uniqueness per recipient is not required.
Workflow Steps
1. Generate `count` unique random suffixes (6 alphanumeric uppercase characters per suffix). Concatenate as `<prefix>-<suffix>`. Validate no in-memory duplicates and no length > 32.
2. **OPERATION:** `discountCodeBasicCreate` — mutation (one call per code) **Inputs:** `basicCodeDiscount.title: "<prefix> bulk generation <date>"`, `basicCodeDiscount.code: <generated_code>`, `basicCodeDiscount.startsAt: <starts_at>`, `basicCodeDiscount.endsAt: <ends_at>`, `basicCodeDiscount.usageLimit: <usage_limit>`, `basicCodeDiscount.appliesOncePerCustomer: true`, `basicCodeDiscount.customerGets.value`: percent / fixed-amount / free-shipping union per `value_type`, `basicCodeDiscount.customerGets.items.all: true`, `basicCodeDiscount.customerSelection.all: true` **Expected output:** `codeDiscountNode.id`, `codeDiscountNode.codeDiscount.codes.edges[0].node.code`, `userErrors`
GraphQL Operations
# discountCodeBasicCreate:mutation — validated against api_version 2025-01
mutation PromoCodeCreate($basicCodeDiscount: DiscountCodeBasicInput!) {
discountCodeBasicCreate(basicCodeDiscount: $basicCodeDiscount) {
codeDiscountNode {
id
codeDiscount {
... on DiscountCodeBasic {
title
startsAt
endsAt
usageLimit
appliesOncePerCustomer
codes(first: 1) {
edges {
node {
code
}
}
}
customerGets {
value {
... on DiscountPercentage {
percentage
}
... on DiscountAmount {
amount {
amount
currencyCode
}
}
... on DiscountOnQuantity {
effect {
... on DiscountPercentage {
percentage
}
}
}
}
}
}
}
}
userErrors {
field
message
code
}
}
}Session Tracking
**Claude MUST emit the following output at each stage. This is mandatory.**
**On start**, emit:
╔══════════════════════════════════════════════╗
║ SKILL: Promo Code Bulk Generator ║
║ Store: <store domain> ║
║ Started: <YYYY-MM-DD HH:MM UTC> ║
╚══════════════════════════════════════════════╝
**After each step**, emit:
[N/TOTAL] <QUERY|MUTATION> <OperationName>
→ Params: <brief summary of key inputs>
→ Result: <count or outcome>If `dry_run: true`, prefix every mutation step with `[DRY RUN]` and do not execute it.
**On completion**, emit:
For `format: human` (default):
══════════════════════════════════════════════
PROMO CODE BULK GENERATION
Prefix: <prefix>
Codes requested: <n>
Codes created: <n> (or "skipped — dry_run")
Value type: <type>
Value: <amount>
Usage limit/code: <n>
Valid: <starts_at> → <ends_at>
Errors: <n>
Output:
Read more
name: shopify-admin-promo-code-bulk-generator role: marketing description: "Bulk-creates a batch of unique discount codes for campaigns, giveaways, or partner distributions — each code is its own DiscountCodeBasic with single-use limit by default." toolkit: shopify-admin, shopify-admin-execution api_version: "2025-01" graphql_operations: - discountCodeBasicCreate:mutation status: stable compatibility: Claude Code, Cursor, Codex, Gemini CLI
Purpose
Generates N unique discount codes (e.g., 100 codes for an influencer giveaway, 500 for a partner distribution drop) with a shared prefix and configurable value, usage limit, and validity window. Each code is created as a standalone `DiscountCodeBasic` discount node so it can be tracked independently in Shopify Admin and revoked individually if leaked. Typical use: handing each code to a different recipient where each redemption must be tied to one person.
Prerequisites
- Authenticated Shopify CLI session: `shopify store auth --store <domain> --scopes write_discounts`
- API scopes: `read_discounts`, `write_discounts`
Parameters
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | store | string | yes | — | Store domain (e.g., mystore.myshopify.com) | | format | string | no | human | Output format: `human` or `json` | | dry_run | bool | no | true | Preview the codes that would be created without executing mutations | | prefix | string | yes | — | Prefix for every generated code (e.g., `GIVEAWAY` produces `GIVEAWAY-A4F2X9`) | | count | integer | yes | — | Number of unique codes to generate (max 1000 per run) | | value_type | string | yes | — | Discount type: `percentage`, `fixed_amount`, or `free_shipping` | | value | float | conditional | — | Numeric value: percent off (1–100) for `percentage`; currency amount for `fixed_amount`; ignored for `free_shipping` | | usage_limit | integer | no | 1 | How many times each individual code can be redeemed | | starts_at | string | no | now | ISO8601 datetime when codes become valid | | ends_at | string | no | — | ISO8601 datetime when codes expire (omit for no expiry) | | applies_to | string | no | order | Code applies to: `order` (entire order) or `shipping_only` (with `free_shipping` value type) |
Safety
> ⚠️ Step 1 executes one `discountCodeBasicCreate` mutation per generated code. Once created, codes appear immediately in Shopify Admin and become redeemable at `starts_at`. Codes cannot be deleted in bulk via the Admin API — they must be removed individually with `discountCodeDelete`. Run with `dry_run: true` to confirm the count, prefix, and value before committing. The default is `dry_run: true`. For high counts (>100), confirm `usage_limit` matches intent — a single high-limit code is usually preferable to N single-use codes if uniqueness per recipient is not required.
Workflow Steps
1. Generate `count` unique random suffixes (6 alphanumeric uppercase characters per suffix). Concatenate as `<prefix>-<suffix>`. Validate no in-memory duplicates and no length > 32.
2. **OPERATION:** `discountCodeBasicCreate` — mutation (one call per code) **Inputs:** `basicCodeDiscount.title: "<prefix> bulk generation <date>"`, `basicCodeDiscount.code: <generated_code>`, `basicCodeDiscount.startsAt: <starts_at>`, `basicCodeDiscount.endsAt: <ends_at>`, `basicCodeDiscount.usageLimit: <usage_limit>`, `basicCodeDiscount.appliesOncePerCustomer: true`, `basicCodeDiscount.customerGets.value`: percent / fixed-amount / free-shipping union per `value_type`, `basicCodeDiscount.customerGets.items.all: true`, `basicCodeDiscount.customerSelection.all: true` **Expected output:** `codeDiscountNode.id`, `codeDiscountNode.codeDiscount.codes.edges[0].node.code`, `userErrors`
GraphQL Operations
# discountCodeBasicCreate:mutation — validated against api_version 2025-01
mutation PromoCodeCreate($basicCodeDiscount: DiscountCodeBasicInput!) {
discountCodeBasicCreate(basicCodeDiscount: $basicCodeDiscount) {
codeDiscountNode {
id
codeDiscount {
... on DiscountCodeBasic {
title
startsAt
endsAt
usageLimit
appliesOncePerCustomer
codes(first: 1) {
edges {
node {
code
}
}
}
customerGets {
value {
... on DiscountPercentage {
percentage
}
... on DiscountAmount {
amount {
amount
currencyCode
}
}
... on DiscountOnQuantity {
effect {
... on DiscountPercentage {
percentage
}
}
}
}
}
}
}
}
userErrors {
field
message
code
}
}
}Session Tracking
**Claude MUST emit the following output at each stage. This is mandatory.**
**On start**, emit:
╔══════════════════════════════════════════════╗ ║ SKILL: Promo Code Bulk Generator ║ ║ Store: <store domain> ║ ║ Started: <YYYY-MM-DD HH:MM UTC> ║ ╚══════════════════════════════════════════════╝
**After each step**, emit:
[N/TOTAL] <QUERY|MUTATION> <OperationName>
→ Params: <brief summary of key inputs>
→ Result: <count or outcome>If `dry_run: true`, prefix every mutation step with `[DRY RUN]` and do not execute it.
**On completion**, emit:
For `format: human` (default):
══════════════════════════════════════════════ PROMO CODE BULK GENERATION Prefix: <prefix> Codes requested: <n> Codes created: <n> (or "skipped — dry_run") Value type: <type> Value: <amount> Usage limit/code: <n> Valid: <starts_at> → <ends_at> Errors: <n> Output:
Community-maintained AI agent skills for operating Shopify stores — workflows, optimization, reports and more
Other skills on shopify-admin-skills.
- /shopify-admin-agentic-crawler-access
Edit the theme's robots.txt.liquid to explicitly allow AI crawlers (GPTBot, ClaudeBot, PerplexityBot, Google-Extended, OAI-SearchBot, Amazonbot) so AI assistants are permitted to read the catalog.
Open skill - /shopify-admin-agentic-description-enrichment
Rewrite thin product descriptions into structured, fact-rich copy (materials, fit, use-cases, the words shoppers actually type) so AI agents have something concrete to quote and match.
Open skill - /shopify-admin-agentic-image-alt-text
Generate and set descriptive alt text on product images so AI agents (which can't 'see' pixels) can understand and recommend what each product looks like.
Open skill - /shopify-admin-agentic-llms-txt
Generate and publish an /llms.txt guide (brand summary, flagship products, key policies, contact) via a theme template so AI assistants get a curated, machine-readable map of the store.
Open skill - /shopify-admin-agentic-metafields-setup
Define and populate agentic-commerce metafields (material, attributes, key features, specs, sizing) so AI agents can filter and match products to specific shopper requirements.
Open skill - /shopify-admin-agentic-organization-schema
Inject an Organization JSON-LD block (name, logo, sameAs social links, contactPoint) into the theme so AI agents can verify the store is a real, trusted brand and link it to its public identity.
Open skill

