Create coupon action

This action lets you create a coupon via the WooCommerce integration. Use it to automate you daily work and save time and resources.

How to create a coupon

This section aims to help you getting started on how to create a coupon via WooCommerce. Simply select one of your prefered automation manuals down below and start automating your WordPress website in no time.

"Create coupon" arguments

Our so-called arguments are values that you can use to customize your request. They allow you to send specific data to the Create coupon action which is then handled accordingly to the described purpose. You can use the arguments that you would like to send values for.
To learn more about it, please see the Setup Guide above.
coupon_code *

The code that your customers can use during checkout.

type

The coupon type.

amount

The discount amount of the coupon code, based on the selected type.

individual_use

Set this to yes if the coupon cannot be used in conjunction with other coupons. Default: no

product_ids

Add IDs of products in case you want to apply the coupon code only to specific products. This argument accepts a comma-separated string, as well as a JSON construct.

exclude_product_ids

Add IDs of products that you want to exclude from the coupon code. This argument accepts a comma-separated string, as well as a JSON construct.

usage_limit

Set a number if you want to limit the coupon to be used a limited amount of times only. Default: 0 (unlimited)

usage_limit_per_user

Set a number to define whether a user can use the coupon code multiple times. Default: 0 (unlimited)

limit_usage_to_x_items

Define a maximum number of products this coupon can be applied to for each cart. Default: 0 (unlimited)

usage_count

A number that shows how often the code has been already used.

expiry_date

A date when the coupon code expires. Leave empty to never expire it.

enable_free_shipping

Set this to yes to enable free shipping. Default: no

product_category_ids

Add the category IDs you want to add to the coupon. This argument accepts a comma-separated string, as well as a JSON construct.

exclude_product_category_ids

Add the category IDs you want to exclude to the coupon. This argument accepts a comma-separated string, as well as a JSON construct.

exclude_sale_items

Set this to yes to prevent the coupon being applied to items on sale. Default: no

minimum_amount

Set a minimum amount that need to be reached before the coupon can be applied.

maximum_amount

Set a maximum amount of which the coupon can be applied to.

coupon_emails

Add one or multiple emails to the coupon. Only the users with those emails can redeem the code. This argument accepts a comma-separated string, as well as a JSON construct.

description

Add a coupon author. This field accepts a user id.

replace

Set this to yes to replace the existing user_ids. If set to no, the user_ids are appended to the existing ones. Default: no

do_action

Advanced: Register a custom action after Webhooks Pro fires this webhook. More infos are in the description.

wpwh_call_action

(String) Register a custom WordPress hook callback. The value will be called as followed: do_action( $yourdefinedaction, $action_return_data, $request_data )

Connection examples

Get inspired on how to use the "Create coupon" action within our WooCommerce integrations. Down below you will find various examples with our other integrations.
When a ticket was reopened via The Fluent Support Logo for our WP Webhooks integration Fluent Support, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When a form was submitted via The Gravityforms Logo for our integration Gravity Forms, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When a custom link was clicked via The WP Webhooks Logo for our WP Webhooks integration WP Webhooks, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When broken links have been detected via The Broken Link Checker Logo for our WP Webhooks integration Broken Link Checker, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When an item was approved via The ProjectHuddle Logo for our WP Webhooks integration ProjectHuddle, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When a quiz was completed via The LearnDash Logo for our WP Webhooks integration LearnDash, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When a booking was cancelled via The Events Manager Logo for our WP Webhooks integration Events Manager, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When a membership has expired via The Paid Membership Pro Logo for our WP Webhooks integration Paid Memberships Pro, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When a file was downloaded via The Easy Digital Downloads Logo for our integration Easy Digital Downloads, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When a membership was cancelled via The WooCommerce Memberships Logo for our WP Webhooks integration WooCommerce Memberships, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When an ACF comment field was updated via The Advanced Custom Fields Logo for our WP Webhooks integration Advanced Custom Fields, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When a user started following a user via The wpDiscuz Logo for our WP Webhooks integration wpDiscuz, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When a plugin was deleted via The WordPress Logo for our integration WordPress, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When an affiliate status was changed via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When a shortcode was called via The WordPress Logo for our integration WordPress, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When a course access was granted via The LearnDash Logo for our WP Webhooks integration LearnDash, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When an ACF post field was updated via The Advanced Custom Fields Logo for our WP Webhooks integration Advanced Custom Fields, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When the database cache was cleared via The W3 Total Cache Logo for our WP Webhooks integration W3 Total Cache, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When a Make (Integromat) HTTP request was received via The Make (Integromat) Logo for our WP Webhooks integration Make (Integromat), create a coupon via The Woocommerce Logo for our integration WooCommerce.
When a product was restored via The Woocommerce Logo for our integration WooCommerce, create a coupon via The Woocommerce Logo for our integration WooCommerce.
When an assignment was uploaded via The LearnDash Logo for our WP Webhooks integration LearnDash, create a coupon via The Woocommerce Logo for our integration WooCommerce.

More available WooCommerce endpoints

Discover more of the available endpoints used for the WooCommerce integration.
To learn more about a specific endpoint, simply click on it.
Full disclosure: When clicking on some of the links on our website and purchasing the related product and/or service, we may earn a commission free of any additional cost for you.