- This topic is empty.
-
AuthorPosts
-
November 6, 2012 at 8:12 am #9238David HoangKeymaster
Using the Shopify API, is there a way to creation promotions for your store? If not, is there a way to programmatically create promotions in Shopify? (short of using CURL posts to the admin)
That is, I can create a promotion by hand using the admin and navigating to the
Promotions
and clicking theAdd a discount code
link. I’d like to be able to do the same thing programmatically, or to know for certain this isn’t possible. I don’t see any obvious method on the api list, but it seems like something should be an API method.November 6, 2012 at 10:55 am #9241David HoangKeymasterThere is no way to create discounts via the API.
If you want we have made an application that can be used to create discount codes.
Otherwise you can use a tool like Mechanize to automate coupon creation for you, but keep in mind theres a good chance that any time in the future it will break since we don’t make any promises to keep our admin the same in the future. Any changes have a good chance of breaking whatever script you’d end up writing.
February 26, 2013 at 8:14 am #9242David HoangKeymasterUnfortunately they don’t allow it… I resorted to creating an interface to do so, though:
https://github.com/MartinAmps/Shopify-Private-APIs
Hope it helps
Edit
I also created a blog post about it.
May 10, 2014 at 9:43 am #9239David HoangKeymasterIf you’re familiar with
Rails
or you’re already usingActiveResource
for your Shopify API calls, then you can drop in this modified version ofDiscount < ActiveResource::Base
https://gist.github.com/choonkeat/09a56da222f506e627c5June 1, 2017 at 9:14 am #9240David HoangKeymasterThe Price Rules API is now public and allow any app to create price rules and discount codes.
-
AuthorPosts
- You must be logged in to reply to this topic.