Price Rules API now supports bulk discount code creation

Highlighted
Shopify Staff
Shopify Staff
275 0 42

Hey everyone,

We’re very excited to announce that as of September 28th, 2017, Shopify API supports bulk discount code creation. With the introduction of bulk discounts, we will allow a single price rule to be associated with multiple discount codes. Therefore, an app that wishes to create multiple discount codes for a single price rule can perform additional independent API calls for each discount code they wish to create.

Furthermore, we now support the ability to create multiple discount codes in a single request via a new batch bulk discount endpoint. To learn more about creating bulk discount codes, please see the API reference here

Please note, bulk discount code creation is only possible via the API. There is no way to create bulk discount codes via the Shopify admin.

 

If you have any questions or need further clarification, don't hesitate to comment in the thread below.

 

Happy coding,

 

 

Jordan L

Developer Experience

Shopify

1 Like
Shopify Expert
3841 0 270

While you're at it, don't forget to fix the API so that when discounts are used for orders, they report correctly with the items they discounted. Without that, API orders are not reporting correct prices, which of course is a little underwhelming from an accounting perspective!

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
1 Like
Shopify Partner
26 0 7

+1, I also would REALLY love to know what items were discounted. What sucks is that it’s done right with POS and Shopify Scripts but not Discount Codes. :/

0 Likes
Trailblazer
636 0 87

Same here. Would like to figure out the discount amount allocated to each item.

0 Likes
New Member
2 0 0

Hi Jordan,

API call 101 question, but how can I create a Price Rule that only goes into effect with the application of a discount code? From there I hope I can bulk add the codes I want to use via the price rule method you listed. (Goal is to add in about 3,000 codes in batches of 100 to a single price rule)

0 Likes
New Member
2 0 0

Trying to create abotu 1000 discount codes! How & Where do I add this? Help!

0 Likes

This may help you:

https://ecommerce.shopify.com/c/api-announcements/t/price-rules-api-now-supports-bulk-discount-code-...

Shopify developer, consultant, and project manager
0 Likes
New Member
1 0 0

Is there a way to bulk EDIT discount codes as well?

0 Likes

Shopify used to have a bulk discount code app, but it was moved to a third party.  https://apps.shopify.com/bulk-discounts

You can also program them yourself, using the Shopify API:

https://help.shopify.com/api/reference/discountcode

 

To summarize, you can use the API to batch create codes, as well as set up price rules (ie. based on a formula).  Otherwise, you can use the batch discount app.

Shopify developer, consultant, and project manager
0 Likes
New Member
4 0 0

Feature request: could we have `ends_at` for each `DiscountCode`, rather than at the `PriceRule` level? This will allow us to implement rolling expiry dates, i.e. creating DiscountCodes that expire '10 days from now' rather than on '10 May', without creating a price rule for each discount code.

0 Likes