Multiple unique discount codes for one price rule

tien3181
New Member
1 0 0

Hello,

It is to my understanding that first I have to create a price rule before actually creating the discount code. My question is if I want to create 20 unique code for 20 customer, do i have to create 20 price rule then create a discount code with each of the price rule or i can create 1 price rule and create 20 discount code with that price rule

Note that I am aware of the discount code creation job but it is still in Beta (https://help.shopify.com/api/reference/discountcode#batch_create)

I have also see a few topic on this one but that was 6 months ago and I don't know if the answer is still the same

https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/create-multiple-discount-codes-refer-t...

https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/multiple-discount-codes-for-one-price-...

Replies 5 (5)
Josh
Shopify Staff
Shopify Staff
1134 84 233

Hey there, 

As long as the discount codes will have the same discounting criteria (discount amount, products discounted, etc.) you can create more than one discount code per price rule now. 

While it is still in beta, I would wholeheartedly recommend giving the batch discount code job a try that you had linked to - it's pretty fantastic if I dare say so myself. You can create the discount codes one at a time if you want to as well, though.

If you do happen to run into any issues with the batch process, feel free to provide your feedback here!

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

ChrisPela
New Member
1 0 0

ETA on when the documentation will be updated?

gcappellotto
New Member
2 0 0

Actually the docs say everywhere that:

It is recommended to use the same value for code as the associated price rule title since only the title is searchable in the Shopify admin. For example: price_rule.title = ABC123 and discount_code.code = ABC123

So from the doc, I guess that it's better to keep a 1-1 relationship between discounts and price rules.

Josh
Shopify Staff
Shopify Staff
1134 84 233

Hey Giovanni, 

That is leftover in our docs from when price rules and discount codes were always a 1-1 relationship, and a price rule couldn't support more than one discount code.

When batch creating multiple codes, the codes won't have the same value so that comment isn't as relevant anymore - but batch creation is also still in beta. I'm sure that once it is fully rolled out, you'll see that documentation changed accordingly. 

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

ClementBR
Shopify Partner
139 2 40

The documentation still states to this day to "Use the same value for code as the title property of the associated price rule.".

 

Have the docs still not been updated for a reason?