Batch/bulk coupon generation through API?

trevorcoopertrevorcooper Registered Users Posts: 2 Beginner grinner
I've already created an Illustrator template/xml data file to add unique coupon codes to the template using Illustrator data drive graphics so I can print coupons with the generated codes. Is there a method in the API to generate the coupons in my SM Pro account?

Thanks,
Trevor Cooper
trevorcooper.smugmug.com

Comments

  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited February 28, 2010
    G'day Trevor,

    There isn't any coupons methods currently, but I've just finished implementing them, so they will most likely go with the next release.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited March 6, 2010
    API support for coupons is live now thumb.gif
    David Parry
    SmugMug API Developer
    My Photos
  • Stretch240sxStretch240sx Registered Users Posts: 24 Big grins
    edited September 8, 2010
    Exactly how do you make batch coupon codes? I tried searching but couldn't find anything.
    1904Photography.smugmug.com
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited September 9, 2010
    Exactly how do you make batch coupon codes? I tried searching but couldn't find anything.

    Hey Stretch,

    We don't have a bulk method for coupon creation per se, but it should be easy enough to make single requests to smugmug.coupons.create.

    Let me know if you hav any questions.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • gulfcoastshootergulfcoastshooter Registered Users Posts: 10 Big grins
    edited November 2, 2010
    I've already created an Illustrator template/xml data file to add unique coupon codes to the template using Illustrator data drive graphics so I can print coupons with the generated codes. Is there a method in the API to generate the coupons in my SM Pro account?

    Thanks,
    Trevor Cooper
    trevorcooper.smugmug.com

    Trevor, now that the feature has been added, wondering if you know if anyone's taken advantage of it to create a bulk coupon generator. I've looked in the tools section, but haven't found anything. Want to drop coupons in with my print packages for athletics team photos, but it's been one-by-one and I've worn out fast.
  • gulfcoastshootergulfcoastshooter Registered Users Posts: 10 Big grins
    edited November 25, 2010
    Well, I did it. I created a script and a workflow to produce coupons in bulk. I've used it to create hundreds of coupons at once in about 2 minutes, and have been using it for a month or two.

    The flow is essentially done by creating a spreadsheet with columns for each of various fields one can complete on a coupon page, then writing a text concatenation formula in Excel to build that out into a long URL in the same row of the spreadsheet, just in another column, of course. I use random.org's string generation service to create random codes (with some care to help customers differentiate between zeros and letter "O", etc.).

    The URL also includes a hashtag and session ID that gets inserted within a minute or so of running the script so that I'm still within a login window at smugmug, required if you want smugmug to believe you are who you claim to be. I used the "rest" protocol since it was easier to build into a string, or seemed to be.

    And then I wrote an AppleScript script to feed the URLs to Safari line by line -- the act of asking the browser to open that URL causes smugmug to create the coupon.

    I used a couple of utilities to test things out.
    XML-RPC_Client lets you build your parameters and displays in detail what you're getting back so you can see error codes and verify results. It was important not to botch these, since you can't delete coupons from smugmug. The testing helped.

    The last step was for me to print coupons to physically include in portraits packages or sports team orders or to give as premiums when I'm pre-selling other products (books and DVDs) at an event and want to drive people to my photos as well. There are a couple of sites that offer credit-card sized die-cut 8.5x11" sheets that will feed into a laser printer. One is BlanksUSA's club cards, which are plain paper, and the other are RealCard's plasticized 3-up and 8-up cards. Lots of options to print on the card, around the card, on a placard next to the card, etc. By using Excel for the coupon generation, it simplifies mail merging and thus the printing of coupons.

    If there is community interest in my writing up a detailed tutorial with sample files, let me know.
  • Mike JMike J Registered Users Posts: 1,029 Major grins
    edited May 6, 2011
    Well, I did it. I created a script and a workflow to produce coupons in bulk. I've used it to create hundreds of coupons at once in about 2 minutes, and have been using it for a month or two.

    The flow is essentially done by creating a spreadsheet with columns for each of various fields one can complete on a coupon page, then writing a text concatenation formula in Excel to build that out into a long URL in the same row of the spreadsheet, just in another column, of course. I use random.org's string generation service to create random codes (with some care to help customers differentiate between zeros and letter "O", etc.).

    The URL also includes a hashtag and session ID that gets inserted within a minute or so of running the script so that I'm still within a login window at smugmug, required if you want smugmug to believe you are who you claim to be. I used the "rest" protocol since it was easier to build into a string, or seemed to be.

    And then I wrote an AppleScript script to feed the URLs to Safari line by line -- the act of asking the browser to open that URL causes smugmug to create the coupon.

    I used a couple of utilities to test things out.
    XML-RPC_Client lets you build your parameters and displays in detail what you're getting back so you can see error codes and verify results. It was important not to botch these, since you can't delete coupons from smugmug. The testing helped.

    The last step was for me to print coupons to physically include in portraits packages or sports team orders or to give as premiums when I'm pre-selling other products (books and DVDs) at an event and want to drive people to my photos as well. There are a couple of sites that offer credit-card sized die-cut 8.5x11" sheets that will feed into a laser printer. One is BlanksUSA's club cards, which are plain paper, and the other are RealCard's plasticized 3-up and 8-up cards. Lots of options to print on the card, around the card, on a placard next to the card, etc. By using Excel for the coupon generation, it simplifies mail merging and thus the printing of coupons.

    If there is community interest in my writing up a detailed tutorial with sample files, let me know.
    Just stumbled across. I interested in more details but I'm afraid I may be out of luck as I'm on a PC.
    Mike J

    Comments and constructive criticism always welcome.
    www.mikejulianaphotography.com
    Facebook
  • stevewest15stevewest15 Registered Users Posts: 9 Beginner grinner
    edited May 25, 2011
    Hi David,

    Is there any way to script so we can mass generate coupons quickly and easily?

    Before moving to smugmug, we used to simply used to be able to mass generate 2,000+ coupons in a matter of seconds (see attachement). Can this be done via the API? If so do you know or recommend someone who we can commission to build this capability via an app or custom script?

    Best Regards,

    SW
  • kevinikevini Registered Users Posts: 16 Big grins
    edited February 11, 2012
    Creating coupons looks easy enough, but how to do REMOVE old coupons? There should be a delete method in the 1.3 API as well as the create api.
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited February 13, 2012
    kevini wrote: »
    Creating coupons looks easy enough, but how to do REMOVE old coupons? There should be a delete method in the 1.3 API as well as the create api.

    G'day Kevin,

    Because coupons have potentially been used in orders we don't allow their removal. You can disable them by setting the 'Enabled' parameter to false.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
Sign In or Register to comment.