Skip to content

Use Stripe coupons with Gravity Forms

Gravity Forms has a Stripe add-on that allows you to charge your users at form submission using your account, but this add-on doesn’t support (currently) coupons created at your Stripe account.

Gravity Forms has a also its own Coupons add-on. Using this add-on you can create a workaround for the mentioned limitation of the Stripe add-on.

Basically we’re going to use the coupon at, a coupon created in the Gravity Forms Coupons add-on with the same name and discount, and a little snippet of code. Simply follow the steps below.

Create the coupon in Gravity Forms

Go to Forms -> Coupons menu and create your coupon.

Gravity Forms Coupon Example
Gravity Forms Coupon Example

If you already have the coupon created at your account make sure you use in the Coupon Code field the same value you used in ID (Code) at your account.

Obviously you will want to add a Coupon field to your form to allow the user enter the coupon code before submitting the form.

Create the coupon at your account

If you already have the coupon created in your account you can skip this step, if not, go to Subscriptions -> Coupons in your and create the coupon.

Stripe Coupon Example
Stripe Coupon Example

Make sure to use in ID (Code) the same value you used in Coupon Code field in Gravity Forms.

Use a filter to override the payment amount sent to

If you’re not using the form total as payment amount in  your feed, you can skip this step.

Assuming that you’re using the Form Total as recurring amount in your Stripe add-on subscription feed. As the Gravity Forms Coupons add-on applies the discount to the form total, you will want to alter the amount passed to to prevent the discount from being applied two times, one by the Coupons add-on and then by

To do this you can use the first example snippet in the doc page for gform_submission_data_pre_process_payment filter, you can find it below with some extra lines to log the process with logging enabled if you have any issue:

If you did all steps above as explained, now the Gravity Forms Coupons add-on will apply the discount to your form and entry. Then the original amount for the Total field, without the discount, will be passed to and there the Stripe coupon will be applied.

You’re done :)

By the way, note that although we’re using the above snippet to pass the form total without a discount to in this use case, you can use the snippet also to alter the payment amount passed to any other payment add-on based on the Add-on Framework.

Published inGravity Forms


  1. Daniele Daniele

    Hi Samuel,

    Thanks for this!
    But it’s not clear to me where you send the Gform coupon to Stripe.
    Is it automatically added to the payment request by the Gform Stripe add-on?


  2. Adam Winchester Adam Winchester

    Hi Samuel

    Thanks for your post.

    What if I have a custom Stripe coupon which gives a 100% discount for the first 4 months of a subscription and then continues at the regular rate for the balance of 12 months?



Leave a Reply

Your email address will not be published. Required fields are marked *