Development discussions around Shopify APIs
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
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
ETA on when the documentation will be updated?
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.
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
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?
User | RANK |
---|---|
10 | |
4 | |
3 | |
3 | |
3 |
We're excited to announce improvements to the threaded messaging experience in our communi...
By TyW May 31, 2023Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023