Add a Free Product to Shopify Orders with Specific Discount Codes

5 min setup
No coding required
Runs automatically

Enhance your customer’s shopping experience by including a free product whenever a specific discount code is applied at checkout. This MESA workflow template automatically adds a complimentary item to the order for fulfillment, delighting customers with a special surprise. Encourage conversions and foster loyalty by offering a little extra for those who use your promotional codes.

Shopify logo icon
Order Created
Loop over the order's discount codes
Filter for a specific discount code
Shopify logo icon
Add Line Item to Order

You're in good company

"MESA has been a game changer for us. And, if you ever get stuck, their support team is always super helpful."

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
PetFriendly

"It's like Zapier but exactly designed for Shopify. I have been able to complete all the workflows that I've needed."

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
Zailys

"The MESA team has been amazing at helping us set up our automations. We would highly recommend this app!"

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
Rothy's

How it works

4 steps to start adding free products to orders when customers use specific discount codes

Shopify logo icon

Order Created

App connector: Shopify • Time to complete: 0 minutes (Auto-configured)
Why this matters: This trigger monitors your Shopify store and automatically starts the workflow every time a new order is placed, ensuring no discount code usage gets missed.

This step activates whenever a customer completes their purchase on your store. The trigger captures all order details including discount codes, line items, and customer information. No configuration is needed - it automatically connects to your Shopify store and begins monitoring for new orders. The order data gets passed to the next step for discount code analysis.

Loop over the order's discount codes

App connector: Loop • Time to complete: 0 minutes (Auto-configured)
Why this matters: This step examines each discount code applied to the order individually, since customers might use multiple codes in a single purchase.

The loop processes every discount code that was applied to the order, creating a separate workflow path for each one. If a customer used three different discount codes, this step will check each code individually to see if any match your specified criteria. The loop automatically handles orders with no discount codes, single codes, or multiple codes. Each discount code gets examined by the filter step to determine if it matches your target code.

Filter for a specific discount code

App connector: Filter • Time to complete: 1 minute
Why this matters: This filter ensures the free product only gets added when customers use your exact promotional discount code, preventing the workflow from triggering on unrelated discounts.

You'll configure this step by entering the specific discount code that should trigger the free product addition. The filter compares each discount code from the loop against your specified code using an exact match. If the codes match, the workflow continues to add the free product; if not, it stops processing that particular discount code. Enter your discount code exactly as customers will type it, including any capitalization or special characters.

Shopify logo icon

Add Line Item to Order

App connector: Shopify • Time to complete: 2 minutes
Why this matters: This action adds your chosen free product directly to the customer's order with a 100% discount, making it completely free while maintaining proper inventory tracking.

You'll select both the product and specific variant you want to add as the free item. The step automatically applies a 100% discount to make the product free, sets the quantity to 1, and adds it to the existing order without notifying the customer via email. Choose your product from the dropdown menu, then select the appropriate variant (choose "Default Title" if the product has no variants). The free item appears on the customer's order confirmation and in your Shopify admin for proper inventory management.

Ready to set this up? It only takes 5 minutes.

Our support team will even help you personalize this workflow for free.

Get started →

Make it your own!

Customize this workflow even further:

Set quantity limits
Control how many free products get added by modifying the quantity field or adding conditions to check if the free product already exists in the order.
Target multiple discount codes
Expand the filter step to check for several different promotional codes, or duplicate the workflow to handle different free products for different campaigns.
Add customer tags for tracking
Include a step to tag customers who receive free products, helping you segment these buyers for future marketing campaigns.
Send confirmation messages
Connect email or SMS steps to notify customers about their free gift, or alert your fulfillment team about orders containing promotional items.

Common questions

What happens if a customer uses the discount code multiple times in separate orders?

Will the free product affect my inventory levels?

Can I set different free products for different discount codes?

Ready to start adding free products to orders when customers use specific discount codes?

7-day free trial • 5 min setup • Cancel anytime

Need help? Our automation experts will help you personalize this workflow for free. Contact support