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

Create a Batch of Mailchimp Promo Codes From an Excel Workbook

The Scenario

You are a marketing coordinator at a retail brand. The anniversary sale campaign is three weeks away. Your job: generate 500 unique 15%-off promo codes in Mailchimp's connected store, then hand the list to the customer support team so they can distribute them manually to VIP customers who call in.

You have never touched Mailchimp's promo code API. The support team needs the list by Friday.

It is Monday.

The bad version of this week:

  • You look up Mailchimp's promo code documentation and find you need a promo rule first, then individual codes under it
  • You create the promo rule manually in the Mailchimp UI
  • You try to find a "bulk generate" button and discover it does not exist
  • You start creating codes one at a time in the UI — after 20 minutes you have 12 of 500
  • You ask your developer to write a script, who says they can look at it Thursday
  • Friday comes and you hand the support team 0 codes because the script is still being tested.

The fast version is one prompt.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent inside your workbook that reads your promo code strings from the Codes tab, creates each one in Mailchimp under the right promo rule, and writes the Mailchimp code ID back per row.

Open the SheetXAI sidebar and type:

Create a promo rule in Mailchimp store ID in cell A1 for 15% off all orders, enabled with no minimum order value. Then read the promo code strings in column A of the Codes tab and create each as a promo code under that rule. Write the Mailchimp promo code ID into column B for each row.

SheetXAI creates the promo rule, reads all 500 code strings from the Codes tab, calls the Mailchimp API for each one, and writes the Mailchimp promo code ID back to column B. No UI clicking, no developer, no waiting until Thursday.

What You Get

500 rows in the Codes tab, with column B confirming each code was created:

  • Mailchimp promo code ID — the code exists in Mailchimp and is ready for use
  • ERROR — the specific failure for any row: duplicate code string, invalid store ID, promo rule not found

The support team gets the list Monday afternoon. They can copy the code strings from column A and start distributing. Column B is your audit trail confirming each code is live in Mailchimp.

What If the Data Is Not Quite Ready

Promo code batches have wrinkles. SheetXAI handles them in the same prompt.

When the promo rule already exists and you just want to add codes to it

You created the rule last week. You do not want a duplicate rule.

Read the promo code strings in column A of the Codes tab and create each as a promo code under the existing promo rule ID in cell B1 of Mailchimp store ID in cell A1. Set each code as enabled. Write the Mailchimp promo code ID into column B for each row, or ERROR with the reason if it fails.

When you want different discount percentages per code

The campaign has two tiers: 10% off for standard customers and 20% off for Platinum VIPs. Both sets of codes are in the Codes tab, with the tier in column B.

For each row in the Codes tab, read the promo code string in column A and the discount percentage in column B. Create a separate promo rule for 10% off and another for 20% off in Mailchimp store ID in cell A1. Assign each code to the correct rule based on column B. Write the Mailchimp promo code ID into column C.

When some code strings have trailing whitespace or mixed case

The codes were generated by a system that sometimes adds a trailing space or outputs in mixed case. Mailchimp code strings should be uppercase and trimmed.

Before creating promo codes, normalize each code string in column A of the Codes tab: convert to uppercase and strip leading and trailing whitespace. Then create each code in Mailchimp store ID in cell A1 under promo rule ID in cell B1. Write the Mailchimp promo code ID into column B.

When you want to verify which codes are already in Mailchimp before creating new ones

You ran a partial batch last week and are not sure which codes were successfully created.

For each promo code string in column A of the Codes tab, check whether it already exists under promo rule ID in cell B1 in Mailchimp store ID in cell A1. If it exists, write ALREADY_EXISTS into column B. If it does not exist, create it and write the new Mailchimp promo code ID into column B.

The pattern: pull the existing state first, then create only what is missing. You avoid duplicates without having to track the batch manually.

Try It

Get the 7-day free trial of SheetXAI and put your promo code strings in column A of an Excel workbook, then ask it to create them all in Mailchimp. The Mailchimp integration is included in every plan. For related workflows, see how to import historical orders into a Mailchimp store from Excel or the Mailchimp in Excel overview.

Stop memorizing formulas.
Tell your spreadsheet what to do.

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

Learn more