Passing Promo Code to Drupal Commerce via URL I'm using Drupal 7 and Drupal Commerce Module. I'd like to be able to provide customized links with promo codes in them (promo codes would be a key/value pair in a format like www.url.com/?promo=specialK or some such thing). So Group A, for example, would get their link and click on it and it would bring them to our Registration/Product page form. 

This would be the same form for every group with different discounts applied to the product price depending on the promo code attached to the URL.

If the promo is expired I'd like Drupal to just give the user a page that says something like 'Your promo is expired. Sorry. blah blah blah.' However, if the promo is NOT expired it would just apply the discount to the price and let them fill out the rest of the form and submit their payment information, etc > the normal drupal commerce procedure with the discount applied.

I'm thinking of approaching this with Drupal Coupon module to enable the discounting functionality, but I don't know if it's possible to use a URL to pass that promo code automatically to Commerce. Does anyone know?
There are a number of ways you could do this. Probably the best way is to use a custom module, define a menu path with a token, and do it all in PHP. But I live mostly in the GUI world. You could also do this using Rules.

I have done something similar in a 10 minute youtube video that describes how to use rules to construct a url that passes in information and does things (like adding a product to a cart, or in your case you could use it to add a discount/apply a coupon).

Video: Using Rules to create a url to add a product to cart

Step by Step


Download Rules URL Arguments 
Create a rule that fires on the event "Drupal is initializing"
Add a "Text Comparison" condition. Compare the site:current-page:path token against your first parameter "promo" for a url like "test.com/promo?coupon=123"
Add all of the actions you need to react to the rest of the parameters. In the video you'll see how to get at those parameters in the url.