Hi! We would like to generate many discounts codes that have identical attributes (e.g. value, entitled products, allocation method, limits etc.) but different valid dates. The validity should be 7 days, starting with the date of the creation of the code.
I checked both the price rule APIs as well as the discount APIs, but could find no easy way to do this.
https://shopify.dev/docs/api/admin-rest/2024-01/resources/pricerule
https://shopify.dev/docs/api/admin-rest/2024-01/resources/discountcode
The only thing that I could imagine is use a new price rule every day - that is create a new price rule every day, set the “end_at” date 7 days in the future, and use the new price rule for creating discounts on that day. But that seems needlessly complex.
Does anyone have a better idea?
Thanks in advance
Best.