As an administrator go to Account and Settings, and select the E-commerce tab to create your coupon.
You can type the code name (1), specify the period that this coupon can be valid (2), how much discount this coupon will offer (3) and how many times this coupon can be used in total (4).
If you leave the field " Valid for courses" empty, then this coupon can be used for all the courses in your portal (5), groups (6), and categories (7). If you enter the name of the course, then it can be only redeemed when a learner decides to purchase the specific course. The "valid for groups" option, allows you to select only groups with a price assigned, while the "valid for categories" allows you to select only categories with a price assigned. If you have no priced groups or categories in your portal, no group/category will show up as a result, in the dropdown list.
Share with your learner the coupon code, and when they are ready to purchase a course, they can redeem the code. By clicking to validate (7) the final price will show up on the screen (8), since the discount is applied directly to this transaction.