How to apply coupon in commerce order programmatically?
When you are creating a discount, you will enter the name and the system will automatically generate machine-name. You need to use the machine name as an argument for commerce_discount_fixed_amount() function.

Here's a screenshot:



Here's how you would use it:

commerce_discount_fixed_amount(EntityDrupalWrapper $wrapper, 'discount_test_discount');