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 for promo codes and discover it does not exist
- You start creating codes one at a time in the UI
- After 20 minutes you have 12 codes and realize 500 is not going to happen this way
- You ask your developer to write a script, who says they can get to 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 spreadsheet that reads your promo code strings from the sheet, 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 sheet 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, then reads all 500 code strings from the Codes sheet, 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 sheet, 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 sort the sheet by column A, copy the code strings, and start distributing. Column B is your audit trail confirming each code is live in Mailchimp.
Want to write a count of successfully created codes in cell D1 so you can QA coverage at a glance? Add it to the prompt.
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 sheet 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 sheet, with the tier in column B.
For each row in the Codes sheet, 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 sheet: 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 sheet, 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 a Google Sheet, 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 or the Mailchimp in Google Sheets overview.
