Discussing APIs and development related to customers, discounts, and order management.
I want to generate discount codes in our shop every day, on average 24,000 codes every day.
I see there's a discount code creation job endpoint https://shopify.dev/docs/api/admin-rest/2024-01/resources/discountcode#post-price-rules-price-rule-i... but it only allows for 100 codes per job and only allows for 1 job simultaneously. I was thinking to generate the codes in these 100 code batches, but the job requires polling to check that the codes are successfully created. I'm afraid this will eat in to our API limits.
What's the best way to generate 24k codes every day in an efficient manner without crossing the API rate limiting thresholds?
Hi Tamang4,
Are the discounts all for the same value/ have the same rules? If so, it would likely be easier/ more efficient to use the `discount
Liam | Developer Advocate @ 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 Shopify.dev or the Shopify Web Design and Development Blog