diff --git a/commerce_coupon.api.php b/commerce_coupon.api.php
index 449abf6..a709c9e 100644
--- a/commerce_coupon.api.php
+++ b/commerce_coupon.api.php
@@ -200,3 +200,21 @@ function hook_commerce_coupon_value_display_alter($output, $coupon, $order) {
     $output = t('Discount coupon');
   }
 }
+
+
+/**
+ * Alter a generated coupon code.
+ *
+ * @param string $code
+ *   The generated coupon code.
+ * @param string $type
+ *   Coupon type.
+ * @param int $length
+ *   Optional The length of the new code.
+ * @param bool $alphanumeric
+ *   Optional Set to TRUE to use alphanumeric characters.
+ */
+function hook_commerce_coupon_generate_coupon_code_alter(&$code, $type, $length, $alphanumeric) {
+  // Split the code into chunks of 4 chars, separated by a dash "-".
+  $code = substr(chunk_split($code, 4, '-'), 0, -1);
+}
diff --git a/commerce_coupon.module b/commerce_coupon.module
index 7e85acd..61cf60c 100644
--- a/commerce_coupon.module
+++ b/commerce_coupon.module
@@ -691,7 +691,6 @@ function commerce_coupon_commerce_checkout_pane_info() {
     'locked' => FALSE,
   );
 
- 
   return $panes;
 }
 
@@ -702,7 +701,7 @@ function commerce_coupon_commerce_checkout_pane_info() {
  *   Coupon type.
  * @param int $length
  *   Optional The length of the new code.
- * @param $alphanumeric
+ * @param bool $alphanumeric
  *   Optional Set to TRUE to use alphanumeric characters.
  *
  * @return string
@@ -741,6 +740,9 @@ function commerce_coupon_generate_coupon_code($type, $length = NULL, $alphanumer
       $code .= $characters[$rand_index];
     }
 
+    // Allow other module to change to code i.e. introduce a pattern.
+    drupal_alter('commerce_coupon_generate_coupon_code', $code, $type, $length,$alphanumeric);
+
     // Check in the database if the generated code is already defined.
     if (commerce_coupon_code_exists($code) == FALSE) {
       $code_found = TRUE;
