If you would like a discount to be applied to the total price, based on the presence of a valid coupon code you can do this using "Conditional Logic" to change the value of a "Discount" field. Together with a "Calculated" value for a "Total Price" field. Below is a basic example:
The "Total Price" field on this form has a calculated value defined which is:
[Discount Field] + [Product Field]
The conditional logic settings for determining the value of the "Discount Field" are:
"Percentage" Discounts
To treat the discount as a fixed value discount, in our "Price Field" calculation we just change our equation to treat the number in the discount field as a percentage discount rather than a fixed price discount. So the calculated field equation for total price is now changed to:
[Product Field] * (100 - [Discount Field]) / 100
And to keep the equation simple like above, we also change the conditional logic values above to use positive numbers as the percentage discount (0 and 10) rather than 0 and minus 10 which was more user friendly for "Fixed Price" discount calculations.
Restricting The Number of Times a Coupon Is Used
If you would like to restrict the usage of the coupon to a certain number for a form, (e.g. only first 20 people are allowed to use the coupon), you can enforce this by specifying Field-Level "Quantity Limits".
Alternatively, for greater control over coupon codes, (for example being able to insist that a coupon code is only allowed to be used once), you can use the "Private logic" feature in the form editor, together with "Private Data Lists" to store your list of valid coupons.