The webhook actions tab

This tab contains all available webhook actions, including our available extensions. To learn more about them, please take a look at the bottom as you will see all details there.

create_user

Create a new user via webhooks.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to create_user Details
user_email
Required
This field is required. Include the email for the user.
first_name The first name of the user.
last_name The last name of the user.
nickname The nickname. Please note that the nickname will be sanitized by WordPress automatically.
user_login A string with which the user can log in to your site.
display_name The name that will be seen on the frontend of your site.
user_nicename A URL-friendly name. Default is user' username.
description A description for the user that will be available on the profile page.
rich_editing Wether the user should be able to use the Rich editor. Set it to "yes" or "no". Default "no".
user_registered The date the user gets registered. Date structure: Y-m-d H:i:s
user_url Include a website url.
role The main user role. If not set, default is subscriber. Details
additional_roles This allows to add multiple roles to a user. Details
user_pass The user password. If not defined, we generate a 32 character long password dynamically.
send_email Set this field to "yes" to send a email to the user with the data. Details
do_action Advanced: Register a custom action after the plugin fires this webhook. Details
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
data (array) User related data as an array. We return the user id with the key "user_id" and the user data with the key "user_data". E.g. array( 'data' => array(...) )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

Array
(
    [success] => 1
    [msg] => User successfully created.
    [data] => Array
        (
            [user_id] => 131
            [user_data] => Array
                (
                    [user_email] => demo_user@email.email
                    [role] => subscriber
                    [nickname] => nickname
                    [user_login] => userlogin
                    [user_nicename] => The Nice Name
                    [description] => This is a user description
                    [rich_editing] => 1
                    [user_registered] => 2020-12-11 14:10:10
                    [user_url] => https://somedomain.com
                    [display_name] => username
                    [first_name] => Jon
                    [last_name] => Doe
                    [user_pass] => SomeCustomUserpass123
                    [additional_roles] => author:add
                )

        )

)

This webhook action is used to create a user on your WordPress system via a webhook call.
The description is uniquely made for the create_user webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use create_user

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to create_user.
  2. It is also required to set an email address using the argument user_email. This should be the email address of the user you want to create.
  3. All the other arguments are optional and just extend the creation of the user. We would still recommend to set the attribute user_login, since this will be the name a user can log in with.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

delete_user

Delete a user via WP Webhooks.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to delete_user Details
user_id
Required
(Optional if user_email is defined) Include the numeric id of the user.
user_email
Required
(Optional if user_email is defined) Include the assigned email of the user.
send_email Set this field to "yes" to send a email to the user that the account got deleted. Details
remove_from_network Set this field to "yes" to delete a user from the whole network. WARNING: This will delete all posts authored by the user. Default: "no"
do_action Advanced: Register a custom action after the plugin fires this webhook. Details
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
data (array) User related data as an array. We return the user id with the key "user_id" and the user delete success boolean with the key "user_deleted". E.g. array( 'data' => array(...) )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success' => false,
    'msg'     => '',
    'data' => array(
        'user_deleted' => false,
        'user_id' => 0
    )
);
        

This webhook action is used to delete a user on your WordPress system via a webhook call.
This description is uniquely made for the delete_user webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use delete_user

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to delete_user.
  2. It is also required to set either the email or the user id of the user you want to delete. You can do that by using the user_id or user_email argument.
  3. All the other arguments are optional and just extend the deletion of the user.
  4. Please note that deleting a user inside of a multisite network without setting the remove_from_network argument, just deletes the user from the current site, but not from the whole network.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

get_users

Search for users on your WordPress website
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to get_users Details
arguments
Required
A string containing a JSON construct in the WP_User_Query notation. Details
return_only Define the data you want to return. Please check the description for more information. Default: get_results Details
do_action Advanced: Register a custom action after the plugin fires this webhook. Details
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
data The data construct of the user query. This depends on the parameters you send.
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success' => false,
    'msg'     => '',
    'data' => array()
);
        

This webhook action is used to fetch one or multiple users from your WordPress system via a webhook call.
This description is uniquely made for the get_users webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use get_users

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to get_users.
  2. It is also required to set the argument arguments, which contains a JSON formatted string with the parameters used to identify the users.
  3. All the other arguments are optional and just extend the fetching of the users.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

get_user

Returns the object of a user
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to get_user Details
user_value
Required
The user id of the user. You can also use certain other values by changing the value_type argument.
value_type You can choose between certain value types. Possible: id, slug, email, login Details
do_action Advanced: Register a custom action after the plugin fires this webhook. Details
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
data The data construct of the user qury. This depends on the parameters you send.
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success' => false,
    'msg'     => '',
    'data' => array()
);
        

This webhook action is used to fetch a single users from your WordPress system via a webhook call.
It uses the WordPress function get_user_by() to fetch the user from the database. To learn more about this function, please check the official WordPress docs:https://developer.wordpress.org/reference/functions/get_user_by/

This description is uniquely made for the get_user webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use get_user

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to get_user.
  2. It is also required to set the argument user_value, which by default is the user id. You can also use other values like the email or the login name (But for doing so, please read the next step).
  3. In case you want to use e.g. the email instead of the user id, you need to set the argument value_type to email. Further details are down below within the Special Arguments description.
  4. All the other arguments are optional and just extend the fetching of the user.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

create_post

Insert/Create a post. You have all functionalities available from wp_insert_post
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to create_post Details
post_author (mixed) The ID or the email of the user who added the post. Default is the current user ID. Details
post_date (string) The date of the post. Default is the current time. Format: 2018-12-31 11:11:11
post_date_gmt (string) The date of the post in the GMT timezone. Default is the value of $post_date.
post_content (string) The post content. Default empty. Details
post_content_filtered (string) The filtered post content. Default empty.
post_title (string) The post title. Default empty.
post_excerpt (string) The post excerpt. Default empty.
post_status (string) The post status. Default 'draft'. Details
post_type (string) The post type. Default 'post'. Details
comment_status (string) Whether the post can accept comments. Accepts 'open' or 'closed'. Default is the value of 'default_comment_status' option.
ping_status (string) Whether the post can accept pings. Accepts 'open' or 'closed'. Default is the value of 'default_ping_status' option.
post_password (string) The password to access the post. Default empty.
post_name (string) The post name. Default is the sanitized post title when creating a new post.
to_ping (string) Space or carriage return-separated list of URLs to ping. Default empty.
pinged (string) Space or carriage return-separated list of URLs that have been pinged. Default empty.
post_parent (int) Set this for the post it belongs to, if any. Default 0.
menu_order (int) The order the post should be displayed in. Default 0.
post_mime_type (string) The mime type of the post. Default empty.
guid (string) Global Unique ID for referencing the post. Default empty.
import_id (integer) In case you want to give your post a specific post id, please define it here. Details
post_category (string) A comma separated list of category IDs. Defaults to value of the 'default_category' option. Example: cat_1,cat_2,cat_3
tags_input (string) A comma separated list of tag names, slugs, or IDs. Default empty. Details
tax_input (string) A simple or JSON formatted string containing existing taxonomy terms. Default empty. Details
wp_error Whether to return a WP_Error on failure. Posible values: "yes" or "no". Default value: "no". Details
do_action Advanced: Register a custom action after the plugin fires this webhook. Details
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
data (array) User related data as an array. We return the post id with the key "post_id" and the post data with the key "post_data". E.g. array( 'data' => array(...) )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success'   => false,
    'msg'       => '',
    'data'      => array(
        'post_id' => null,
        'post_data' => null
    )
);
        

This webhook action is used to create a post on your WordPress system via a webhook call.
The description is uniquely made for the create_post webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use create_post

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to create_post.
  2. All the other arguments are optional and just extend the creation of the post. We would still recommend to set the attribute post_title, to make recognizing it easy, as well as for creating proper permalinks/slugs.

Tipps

  1. In case you want to create a post for a custom post type, you can do that by using the post_type argument.
  2. By default, we create each post in a draft state. If you want to directly publish a post, use the post_status argument and set it to publish.
  3. In case you want to set a short description for your post, you can use the post_excerpt argument.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

delete_post

Delete a post via WP Webhooks Pro.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to delete_post Details
post_id
Required
The post id of your specified post. This field is required.
force_delete (optional) Whether to bypass trash and force deletion (added in WordPress 2.9). Possible values: "yes" and "no". Default: "no". Please note that soft deletion just works for the "post" and "page" post type. Details
do_action Advanced: Register a custom action after the plugin fires this webhook. Details
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
data (array) Post related data as an array. We return the post id with the key "post_id" and the force delete boolean with the key "force_delete". E.g. array( 'data' => array(...) )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success' => false,
    'msg' => '',
    'data' => array(
        'post_id' => 0,
        'force_delete' => false
    )
);
        

This webhook action is used to delete a post on your WordPress system via a webhook call.
This description is uniquely made for the delete_post webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use delete_post

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to delete_post.
  2. It is also required to set the post id of the post you want to delete. You can do that by using the post_id argument.
  3. All the other arguments are optional and just extend the deletion of the post.
  4. Please note that deleting a post without defining the force_delete argument, only moves default posts and pages to the trash (wherever applicable) - otherwise they will be directly deleted.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

get_posts

Search for posts on your WordPress website
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to get_posts Details
arguments
Required
A string containing a JSON construct in the WP_Query notation. Details
return_only Define the data you want to return. Please check the description for more information. Default: posts Details
load_meta Set this argument to "yes" to add the post meta to each given post. Default: "no"
load_acf Set this argument to "yes" to add the Advanced Custom Fields related post meta to each given post. Default: "no"
load_taxonomies Single value or comma separated list of the taxonomies you want to addto the response. Details
do_action Advanced: Register a custom action after the plugin fires this webhook. Details
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
data The data construct of the post query. This depends on the parameters you send.
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success' => false,
    'msg'     => '',
    'data' => array()
);
        

This webhook action is used to fetch one or multiple posts from your WordPress system via a webhook call.
This description is uniquely made for the get_posts webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use get_posts

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to get_posts.
  2. It is also required to set the argument arguments, which contains a JSON formatted string with the parameters used to identify the posts. More details about that is available within the Special Arguments list.
  3. All the other arguments are optional and just extend the fetching of the posts.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

get_post

Returns the object of a user
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to get_post Details
post_id
Required
The post id of the post you want to fetch.
return_only Select the values you want to return. Default is all. Details
thumbnail_size Pass the size of the thumbnail of your given post id. Default is full. Details
post_taxonomies Single value or comma separated list of the taxonomies you want to return. Default: post_tag. Details
do_action Advanced: Register a custom action after our plugin fires this webhook. Details
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
data The data construct of the single post. This depends on the parameters you send.
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success' => false,
    'msg'     => '',
    'data' => array()
);
        

This webhook action is used to fetch a single post from your WordPress system via a webhook call. It uses the default WordPress function get_post():
https://developer.wordpress.org/reference/functions/get_post/

This description is uniquely made for the get_post webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use get_post

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to get_post.
  2. It is also required to set the argument post_id, which contains the id of the post you want to fetch.
  3. All the other arguments are optional and just extend the fetching of the post.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

custom_action

Do whatever you like with the incoming data by defining this custom action.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to custom_action Details
wpwh_identifier This value is send over within the WordPress hooks to identify the incoming action. You can use it to fire your customizatios only on specific webhooks. Details
Argument Description
custom This webhook returns whatever you define withiin the filters. Please check the description for more detials.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

//This is how the default response looks like
$return_args = array(
    'success' => false,
    'msg' => ''
);
        

This webhook action is used to fire a custom wordpress filter within your WordPress system via a webhook call. You can use it to fully cusotmize the webhook logic for your needs.
This description is uniquely made for the custom_action webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use custom_action

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to custom_action.
  2. All the other arguments are optional and just extend the custom execution of the action.

To modify your incoming data based on your needs, you simply create a custom add_filter() call within your theme or plugin. Down below is an example on how you can do that:

add_filter( 'wpwhpro/run/actions/custom_action/return_args', 'wpwh_fire_my_custom_logic', 10, 3 );
function wpwh_fire_my_custom_logic( $return_args, $identifier, $response_body ){

	//If the identifier doesn't match, do nothing
	if( $identifier !== 'ilovewebhooks' ){
		return $return_args;
	}

	//This is how you can validate the incoming value. This field will return the value for the key user_email
	$email = WPWHPRO()->helpers->validate_request_value( $response_body['content'], 'user_email' );

	//Include your own logic here....

	//This is what the webhook returns back to the caller of this action (response)
	//By default, we return an array with success => true and msg -> Some Text
	return $return_args;

}

The custom add_filter() callback accepts three parameters, which are explained down below:

  1. $return_args (array)

    This is what the webhook call returns as a response. You can modify it to return your own custom data.
  2. $identifier (string)

    This is the wpwh_identifier you may have set up within the webhook call. (We also allow to set this specific argument within the URL as &wpwh_identifier=my_identifier). Further information about this argument is available within the Special Arguments list.
  3. $response_body (array)

    This returns the validated payload of the incoming webhook call. You can use WPWHPRO()->helpers->validate_request_value() to validate single entries (See example)

Tipp

Since this webhook action requires you to still set the action as mentioned above (to let our plugin know you want to fire a custom_action), you can also set the action parameter within the webhook URL you define within your external endpoint (instead of within the body). E.g.: &action=custom_action - This way you can avoid modifying the webhook request payload in the first place.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

ironikus_test

Test the functionality of this plugin by sending over a demo request.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to ironikus_test Details
test_var
Required
A test var. Include the following value to get a success message back: test-value123
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
test_var (string) The variable that was set for the request.
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
    'success' => false,
    'msg' => '',
    'test_var' => 'test-value123'
);
        

This webhook action is only used for testing purposes to test if WP Webhooks works properly on your WordPress website.
This description is uniquely made for the ironikus_test webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use ironikus_test

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to ironikus_test.
  2. The second argument you need to set is test_var. Please set it to test-value123

Tipp

This webhook makes sense if you want to test if WP Webhooks works properly on your WordPress website. You can try to setup different values to see how the webhook interacts with your site.
You can also use it to test the functionality using our Ironikus assistant:https://ironikus.com/assistant/

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

create_comment

Creates a comment using a webhook.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to create_comment Details
comment_agent (string) The HTTP user agent of the comment_author when the comment was submitted. Default empty.
comment_approved (int|string) Whether the comment has been approved. Default 1.
comment_author (string) The name of the author of the comment. Default empty.
comment_author_email (string) The email address of the $comment_author. Default empty.
comment_author_IP (string) The IP address of the $comment_author. Default empty.
comment_author_url (string) The URL address of the $comment_author. Default empty.
comment_content (string) The content of the comment. Default empty.
comment_date (string) The date the comment was submitted. To set the date manually, comment_date_gmt must also be specified. Default is the current time.
comment_date_gmt (string) The date the comment was submitted in the GMT timezone. Default is comment_date in the site's GMT timezone.
comment_karma (int) The karma of the comment. Default 0.
comment_parent (int) ID of this comment's parent, if any. Default 0.
comment_post_ID (int) ID of the post that relates to the comment, if any. Default 0.
comment_type (string) Comment type. Default empty.
comment_meta (array) Optional. Array of key/value pairs to be stored in commentmeta for the new comment. More info within the description.
user_id (int) ID of the user who submitted the comment. Default 0.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
data (array) The data related to the comment, as well as the user and the post object, incl. the meta values.
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
	'success' => false,
	'msg' => '',
	'data' => array(
		'comment_id'   => 0,
		'comment_data'  => array(),
		'comment_meta'  => array(),
		'current_post_id' => 0,
		'current_post_data' => array(),
		'current_post_data_meta' => array(),
		'user_id' => 0,
		'user_data' => array(),
		'user_data_meta' => array()
	),
);
        

This hook enables you to create a comment with all of its settings.

You can also add custom post meta. Here is an example on how this would look like using the simple structure (We also support json):

meta_key_1,meta_value_1;my_second_key,add_my_value

To separate the meta from the value, you can use a comma ",". To separate multiple meta settings from each other, easily separate them with a semicolon ";" (It is not necessary to set a semicolon at the end of the last one)

This is an example on how you can include the post meta using JSON.

{
  "meta_key_1": "This is my meta value 1",
  "another_meta_key": "This is my second meta key!"
}
				

For security reasons, we don't send the password within the webhook response. To send the password as well, you can check out the following filter: wpwhpro/webhooks/action_create_comment_restrict_user_values

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

update_comment

Updates a comment using a webhook.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to update_comment Details
comment_ID
Required
(string) The HTTP user agent of the comment_author when the comment was submitted. Default empty.
comment_agent (string) The HTTP user agent of the comment_author when the comment was submitted. Default empty.
comment_approved (int|string) Whether the comment has been approved. Default 1.
comment_author (string) The name of the author of the comment. Default empty.
comment_author_email (string) The email address of the $comment_author. Default empty.
comment_author_IP (string) The IP address of the $comment_author. Default empty.
comment_author_url (string) The URL address of the $comment_author. Default empty.
comment_content (string) The content of the comment. Default empty.
comment_date (string) The date the comment was submitted. To set the date manually, comment_date_gmt must also be specified. Default is the current time.
comment_date_gmt (string) The date the comment was submitted in the GMT timezone. Default is comment_date in the site's GMT timezone.
comment_karma (int) The karma of the comment. Default 0.
comment_parent (int) ID of this comment's parent, if any. Default 0.
comment_post_ID (int) ID of the post that relates to the comment, if any. Default 0.
comment_type (string) Comment type. Default empty.
comment_meta (array) Optional. Array of key/value pairs to be stored in commentmeta for the new comment. More info within the description.
user_id (int) ID of the user who submitted the comment. Default 0.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
data (array) The data related to the comment, as well as the user and the post object, incl. the meta values.
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
	'success' => false,
	'msg' => '',
	'data' => array(
		'comment_id'   => 0,
		'comment_data'  => array(),
		'comment_meta'  => array(),
		'current_post_id' => 0,
		'current_post_data' => array(),
		'current_post_data_meta' => array(),
		'user_id' => 0,
		'user_data' => array(),
		'user_data_meta' => array()
	),
);
        

This hook enables you to update a comment with all of its settings.

You can also add custom post meta. Here is an example on how this would look like using the simple structure (We also support json):

meta_key_1,meta_value_1;my_second_key,add_my_value

To separate the meta from the value, you can use a comma ",". To separate multiple meta settings from each other, easily separate them with a semicolon ";" (It is not necessary to set a semicolon at the end of the last one)

This is an example on how you can include the post meta using JSON. (If you set the meta value to "ironikus-delete", it will remove the existing value.)

{
  "meta_key_1": "This is my meta value 1",
  "another_meta_key": "This is my second meta key!",
  "another_meta_key_1": "ironikus-delete"
}
				

For security reasons, we don't send the password within the webhook response. To send the password as well, you can check out the following filter: wpwhpro/webhooks/action_update_comment_restrict_user_values

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

trash_comment

Trash a comment using a webhook.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to trash_comment Details
comment_id
Required
(int) The comment id of the comment you want to trash.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
data (array) The comment id as comment_id.
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
	'success' => false,
	'msg' => '',
	'data' => array(
		'comment_id'   => 0
	),
);
        

This hook enables you to trash a comment with all of its settings.

We only support the comment id. Json objects are not allowed.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

delete_comment

Delete a comment using a webhook.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to delete_comment Details
comment_id
Required
(int) The comment id of the comment you want to delete.
force_delete (string) Wether you want to bypass the trash or not. You can set this value to "yes" or "no". Default "no"
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
data (array) The comment id as comment_id and the force_delete status.
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
	'success' => false,
	'msg' => '',
	'data' => array(
		'comment_id'   => 0,
		'force_delete'   => 'no'
	),
);
        

This hook enables you to delete a comment with all of its settings.

Please note, that this function, by default, pushes the comment to the trash. In case you want to fully delete it, set force_delete to "yes".

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_create_download

This webhook action allows you to create a download within Easy Digital Downloads.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_create_download Details
price (float) The price of the download you want to use. Format: 19.99
is_variable_pricing (string) Set this value to "yes" if you want to activate variable pricing for this product. Default: no
variable_prices (string) A JSON formatted string, containing all of the variable product prices. Please see the description for further details.
default_price_id (integer) The ID of the price variation you want to use as the default price.
download_files (String) A JSON formatted string containing all of the downloable file. Please see the description for further details.
bundled_products (String) A JSON formatted string, containing all of the bundled products. Please see the description for further details.
bundled_products_conditions (String) A JSON formatted string that contains the price dependencies. Please see the description for further details.
increase_earnings (Float) The price you would like to increase the lifetime earnings of this product. Please see the description for further details.
decrease_earnings (Float) The price you would like to decrease the lifetime earnings of this product. Please see the description for further details.
increase_sales (Integer) Increase the number of sales from a statistical point of view. Please see the description for further details.
decrease_sales (Integer) Decrease the number of sales from a statistical point of view. Please see the description for further details.
hide_purchase_link (String) Set this string to "yes" to hide the purchase button under the download. Please see the description for more details.
download_limit (Integer) Limits how often a customer can globally download the purchase. Please see the description for further details.
download_author (mixed) The ID or the email of the user who added the post. Default is the current user ID.
download_date (string) The date of the post. Default is the current time. Format: 2018-12-31 11:11:11
download_date_gmt (string) The date of the post in the GMT timezone. Default is the value of $post_date.
download_content (string) The post content. Default empty.
download_content_filtered (string) The filtered post content. Default empty.
download_title (string) The post title. Default empty.
download_excerpt (string) The post excerpt. Default empty.
download_status (string) The post status. Default 'draft'.
comment_status (string) Whether the post can accept comments. Accepts 'open' or 'closed'. Default is the value of 'default_comment_status' option.
ping_status (string) Whether the post can accept pings. Accepts 'open' or 'closed'. Default is the value of 'default_ping_status' option.
download_password (string) The password to access the post. Default empty.
download_name (string) The post name. Default is the sanitized post title when creating a new post.
to_ping (string) Space or carriage return-separated list of URLs to ping. Default empty.
pinged (string) Space or carriage return-separated list of URLs that have been pinged. Default empty.
download_parent (int) Set this for the post it belongs to, if any. Default 0.
menu_order (int) The order the post should be displayed in. Default 0.
download_mime_type (string) The mime type of the post. Default empty.
guid (string) Global Unique ID for referencing the post. Default empty.
download_category (string) A comma separated list of category names, slugs, or IDs. Defaults to value of the 'default_category' option. Example: cat_1,cat_2,cat_3
tags_input (string) A comma separated list of tag names, slugs, or IDs. Default empty.
tax_input (string) A simple or JSON formatted string containing existing taxonomy terms. Default empty. More details within the description.
meta_input (string) A json or a comma and semicolon separated list of post meta values keyed by their post meta key. Default empty. More info in the description.
wp_error Whether to return a WP_Error on failure. Posible values: "yes" or "no". Default value: "no".
do_action Advanced: Register a custom action after Webhooks Pro fires this webhook. More infos are in the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
data (array) Within the data array, you will find further details about the response, as well as the payment id and further information.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "Download successfully created",
    "data": {
        "download_id": 797,
        "download_data": {
            "post_type": "download",
            "meta_data": "{\n  \"meta_key_1\": \"This is my meta value 1\",\n  \"another_meta_key\": \"This is my second meta key!\",\n  \"third_meta_key\": \"ironikus-serialize{\\\"price\\\": \\\"100\\\"}\"\n}",
            "tax_input": false,
            "edd": {
                "increase_earnings": "25.49",
                "decrease_earnings": false,
                "increase_sales": "15",
                "decrease_sales": false,
                "edd_price": "11.11",
                "is_variable_pricing": 1,
                "edd_variable_prices": "{\n    \"1\": {\n        \"index\": \"1\",\n        \"name\": \"Variation 1\",\n        \"amount\": \"39.90\",\n        \"license_limit\": \"0\",\n        \"is_lifetime\": \"1\"\n    },\n    \"2\": {\n        \"index\": \"2\",\n        \"name\": \"Variation 2\",\n        \"amount\": \"49.90\",\n        \"license_limit\": \"4\"\n    }\n}",
                "default_price_id": "2",
                "edd_download_files": "{\n    \"1\": {\n        \"index\": \"0\",\n        \"attachment_id\": \"\",\n        \"thumbnail_size\": \"\",\n        \"name\": \"wp-webhooks-pro-\",\n        \"file\": \"https:\\/\\/domain.demo\\/wp-content\\/uploads\\/edd\\/2020\\/02\\/wp-webhooks-pro.zip\",\n        \"condition\": \"all\"\n    }\n}",
                "edd_bundled_products": false,
                "bundled_products_conditions": false,
                "hide_purchase_link": "on",
                "download_limit": 45
            }
        },
        "edd": []
    }
}

This webhook action is used to create a download for Easy Digital Downloads on your WordPress system via a webhook call.
The description is uniquely made for the edd_create_download webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_create_download

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_create_download.
  2. All the other arguments are optional and just extend the creation of the download. We would still recommend to set the attribute download_title, to make recognizing it easy, as well as for creating proper permalinks/slugs.

Tipps

  1. By default, we create each download in a draft state. If you want to directly publish a download, use the download_status argument and set it to publish.
  2. In case you want to set a short description for your download, you can use the download_excerpt argument.

Special Arguments

price

The default price of the Easy Digital Downloads product. Please set it in the following format: 19.99


is_variable_pricing

In case you set this value to yes, the default edd_price is ignored.


variable_prices

This argument accepts a JSON formatted string of the variations you want to add. Down below, you will find an example, containing all values you can set.

{
    "1": {
        "index": "1",
        "name": "Variation Name",
        "amount": "39.90",
        "license_limit": "0",
        "is_lifetime": "1"
    },
    "2": {
        "index": "2",
        "name": "Variation Name",
        "amount": "49.90",
        "license_limit": "4"
    }
}

Here is a more detailed explanation for each of the values.

  1. The number in front of each entry and the index should always be the same. They identify which variation is which one. It has to be always a numeric string.
  2. The name argument defined the name of the variation.
  3. The amount argument defines the price of the variation. Please use the following format: 19.99.
  4. The license_limit accepts a number to limit the amount of license slots created. 0 is unlimited.
  5. The is_lifetime argument is optional. Set it to 1 to make it lifetime.

default_price_id

The default price id of the variation you want to set as the fault. You only need to set this value in case you set is_variable_pricing to yes.


download_files

This argument accepts a JSON formatted string of the downloadable files you want to add to the download. Down below, you will find an example, containing all values you can set.

{
    "1": {
        "index": "0",
        "attachment_id": "177",
        "thumbnail_size": "false",
        "name": "wp-webhooks.2.0.5",
        "file": "https:\/\/downloads.wordpress.org\/plugin\/wp-webhooks.2.0.5.zip",
        "condition": "all"
    },
    "2": {
        "index": "",
        "attachment_id": "184",
        "thumbnail_size": "false",
        "name": "wp-webhooks.2.0.5",
        "file": "https:\/\/downloads.wordpress.org\/plugin\/wp-webhooks.2.0.5.zip",
        "condition": "2"
    }
}

Here is a more detailed explanation for each of the values.

  1. The number in front of each entry and the index are the identifier of the file. They identify which downloadable file is which one. It has to be always a numeric string.
  2. The attachment_id argument can contain an attachment id (in case the download you add is available within the WordPress media library).
  3. The thumbnail_size argument can contain a specific thumbnail size (in case the download you add is available within the WordPress media library and contains the thumbnail size you defined).
  4. The name argument defines the name of the file (without the extension).
  5. The file argument defines the full, downloadable file URL.
  6. The condition argument defines if you want to enable this file only for a specific variation or not. Set all if you want to make it available for all variations. Otherwise, please use the index id.

bundled_products

This argument allows you to create download bundles. This argument accepts a JSON formatted string of the downloadads you want to bundle. You can also target only a specific variation of a product by defining the variation id, separated by an underscore.

[
    "285_1",
    "23"
]

Here is a more detailed explanation for each of the values.

  1. Each line contains one download id.
  2. On the first line, we add only the first variation of the download with the id 285.
  3. The second line adds the full download with the id 23.

bundled_products_conditions

This argument accepts a JSON formatted string of the downloadads you want to bundle. It contains further definitions on which price assignment should be given for which download.

{
    "1": "all",
    "2": "2"
}

Here is a more detailed explanation for each of the values.

  1. The first argument contains the index id of the bundled product from the bundled_products argument. The value contains the Price assignment for your given variation.
  2. The second line adds the second bundled product with the price assigment of the second variation.

increase_earnings

This argument allows you to increase the lifetime earnings for this product. In case the product does not have any lifetime earnings yet and you set this value to 25.00, then the lifetime earnings will be 0 + 25.00 = 25 $ (or the currency you set by default).


decrease_earnings

This argument allows you to decrease the lifetime earnings for this product. In case the product has lifetime earnings of 100$ and you set this value to 25.00, then the lifetime earnings will be 100 - 25.00 = 75 $ (or the currency you set by default).


increase_sales

Increase the number of sales that have been made for this product. In case you set it to 5, it will add five sales to the lifetime sales of the product (it only increases the number, no payments or anything else is added).


decrease_sales

Decrease the number of sales that have been made for this product. In case you set it to 5, it will remove five sales from the lifetime sales of the product (it only decreases the number, no payments or anything else are removed).


hide_purchase_link

By default, the purchase buttons will be displayed at the bottom of the download, when disabled you will need to use the Purchase link shortcode to output the ability to buy the product where you prefer. To hide the link, set this value to yes


download_limit

Limit the number of times a customer who purchased this product can access their download links. This is a global limit. If you want to set different limits for variations, please do that within the variable_prices argument.


download_author

The download author argument accepts either the user id of a user, or the email address of an existing user. In case you choose the email adress, we try to match it with the users on your WordPress site. In case we couldn't find a user for the given email, we leave the field empty.


download_content

The download content is the main content area of the download. It can contain HTML or any other kind of content necessary for your functionality.


download_status

The download status defines further details about how your download will be treated. By default, WordPress offers the following download statuses: draft, pending, private, publish. Please note that other plugins can extend the download status values to offer a bigger variety.


tags_input

This argument supports the default tags_input variable of the wp_insert_post() function. Please use this function only if you are known to its functionality since WordPress might not add the values properly due to permissions. If you are not sure, please use the tax_input argument instead.

Here is an example:

342,5678,2

This argument supports a comma separated list of tag names, slugs, or IDs.


tax_input

This argument allows you to add/append/delete any kind of taxonomies on your download. It uses a custom functionality that adds the taxonomies independently of the wp_update_post() function.
To make it work, we offer certain different features and methods to make the most out of the taxonomy management. Down below, you will find further information about the whole functionality.

  1. String method

    This method allows you to add/update/delete or bulk manage the download taxonomies using a simple string. Both the string and the JSON method support custom taxonomies too. In case you use more complex taxonomies that use semicolons or double points within the slugs, you need to use the JSON method.

    • Replace existing taxonomy items

      This method allows you to replace already existing taxonomy items on the download. In case a taxonomy item does not exists at the point you want to add it, it will be ignored.

      taxonomy_1,tax_item_1:tax_item_2:tax_item_3;taxonomy_2,tax_item_5:tax_item_7:tax_item_8

      To separate the taxonomies from the single taxonomy items, please use a comma ",". In case you want to add multiple items per taxonomy, you can separate them via a double point ":". To separate multiple taxonomies from each other, please separate them with a semicolon ";" (It is not necessary to set a semicolon at the end of the last one)

    • Remove all taxonomy items for a single taxonomy

      In case you want to remove all taxonomy items from one or multiple taxonomies, you can set ironikus-remove-all; in front of a semicolon-separated list of the taxonomies you want to remove all items for. Here is an example:

      ironikus-remove-all;taxonomy_1;taxonomy_2
    • Remove single taxonomy items for a taxonomy

      You can also remove only single taxonomy items for one or multiple taxonomies. Here is an example:

      ironikus-append;taxonomy_1,value_1:value_2-ironikus-delete:value_3;taxonomy_2,value_5:value_6:value_7-ironikus-delete

      In the example above, we append the taxonomies taxonomy_1 and taxonomy_2. We also add the taxonomy items value_1, value_3, value_5 and value_6. We also remove the taxonomy items value_2 and value_7.

    • Append taxonomy items

      You can also append any taxonomy items without the existing ones being replaced. To do that, simply add ironikus-append; at the beginning of the string.

      ironikus-append;taxonomy_1,value_1:value_2:value_3;taxonomy_2,value_1:value_2:value_3

      In the example above, we append the taxonomies taxonomy_1 and taxonomy_2 with multiple taxonomy items on the download. The already assigned ones won't be replaced.

  2. JSON method

    This method allows you to add/update/delete or bulk manage the download taxonomies using a simple string. Both the string and the JSON method support custom taxonomies too.

    • Replace existing taxonomy items

      This JSON allows you to replace already existing taxonomy items on the download. In case a taxonomy item does not exists at the point you want to add it, it will be ignored.

      {
        "category": [
          "test-category",
          "second-category"
        ],
        "post_tag": [
          "dog",
          "male",
          "simple"
        ]
      }

      The key on the first layer of the JSON is the slug of the taxonomy. As a value, it accepts multiple slugs of the single taxonomy terms. To add multiple taxonomies, simply append them on the first layer of the JSON.

    • Remove all taxonomy items for a single taxonomy

      In case you want to remove all taxonomy items from one or multiple taxonomies, you can set ironikus-remove-all as a separate value with the wpwhtype key. The wpwhtype key is a reserved key for further actions on the data. Here is an example:

      {
        "wpwhtype": "ironikus-remove-all",
        "category": [],
        "post_tag": []
      }
    • Append taxonomy items

      You can also append any taxonomy items without the existing ones being replaced. To do that, simply add ironikus-append to the wpwhtype key. The wpwhtype key is a reserved key for further actions on the data. All the taxonomies you add after, will be added to the existing ones on the download.

      {
        "wpwhtype": "ironikus-append",
        "category": [
          "test-category",
          "second-category"
        ],
        "post_tag": [
          "dog"
        ]
      }

      In the example above, we append the taxonomies category and post_tag with multiple taxonomy items on the download. The already assigned ones won't be replaced.

    • Remove single taxonomy items for a taxonomy

      You can also remove only single taxonomy items for one or multiple taxonomies. To do that, simply append -ironikus-delete at the end of the taxonomy term slug. This specific taxonomy term will then be removed from the download. Here is an example:

      {
        "wpwhtype": "ironikus-append",
        "category": [
          "test-category",
          "second-category-ironikus-delete"
        ],
        "post_tag": [
          "dog-ironikus-delete"
        ]
      }

      In the example above, we append the taxonomies category and post_tag. We also add the taxonomy item test-category. We also remove the taxonomy items second-category and dog.


meta_input

This argument is specifically designed to add/update or remove download meta to your created download.
To create/update or delete custom meta values, we offer you two different ways:

  1. String method

    This method allows you to add/update or delete the download meta using a simple string. To make it work, separate the meta key from the value using a comma (,). To separate multiple meta settings from each other, simply separate them with a semicolon (;). To remove a meta value, simply set as a value ironikus-delete

    meta_key_1,meta_value_1;my_second_key,ironikus-delete

    IMPORTANT: Please note that if you want to use values that contain commas or semicolons, the string method does not work. In this case, please use the JSON method.

  2. JSON method

    This method allows you to add/update or remove the download meta using a JSON formatted string. To make it work, add the meta key as the key and the meta value as the value. To delete a meta value, simply set the value to ironikus-delete. Here's an example on how this looks like:

    {
      "meta_key_1": "This is my meta value 1",
      "another_meta_key": "This is my second meta key!"
      "third_meta_key": "ironikus-delete"
    }

Advanced: We also offer JSON to array serialization for single download meta values. This means, you can turn JSON into a serialized array.
As an example: The following JSON {"price": "100"} will turn into a:1:{s:5:"price";s:3:"100";}
To make it work, you need to add the following string in front of the escaped JSON within the value field of your single meta value of the meta_input argument: ironikus-serialize. Here's a full example:

{
  "meta_key_1": "This is my meta value 1",
  "another_meta_key": "This is my second meta key!",
  "third_meta_key": "ironikus-serialize{\"price\": \"100\"}"
}

This example will create three download meta entries. The third entry has the meta key third_meta_key and a serialized meta value of a:1:{s:5:"price";s:3:"100";}. The string ironikus-serialize in front of the escaped JSON will tell our plugin to serialize the value. Please note that the JSON value, which you include within the original JSON string of the meta_input argument, needs to be escaped.


wp_error

In case you set the wp_error argument to yes, we will return the WP Error object within the response if the webhook action call. It is recommended to only use this for debugging.


do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_create_download action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 4 );
function my_custom_callback_function( $post_data, $post_id, $meta_input, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $post_data (array)

    Contains the data that is used to create the download and some additional data as the meta input.
  2. $post_id (integer)

    Contains the download id of the newly created download. Please note that it can also contain a wp_error object since it is the response of the wp_insert_user() function.
  3. $meta_input (string)

    Contains the unformatted download meta as you sent it over within the webhook request as a string.
  4. $return_args (array)

    An array containing the information we will send back as the response to the initial webhook caller.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_update_download

This webhook action allows you to update (or create) a download within Easy Digital Downloads.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_update_download Details
download_id
Required
(Integer) The ID of the existing download
create_if_none (String) Set this value to "yes" to create the download in case the given download id does not exist. Default: no
price (float) The price of the download you want to use. Format: 19.99
is_variable_pricing (string) Set this value to "yes" if you want to activate variable pricing for this product. Default: no
variable_prices (string) A JSON formatted string, containing all of the variable product prices. Please see the description for further details.
default_price_id (integer) The ID of the price variation you want to use as the default price.
download_files (String) A JSON formatted string containing all of the downloable file. Please see the description for further details.
bundled_products (String) A JSON formatted string, containing all of the bundled products. Please see the description for further details.
bundled_products_conditions (String) A JSON formatted string that contains the price dependencies. Please see the description for further details.
increase_earnings (Float) The price you would like to increase the lifetime earnings of this product. Please see the description for further details.
decrease_earnings (Float) The price you would like to decrease the lifetime earnings of this product. Please see the description for further details.
increase_sales (Integer) Increase the number of sales from a statistical point of view. Please see the description for further details.
decrease_sales (Integer) Decrease the number of sales from a statistical point of view. Please see the description for further details.
hide_purchase_link (String) Set this string to "yes" to hide the purchase button under the download. Please see the description for more details.
download_limit (Integer) Limits how often a customer can globally download the purchase. Please see the description for further details.
download_author (mixed) The ID or the email of the user who added the post. Default is the current user ID.
download_date (string) The date of the post. Default is the current time. Format: 2018-12-31 11:11:11
download_date_gmt (string) The date of the post in the GMT timezone. Default is the value of $post_date.
download_content (string) The post content. Default empty.
download_content_filtered (string) The filtered post content. Default empty.
download_title (string) The post title. Default empty.
download_excerpt (string) The post excerpt. Default empty.
download_status (string) The post status. Default 'draft'.
comment_status (string) Whether the post can accept comments. Accepts 'open' or 'closed'. Default is the value of 'default_comment_status' option.
ping_status (string) Whether the post can accept pings. Accepts 'open' or 'closed'. Default is the value of 'default_ping_status' option.
download_password (string) The password to access the post. Default empty.
download_name (string) The post name. Default is the sanitized post title when creating a new post.
to_ping (string) Space or carriage return-separated list of URLs to ping. Default empty.
pinged (string) Space or carriage return-separated list of URLs that have been pinged. Default empty.
download_parent (int) Set this for the post it belongs to, if any. Default 0.
menu_order (int) The order the post should be displayed in. Default 0.
download_mime_type (string) The mime type of the post. Default empty.
guid (string) Global Unique ID for referencing the post. Default empty.
download_category (string) A comma separated list of category names, slugs, or IDs. Defaults to value of the 'default_category' option. Example: cat_1,cat_2,cat_3
tags_input (string) A comma separated list of tag names, slugs, or IDs. Default empty.
tax_input (string) A simple or JSON formatted string containing existing taxonomy terms. Default empty. More details within the description.
meta_input (string) A json or a comma and semicolon separated list of post meta values keyed by their post meta key. Default empty. More info in the description.
wp_error Whether to return a WP_Error on failure. Posible values: "yes" or "no". Default value: "no".
do_action Advanced: Register a custom action after Webhooks Pro fires this webhook. More infos are in the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
data (array) Within the data array, you will find further details about the response, as well as the payment id and further information.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "Download successfully created",
    "data": {
        "download_id": 797,
        "download_data": {
            "post_type": "download",
            "meta_data": "{\n  \"meta_key_1\": \"This is my meta value 1\",\n  \"another_meta_key\": \"This is my second meta key!\",\n  \"third_meta_key\": \"ironikus-serialize{\\\"price\\\": \\\"100\\\"}\"\n}",
            "tax_input": false,
            "create_if_none": false,
            "edd": {
                "increase_earnings": "25.49",
                "decrease_earnings": false,
                "increase_sales": "15",
                "decrease_sales": false,
                "edd_price": "11.11",
                "is_variable_pricing": 1,
                "edd_variable_prices": "{\n    \"1\": {\n        \"index\": \"1\",\n        \"name\": \"Variation 1\",\n        \"amount\": \"39.90\",\n        \"license_limit\": \"0\",\n        \"is_lifetime\": \"1\"\n    },\n    \"2\": {\n        \"index\": \"2\",\n        \"name\": \"Variation 2\",\n        \"amount\": \"49.90\",\n        \"license_limit\": \"4\"\n    }\n}",
                "default_price_id": "2",
                "edd_download_files": "{\n    \"1\": {\n        \"index\": \"0\",\n        \"attachment_id\": \"\",\n        \"thumbnail_size\": \"\",\n        \"name\": \"wp-webhooks-pro-\",\n        \"file\": \"https:\\/\\/domain.demo\\/wp-content\\/uploads\\/edd\\/2020\\/02\\/wp-webhooks-pro.zip\",\n        \"condition\": \"all\"\n    }\n}",
                "edd_bundled_products": false,
                "bundled_products_conditions": false,
                "hide_purchase_link": "on",
                "download_limit": 45
            }
        },
        "edd": []
    }
}

This webhook action is used to update a download for Easy Digital Downloads on your WordPress system via a webhook call.
The description is uniquely made for the edd_update_download webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_update_download

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_update_download.
  2. It is also required to set the download_id argument. Please set it to the id of the download you want to update.
  3. All the other arguments are optional and just extend the update process of the download.

Tipps

  1. In case the download id you provided within the download_id argument coult not be found, you can also create the post by defining the create_if_none argument with the value yes.
  2. We currently offer pre-defined fields for the download. If you want to add further meta values, you can use the meta_input argument.

Special Arguments

create_if_none

Set this value to yes to create the download in case it does not exist yet.


price

The default price of the Easy Digital Downloads product. Please set it in the following format: 19.99


is_variable_pricing

In case you set this value to yes, the default edd_price is ignored.


variable_prices

This argument accepts a JSON formatted string of the variations you want to update. Down below, you will find an example, containing all values you can set. Please not that defining this argument, it will replace all previously set variations.

{
    "1": {
        "index": "1",
        "name": "Variation Name",
        "amount": "39.90",
        "license_limit": "0",
        "is_lifetime": "1"
    },
    "2": {
        "index": "2",
        "name": "Variation Name",
        "amount": "49.90",
        "license_limit": "4"
    }
}

Here is a more detailed explanation for each of the values.

  1. The number in front of each entry and the index should always be the same. They identify which variation is which one. It has to be always a numeric string.
  2. The name argument defined the name of the variation.
  3. The amount argument defines the price of the variation. Please use the following format: 19.99.
  4. The license_limit accepts a number to limit the amount of license slots created. 0 is unlimited.
  5. The is_lifetime argument is optional. Set it to 1 to make it lifetime.

default_price_id

The default price id of the variation you want to set as the fault. You only need to set this value in case you set is_variable_pricing to yes.


download_files

This argument accepts a JSON formatted string of the downloadable files you want to add to the download. Down below, you will find an example, containing all values you can set. Please not that defining this argument, it will replace all previously set download files within this argument.

{
    "1": {
        "index": "0",
        "attachment_id": "177",
        "thumbnail_size": "false",
        "name": "wp-webhooks.2.0.5",
        "file": "https:\/\/downloads.wordpress.org\/plugin\/wp-webhooks.2.0.5.zip",
        "condition": "all"
    },
    "2": {
        "index": "",
        "attachment_id": "184",
        "thumbnail_size": "false",
        "name": "wp-webhooks.2.0.5",
        "file": "https:\/\/downloads.wordpress.org\/plugin\/wp-webhooks.2.0.5.zip",
        "condition": "2"
    }
}

Here is a more detailed explanation for each of the values.

  1. The number in front of each entry and the index are the identifier of the file. They identify which downloadable file is which one. It has to be always a numeric string.
  2. The attachment_id argument can contain an attachment id (in case the download you add is available within the WordPress media library).
  3. The thumbnail_size argument can contain a specific thumbnail size (in case the download you add is available within the WordPress media library and contains the thumbnail size you defined).
  4. The name argument defines the name of the file (without the extension).
  5. The file argument defines the full, downloadable file URL.
  6. The condition argument defines if you want to enable this file only for a specific variation or not. Set all if you want to make it available for all variations. Otherwise, please use the index id.

bundled_products

This argument allows you to create download bundles. This argument accepts a JSON formatted string of the downloadads you want to bundle. You can also target only a specific variation of a product by defining the variation id, separated by an underscore. Please not that defining this argument, will replace all previously set bundle products within this argument.

[
    "285_1",
    "23"
]

Here is a more detailed explanation for each of the values.

  1. Each line contains one download id.
  2. On the first line, we add only the first variation of the download with the id 285.
  3. The second line adds the full download with the id 23.

bundled_products_conditions

This argument accepts a JSON formatted string of the downloadads you want to bundle. It contains further definitions on which price assignment should be given for which download. Please not that defining this argument, it will replace all previously set conditions for this argument.

{
    "1": "all",
    "2": "2"
}

Here is a more detailed explanation for each of the values.

  1. The first argument contains the index id of the bundled product from the bundled_products argument. The value contains the Price assignment for your given variation.
  2. The second line adds the second bundled product with the price assigment of the second variation.

increase_earnings

This argument allows you to increase the lifetime earnings for this product. In case the product does not have any lifetime earnings yet and you set this value to 25.00, then the lifetime earnings will be 0 + 25.00 = 25 $ (or the currency you set by default).


decrease_earnings

This argument allows you to decrease the lifetime earnings for this product. In case the product has lifetime earnings of 100$ and you set this value to 25.00, then the lifetime earnings will be 100 - 25.00 = 75 $ (or the currency you set by default).


increase_sales

Increase the number of sales that have been made for this product. In case you set it to 5, it will add five sales to the lifetime sales of the product (it only increases the number, no payments or anything else is added).


decrease_sales

Decrease the number of sales that have been made for this product. In case you set it to 5, it will remove five sales from the lifetime sales of the product (it only decreases the number, no payments or anything else are removed).


hide_purchase_link

By default, the purchase buttons will be displayed at the bottom of the download, when disabled you will need to use the Purchase link shortcode to output the ability to buy the product where you prefer. To hide the link, set this value to yes


download_limit

Limit the number of times a customer who purchased this product can access their download links. This is a global limit. If you want to set different limits for variations, please do that within the variable_prices argument.


download_author

The download author argument accepts either the user id of a user, or the email address of an existing user. In case you choose the email adress, we try to match it with the users on your WordPress site. In case we couldn't find a user for the given email, we leave the field empty.


download_content

The download content is the main content area of the download. It can contain HTML or any other kind of content necessary for your functionality.


download_status

The download status defines further details about how your download will be treated. By default, WordPress offers the following download statuses: draft, pending, private, publish. Please note that other plugins can extend the download status values to offer a bigger variety.


tags_input

This argument supports the default tags_input variable of the wp_insert_post() function. Please use this function only if you are known to its functionality since WordPress might not add the values properly due to permissions. If you are not sure, please use the tax_input argument instead.

Here is an example:

342,5678,2

This argument supports a comma separated list of tag names, slugs, or IDs.


tax_input

This argument allows you to add/append/delete any kind of taxonomies on your download. It uses a custom functionality that adds the taxonomies independently of the wp_update_post() function.
To make it work, we offer certain different features and methods to make the most out of the taxonomy management. Down below, you will find further information about the whole functionality.

  1. String method

    This method allows you to add/update/delete or bulk manage the download taxonomies using a simple string. Both the string and the JSON method support custom taxonomies too. In case you use more complex taxonomies that use semicolons or double points within the slugs, you need to use the JSON method.

    • Replace existing taxonomy items

      This method allows you to replace already existing taxonomy items on the download. In case a taxonomy item does not exists at the point you want to add it, it will be ignored.

      taxonomy_1,tax_item_1:tax_item_2:tax_item_3;taxonomy_2,tax_item_5:tax_item_7:tax_item_8

      To separate the taxonomies from the single taxonomy items, please use a comma ",". In case you want to add multiple items per taxonomy, you can separate them via a double point ":". To separate multiple taxonomies from each other, please separate them with a semicolon ";" (It is not necessary to set a semicolon at the end of the last one)

    • Remove all taxonomy items for a single taxonomy

      In case you want to remove all taxonomy items from one or multiple taxonomies, you can set ironikus-remove-all; in front of a semicolon-separated list of the taxonomies you want to remove all items for. Here is an example:

      ironikus-remove-all;taxonomy_1;taxonomy_2
    • Remove single taxonomy items for a taxonomy

      You can also remove only single taxonomy items for one or multiple taxonomies. Here is an example:

      ironikus-append;taxonomy_1,value_1:value_2-ironikus-delete:value_3;taxonomy_2,value_5:value_6:value_7-ironikus-delete

      In the example above, we append the taxonomies taxonomy_1 and taxonomy_2. We also add the taxonomy items value_1, value_3, value_5 and value_6. We also remove the taxonomy items value_2 and value_7.

    • Append taxonomy items

      You can also append any taxonomy items without the existing ones being replaced. To do that, simply add ironikus-append; at the beginning of the string.

      ironikus-append;taxonomy_1,value_1:value_2:value_3;taxonomy_2,value_1:value_2:value_3

      In the example above, we append the taxonomies taxonomy_1 and taxonomy_2 with multiple taxonomy items on the download. The already assigned ones won't be replaced.

  2. JSON method

    This method allows you to add/update/delete or bulk manage the download taxonomies using a simple string. Both the string and the JSON method support custom taxonomies too.

    • Replace existing taxonomy items

      This JSON allows you to replace already existing taxonomy items on the download. In case a taxonomy item does not exists at the point you want to add it, it will be ignored.

      {
        "category": [
          "test-category",
          "second-category"
        ],
        "post_tag": [
          "dog",
          "male",
          "simple"
        ]
      }

      The key on the first layer of the JSON is the slug of the taxonomy. As a value, it accepts multiple slugs of the single taxonomy terms. To add multiple taxonomies, simply append them on the first layer of the JSON.

    • Remove all taxonomy items for a single taxonomy

      In case you want to remove all taxonomy items from one or multiple taxonomies, you can set ironikus-remove-all as a separate value with the wpwhtype key. The wpwhtype key is a reserved key for further actions on the data. Here is an example:

      {
        "wpwhtype": "ironikus-remove-all",
        "category": [],
        "post_tag": []
      }
    • Append taxonomy items

      You can also append any taxonomy items without the existing ones being replaced. To do that, simply add ironikus-append to the wpwhtype key. The wpwhtype key is a reserved key for further actions on the data. All the taxonomies you add after, will be added to the existing ones on the download.

      {
        "wpwhtype": "ironikus-append",
        "category": [
          "test-category",
          "second-category"
        ],
        "post_tag": [
          "dog"
        ]
      }

      In the example above, we append the taxonomies category and post_tag with multiple taxonomy items on the download. The already assigned ones won't be replaced.

    • Remove single taxonomy items for a taxonomy

      You can also remove only single taxonomy items for one or multiple taxonomies. To do that, simply append -ironikus-delete at the end of the taxonomy term slug. This specific taxonomy term will then be removed from the download. Here is an example:

      {
        "wpwhtype": "ironikus-append",
        "category": [
          "test-category",
          "second-category-ironikus-delete"
        ],
        "post_tag": [
          "dog-ironikus-delete"
        ]
      }

      In the example above, we append the taxonomies category and post_tag. We also add the taxonomy item test-category. We also remove the taxonomy items second-category and dog.


meta_input

This argument is specifically designed to add/update or remove download meta to your created download.
To create/update or delete custom meta values, we offer you two different ways:

  1. String method

    This method allows you to add/update or delete the download meta using a simple string. To make it work, separate the meta key from the value using a comma (,). To separate multiple meta settings from each other, simply separate them with a semicolon (;). To remove a meta value, simply set as a value ironikus-delete

    meta_key_1,meta_value_1;my_second_key,ironikus-delete

    IMPORTANT: Please note that if you want to use values that contain commas or semicolons, the string method does not work. In this case, please use the JSON method.

  2. JSON method

    This method allows you to add/update or remove the download meta using a JSON formatted string. To make it work, add the meta key as the key and the meta value as the value. To delete a meta value, simply set the value to ironikus-delete. Here's an example on how this looks like:

    {
      "meta_key_1": "This is my meta value 1",
      "another_meta_key": "This is my second meta key!"
      "third_meta_key": "ironikus-delete"
    }

Advanced: We also offer JSON to array serialization for single download meta values. This means, you can turn JSON into a serialized array.
As an example: The following JSON {"price": "100"} will turn into a:1:{s:5:"price";s:3:"100";}
To make it work, you need to add the following string in front of the escaped JSON within the value field of your single meta value of the meta_input argument: ironikus-serialize. Here's a full example:

{
  "meta_key_1": "This is my meta value 1",
  "another_meta_key": "This is my second meta key!",
  "third_meta_key": "ironikus-serialize{\"price\": \"100\"}"
}

This example will create three download meta entries. The third entry has the meta key third_meta_key and a serialized meta value of a:1:{s:5:"price";s:3:"100";}. The string ironikus-serialize in front of the escaped JSON will tell our plugin to serialize the value. Please note that the JSON value, which you include within the original JSON string of the meta_input argument, needs to be escaped.


wp_error

In case you set the wp_error argument to yes, we will return the WP Error object within the response if the webhook action call. It is recommended to only use this for debugging.


do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_update_download action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 4 );
function my_custom_callback_function( $post_data, $post_id, $meta_input, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $post_data (array)

    Contains the data that is used to create the download and some additional data as the meta input.
  2. $post_id (integer)

    Contains the download id of the newly created download. Please note that it can also contain a wp_error object since it is the response of the wp_insert_user() function.
  3. $meta_input (string)

    Contains the unformatted download meta as you sent it over within the webhook request as a string.
  4. $return_args (array)

    An array containing the information we will send back as the response to the initial webhook caller.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_delete_download

This webhook action allows you to delete (or trash) a download within Easy Digital Downloads.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_delete_download Details
download_id
Required
The download id of the download you want to delete.
force_delete (optional) Whether to bypass trash and force deletion. Possible values: "yes" and "no". Default: "no".
do_action Advanced: Register a custom action after Webhooks Pro fires this webhook. More infos are in the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
data (array) Within the data array, you will find further details about the response, as well as the download id and further information.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "The download was successfully deleted.",
    "data": {
        "post_id": 747,
        "force_delete": false
    }
}

This webhook action is used to delete a download on your WordPress system via a webhook call.
This description is uniquely made for the edd_delete_download webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_delete_download

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_delete_download.
  2. It is also required to set the download id of the download you want to delete. You can do that by using the download_id argument.
  3. All the other arguments are optional and just extend the deletion of the download.
  4. Please note that deleting a download without defining the force_delete argument set to yes, only moves the downloads to the trash.

Special Arguments

force_delete

In case you set the force_delete argument to yes, the download will be completely removed from your WordPress website.


do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_delete_download action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 4 );
function my_custom_callback_function( $post, $post_id, $check, $force_delete ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $post (object)

    Contains the WordPress download object of the already deleted download.
  2. $post_id (integer)

    Contains the download id of the deleted post.
  3. $check (mixed)

    Contains the response of the wp_delete_post() function.
  4. $force_delete (string)

    Returns either yes or no, depending on your settings for the force_delete argument.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_create_payment

This webhook action allows you to create a payment within Easy Digital Downloads.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_create_payment Details
customer_email
Required
(String) The email of the customer you want to associate with the payment. Please see the description for further details.
discounts (String) A comma-separated list of discount codes. Please see the description for further details.
gateway (String) The slug of the currently used gateway. Please see the description for further details. Default empty.
currency (String) The currency code of the payment. Default is your default currency. Please see the description for further details.
parent_payment_id (Integer) The payment id of a parent payment.
payment_status (String) The status of the payment. Default is "pending". Please see the description for further details.
product_data (String) A JSON formatted string, containing all the product data and options. Please refer to the description for examples and further details.
edd_agree_to_terms (String) Defines if a user agreed to the terms. Set it to "yes" to mark the user as agreed. Default: no
edd_agree_to_privacy_policy (String) Defines if a user agreed to the privacy policy. Set it to "yes" to mark the user as agreed. Default: no
payment_date (String) Set a custom payment date. The format is flexible, but we recommend SQL format.
user_id (Integer) The user id of the WordPress user. If not defined, we try to fetch the id using the customer_email.
customer_first_name (String) The first name of the customer. Please see the description for further details.
customer_last_name (String) The last name of the customer. Please see the description for further details.
customer_country (String) The country code of the customer.
customer_state (String) The state of the customer.
customer_zip (String) The zip of the customer.
send_receipt (String) Set it to "yes" for sending out a receipt to the customer. Default "no". Please see the description for further details.
do_action Advanced: Register a custom action after WP Webhooks fires this webhook. More infos are in the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
data (array) Within the data array, you will find further details about the response, as well as the payment id and further information.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "The payment was successfully created.",
    "data": {
        "payment_id": 747,
        "payment_data": {
            "purchase_key": "aa10bc587fb544b10c01fe13905fba74",
            "user_email": "jondoe@test.test",
            "user_info": {
                "id": 0,
                "email": "jondoe@test.test",
                "first_name": "Jannis",
                "last_name": "Testing",
                "discount": false,
                "address": {
                    "country": "AE",
                    "state": false,
                    "zip": false
                }
            },
            "gateway": "paypal",
            "currency": "EUR",
            "cart_details": [
                {
                    "id": 176,
                    "quantity": 1,
                    "item_price": 49,
                    "tax": 5,
                    "discount": 4,
                    "fees": [
                        {
                            "label": "Custom Fee",
                            "amount": 10,
                            "type": "fee",
                            "id": "",
                            "no_tax": false,
                            "download_id": 435
                        }
                    ],
                    "item_number": {
                        "options": {
                            "price_id": null
                        }
                    }
                }
            ],
            "parent": false,
            "status": "publish",
            "post_date": "2020-04-23 00:00:00"
        }
    }
}

This webhook action is used to create a payment for Easy Digital Downloads within your WordPress system via a webhook call.
The description is uniquely made for the edd_create_payment webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_create_payment

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_create_payment.
  2. It is also required to set the customer_email argument. Please set it to the email of the person you want to assign to the payment.
  3. All the other arguments are optional and just extend the creation of the EDD payment.

Tipps

  1. This webhook action is very versatile. Depending on your active extensions of the plugin, you will see different arguments and descriptions. This way, we can always provide you personalized features based on your active plugins.
  2. To run the logic, we use the EDD default function for inserting payments: edd_insert_payment() - you can therefore use all the features available for the function.

Special Arguments

customer_email

The customer email is the email address of the customer you want to associate with the payment. In case there is no existing EDD customer with this email available, EDD will create one. (An EDD customer is not the same as a WordPress user. There is no WordPRess user created by simply defining the email.) To associate a WordPress user with the EDD customer, please check out the user_id argument.


discounts

This argument accepts a single discount code or a comma-separated list of multiple discount codes. Down below, you will find an example on how to use multiple discount codes. Please note: This only adds the discount code to the payment, but it does not affect the pricing. If you want to apply the discounts to the payment pricing, you need to use the discount key within the product_data line item argument.

10PERCENTOFF,EASTERDISCOUNT10

gateway

The slug of the gateway you want to use. Down below, you will find further details on the available default gateways:

  1. PayPal Standard: paypal
  2. Test Payment: manual
  3. Amazon: amazon

currency

The currency code of the currency you want to use for this payment. You can set it to e.g. EUR or USD. If you leave it empty, we use your default currency. ( edd_get_currency() )


payment_status

Use this argument to set a custom payment status. Down below, you will find a list of all available, default payment names and its slugs. To make this argument work, please define the slug of the status you want. If you don't define any, pending is used.

  1. Pending: pending
  2. Complete: publish
  3. Refunded: refunded
  4. Failed: failed
  5. Abandoned: abandoned
  6. Revoked: revoked
  7. Processing: processing
  8. Renewal: edd_subscription

product_data

This argument accepts a JSON formatted String, which contains all the downloads you want to add, including further details about the pricing. Due to the complexity of the string, we explained each section of the following JSON down below. The JSON below contains a list with one product which is added to your payment details. They also determine the pricing of the payment and other information.

[
    {
        "id": 176,
        "quantity": 1,
        "item_price": 49,
        "tax": 5,
        "discount": 4,
        "fees": [
            {
                "label": "Custom Fee",
                "amount": 10,
                "type": "fee",
                "id": "",
                "no_tax": false,
                "download_id": 435
            }
        ],
        "item_number": {
            "options": {
                "price_id": null,
                "is_upgrade": true,
                "is_renewal": true,
                "license_id": 3423,
                "recurring": {
                    "trial_period": {
                        "unit": 33,
                        "quantity": 2
                    },
                    "signup_fee": 33.1,
                    "period": "monthly",
                    "times": 4
                },
                "license_key": "iuzgsdfibasfsdfsafk"
            }
        }
    }
]

The above JSON adds a single download to the payment. If you want to add multiple products, simply add another entry within the [] brackets. HEre are all the values explained:

  1. id (Required)
    This is the download id within WordPress.
  2. quantity (Required)
    The number of how many times this product should be added.
  3. item_price (Required)
    The price of the product you want to add
  4. tax (Required)
    The amount of tax that should be added to the item_price
  5. discount
    The amount of discount that should be removed from the item_price
  6. fees
    Fees are extra prices that are added on top of the product price. Usually this is set for signup fees or other prices that are not directly related with the download. The values set within the fees are all optional, but recommended to be available within the JSON.
  7. item_number
    The item number contains variation related data about the product. In case you want to add a variation, you can define the price id there.


send_receipt

The send_receipt argument allows you to send out the receipt for the payment you just made. Please note that this logic uses the EDD default functionality. The receipt is only send based on the given payment status.


customer_first_name

Please not that defining the customer first name (or last name) are only affecting the custoemr in case it doesn't exist at that point. For existing customers, the first and last name is not updated.


customer_last_name

Please not that defining the customer last name (or first name) are only affecting the custoemr in case it doesn't exist at that point. For existing customers, the first and last name is not updated.


do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_create_payment action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 4 );
function my_custom_callback_function( $payment_id, $purchase_data, $send_receipt, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $payment_id (integer)

    Contains the id of the newly created payment.
  2. $purchase_data (integer)

    An array that contins the validated payment data we sent over to the edd_insert_payment() function
  3. $send_receipt (string)

    A boolean value of wether the receipt should be sent (if applicable) or not.
  4. $return_args (array)

    An array containing the information we will send back as the response to the initial webhook caller.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_update_payment

This webhook action allows you to update a payment within Easy Digital Downloads.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_update_payment Details
payment_id
Required
(Integer) The id of the payment you want to update.
payment_status (String) The status of the payment. Please see the description for further details.
do_action Advanced: Register a custom action after WP Webhooks fires this webhook. More infos are in the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
data (array) Within the data array, you will find further details about the response, as well as the payment id and further information.
errors (array) An array containing all errors that might happened during the update.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "The payment was successfully updated or no changes have been made.",
    "data": {
        "payment_id": 749,
        "payment_status": "processing"
    },
    "errors": []
}

This webhook action is used to update a payment for Easy Digital Downloads within your WordPress system via a webhook call.
The description is uniquely made for the edd_update_payment webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_update_payment

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_update_payment.
  2. It is also required to set the payment_id argument. Please set the id of the payment you want to update.
  3. All the other arguments are optional and just extend the creation of the EDD payment.

Tipps

  1. Since this webhook action is very versatile, it is highly recommended to check out the Special Arguments list down below.

Special Arguments

payment_status

This argument allows you to update the status of the payment. Here is a list of the default payment statuses you can use:

  1. Pending: pending
  2. Complete: publish
  3. Refunded: refunded
  4. Failed: failed
  5. Abandoned: abandoned
  6. Revoked: revoked
  7. Processing: processing
  8. Renewal: edd_subscription

do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_update_payment action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 2 );
function my_custom_callback_function( $payment_id, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $payment_id (array)

    Contains the id of the newly updated payment.
  2. $return_args (array)

    An array containing the information we will send back as the response to the initial webhook caller.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_delete_payment

This webhook action allows you to delete a payment within Easy Digital Downloads.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_delete_payment Details
payment_id
Required
(Integer) The id of the payment you want to update.
update_customer_stats (String) Set this value to "yes" to update the statistics of the customer. Default: no
delete_download_logs (String) Set this value to "yes" to delete the payment including all its related download logs. Default: no
do_action Advanced: Register a custom action after WP Webhooks fires this webhook. More infos are in the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
data (array) Within the data array, you will find further details about the response, as well as the payment id and further information.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "The payment was successfully created.",
    "data": {
        "payment_id": 747,
    }
}

This webhook action is used to delete a payment for Easy Digital Downloads within your WordPress system via a webhook call.
The description is uniquely made for the edd_delete_payment webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_delete_payment

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_delete_payment.
  2. It is also required to set the payment_id argument. Please set the id of the payment you want to delete.
  3. All the other arguments are optional and just extend the creation of the EDD payment.

Tipps

  1. By default, we do not update the statistics of the user (lifetime value, etc). To recalculate the statustics, please set the update_customer_stats argument to 'yes'.
  2. You can also delete all the download logs of the payment using the delete_download_logs argument. Set it to yes to delete them too.

Special Arguments

update_customer_stats

Set this value to yes to decrease the purchase count, as well as the total value.


delete_download_logs

This argument can remove all download logs that are related to the payment id. To delete the logs, simply set the argument value to yes


do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_delete_payment action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 2 );
function my_custom_callback_function( $payment_id, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $payment_id (array)

    Contains the id of the newly deleted payment.
  2. $return_args (array)

    An array containing the information we will send back as the response to the initial webhook caller.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_create_customer

This webhook action allows you to create a customer within Easy Digital Downloads.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_create_customer Details
customer_email
Required
(String) The email of the customer you want to create. In case the user already exists, we do not update it.
customer_first_name (String) The first name of the customer.
customer_last_name (String) The last name of the customer.
additional_emails (String) A comma-separated list of additional email addresses. Please check the description for further details.
attach_payments (String) A comma-, and doublepoint-separated list of payment ids you want to assign to the user. Please check the description for further details.
increase_purchase_count (Integer) increase the purchase count for the customer.
increase_lifetime_value (Float) The price you want to add to the lifetime value of the customer. Please check the description for further details.
set_primary_email (String) The email you want to set as the new primary email. Default: customer_email
customer_notes (String) A JSON formatted string containing one or multiple customer notes. Please check the description for further details.
customer_meta (String) A JSON formatted string containing one or multiple customer meta data. Please check the description for further details.
user_id (Integer) The user id of the WordPress user you want to assign to the customer. Please read the description for further details.
do_action Advanced: Register a custom action after WP Webhooks fires this webhook. More infos are in the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
customer_id (Integer) The ID of the customer
customer_email (String) The email you set within the customer_email argument.
additional_emails (String) The additional emails you set within the additional_emails argument.
customer_first_name (String) The first name you set within the customer_first_name argument.
customer_last_name (String) The last name you set within the customer_last_name argument.
attach_payments (String) The payment ids you set within the attach_payments argument.
increase_purchase_count (Integer) The purchase count you set within the increase_purchase_count argument.
increase_lifetime_value (Float) The lifetime value you set within the increase_lifetime_value argument.
customer_notes (String) The customer notes you set within the customer_notes argument.
customer_meta (String) The customer meta you set within the customer_meta argument.
user_id (String) The user id you set within the user_id argument.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "The user was successfully created.",
    "customer_id": "5",
    "customer_email": "test@domain.com",
    "additional_emails": "second@domain.com,thir@domain.com",
    "customer_first_name": "John",
    "customer_last_name": "Doe",
    "attach_payments": "747",
    "increase_purchase_count": 2,
    "increase_lifetime_value": "55.46",
    "customer_notes": "[\"First Note 1\",\"First Note 2\"]",
    "customer_meta": "{\"meta_1\": \"test1\",\"meta_2\": \"test2\"}"
    "user_id": 23
}

This webhook action is used to create a customer for Easy Digital Downloads within your WordPress system via a webhook call.
The description is uniquely made for the edd_create_customer webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_create_customer

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_create_customer.
  2. It is also required to set the customer_email argument. Please set it to the email of the person you want to add as a customer.
  3. All the other arguments are optional and just extend the creation of the EDD customer.

Tipps

  1. Creating a customer is not the same as creating a user. Easy Digital Downloads uses its own logic and tables for customers. Still, you can assign a user to a customer usign the user_id argument.
  2. In case the email you try to use, for adding the customer, already exists within the customer table, the customer won't be created.
  3. Since this webhook action is very versatile, it is highly recommended to check out the Special Arguments list down below.

Special Arguments

customer_email

The customer email is the email address of the customer you want to associate with the newly created customer. In case there is no existing EDD customer with this email available, EDD will create one. (An EDD customer is not the same as a WordPress user. There is no WordPress user created by simply defining the email.) To associate a WordPress user with the EDD customer, please check out the user_id argument.


additional_emails

You can add additional emails to a customer. To do that, simply comma-separate the emails within the field. The primary email address is always the customer_email argument. Here is an example:

jondoe@mydomain.com,anotheremail@domain.com

attach_payments

This argument allows you to connect certain payment ids to the user. To set multiple payments, please separate them with a comma. By default, it recalculates the total amount. If you do not want that, add :no_update_stats after the payment id. Here is an example:

125,365,444:no_update_stats,777

The example above asigns the payment ids 125, 365, 444, 777 to the customer. It also assigns the payment id 444, but it does not update the statistics.


increase_purchase_count

This field accepts a number, which is added on top of the existing purchase count. If you are going to add three payments for a new customer, and you set this value to 1, your total purchase count will show 4.


increase_lifetime_value

This field accepts a decimalnumber, which is added on top of the existing lifetime value. If you are going to add one payment with a price of 20$ for a new customer, and you set this value to 5$, the total lifetime value will show 25$.


customer_notes

Use this argument to add one or multiple customer notes to the customer. This value accepts a JSON, containing one customer note per line. Here is an example:

[
  "First Note 1",
  "First Note 2"
]

The example above adds two notes.


customer_meta

This argument allows you to add one or multiple customer meta values to your newly created customer, using a JSON string. Easy Digital Downloads uses a custom table for these meta values. Here are some examples on how you can use it:

  • Add/update meta values

    This JSON shows you how to add simple meta values for your customer.

    {
      "meta_1": "test1",
      "meta_2": "test2"
    }

    The key is always the customer meta key. On the right, you always have the value for the customer meta value. In this example, we add two meta values to the customer meta. In case a meta key already exists, it will be updated.

  • Delete meta values

    You can also delete existing meta key by setting the value to ironikus-delete. This way, the meta will be removed. Here is an example:

    {
      "meta_1": "test1",
      "meta_2": "ironikus-delete"
    }

    The example above will add the meta key meta_1 with the value test1 and it deletes the meta key meta_2 including its value.

  • Add/update/remove serialized meta values

    Sometimes, it is necessary to add serialized arrays to your data. Using the json below, you can do exactly that. You can use a simple JSON string as the meta value and we automatically convert it to a serialized array once you place the identifier ironikus-serialize in front of it. Here is an example:

    {
      "meta_1": "test1",
      "meta_2": "ironikus-serialize{\"test_key\":\"wow\",\"testval\":\"new\"}"
    }

    This example adds a simple meta with meta_1 as the key and test1 as the value. The second meta value contains a json value with the identifier ironikus-serialize in the front. Once this value is saved to the database, it gets turned into a serialized array. In this example, it would look as followed:

    a:2:{s:8:"test_key";s:3:"wow";s:7:"testval";s:3:"new";}


user_id

This argument allows you to assign a user to the Easy Digital Downloads customer. In case the user id is not defined, we will automatically try to match the primary email with a WordPress user.


do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_create_customer action was fired (It also fires if the user was not successfully created, but you can check if the user id is set or not to determine if it worked).
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 2 );
function my_custom_callback_function( $customer_id, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $customer_id (integer)

    The customer id of the newly created customer. 0 or false if something went wrong.
  2. $return_args (array)

    An array containing the information we will send back as the response to the initial webhook caller. This includes all of in the request set data.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_update_customer

This webhook action allows you to update (and create) a customer within Easy Digital Downloads.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_update_customer Details
customer_value
Required
(String) The actual value you want to use to determine the customer. In case you havent set the get_customer_by argument or you set it to email, place the customer email in here.
get_customer_by (String) The type of value you want to use to fetch the customer from the database. Possible values: email, customer_id, user_id. Default: email
customer_email (String) The primary email of the customer you want to update. In case the user does not exists, we use this email to create it (If you have set the argument create_if_none to yes).
customer_first_name (String) The first name of the customer.
customer_last_name (String) The last name of the customer.
additional_emails (String) A comma-separated list of additional email addresses. Please check the description for further details.
attach_payments (String) A comma-, and doublepoint-separated list of payment ids you want to assign to the user. Please check the description for further details.
increase_purchase_count (Integer) increase the purchase count for the customer.
increase_lifetime_value (Float) The price you want to add to the lifetime value of the customer. Please check the description for further details.
set_primary_email (String) The email you want to set as the new primary email. Default: customer_email
customer_notes (String) A JSON formatted string containing one or multiple customer notes. Please check the description for further details.
customer_meta (String) A JSON formatted string containing one or multiple customer meta data. Please check the description for further details.
user_id (Integer) The user id of the WordPress user you want to assign to the customer. Please read the description for further details.
create_if_none Set this argument to "yes" if you want to create the customer in case it does not exist.
do_action Advanced: Register a custom action after WP Webhooks fires this webhook. More infos are in the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
customer_id (Integer) The ID of the customer
customer_email (String) The email you set within the customer_email argument.
additional_emails (String) The additional emails you set within the additional_emails argument.
customer_first_name (String) The first name you set within the customer_first_name argument.
customer_last_name (String) The last name you set within the customer_last_name argument.
attach_payments (String) The payment ids you set within the attach_payments argument.
increase_purchase_count (Integer) The purchase count you set within the increase_purchase_count argument.
increase_lifetime_value (Float) The lifetime value you set within the increase_lifetime_value argument.
customer_notes (String) The customer notes you set within the customer_notes argument.
customer_meta (String) The customer meta you set within the customer_meta argument.
user_id (String) The user id you set within the user_id argument.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "The user was successfully created.",
    "customer_id": "5",
    "customer_email": "test@domain.com",
    "additional_emails": "second@domain.com,thir@domain.com",
    "customer_first_name": "John",
    "customer_last_name": "Doe",
    "attach_payments": "747",
    "increase_purchase_count": 2,
    "increase_lifetime_value": "55.46",
    "customer_notes": "[\"First Note 1\",\"First Note 2\"]",
    "customer_meta": "{\"meta_1\": \"test1\",\"meta_2\": \"test2\"}"
    "user_id": 23
}

This webhook action is used to update a customer for Easy Digital Downloads within your WordPress system via a webhook call.
The description is uniquely made for the edd_update_customer webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_update_customer

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_update_customer.
  2. As a second argument, you need to set the actual data you want to use for fetching the user. If you have chosen nothing or email for the get_customer_by argument, you need to include the customers email address here.
  3. All the other arguments are optional and just extend the update process of the EDD customer.

Tipps

  1. Updating a customer is not the same as updating a user. Easy Digital Downloads uses its own logic and tables for customers. Still, you can assign or update a user to a customer using the user_id argument.
  2. You can also create a user if your given values did not find any. To do that, simply set the create_if_none argument to yes.
  3. Since this webhook action is very versatile, it is highly recommended to check out the Special Arguments list down below.

Special Arguments

customer_value

The value we use to determine the customer. In case you haven't set the get_user_by argument or you have set it to email, please include the customer email in here. If you have chosen the customer_id, please include the customer id and in case you set user_id, please include the user id.


get_customer_by

Customize the default way we use to fetch the customer from the backend. Possible values are email (Default), customer_id or user_id.


customer_email

The customer email is the primary email address of the customer you want to update. In case we didn't find any customer and you set the create_if_none argument to yes, we will create the customer with this email address in case you did not use an email for the customer_value argument.


additional_emails

You can add and/or remove additional emails on the customer. To do that, simply comma-separate the emails within the field. The primary email address is always the customer_email argument. Here is an example:

jondoe@mydomain.com,anotheremail@domain.com

You can also remove already assigned email addresses. To do that, simply add :remove after the email. This will cause the email to be removed from the user. Here is an example:

fourth@domain.com:remove,more@domain.demo

The above example removes the email fourth@domain.com and adds the email more@domain.demo


attach_payments

This argument allows you to connect and/or remove certain payment ids at the user. To set multiple payments, please separate them with a comma. By default, it recalculates the total amount. If you do not want that, add :no_update_stats after the payment id. Here is an example:

125,365,444:no_update_stats,777

The example above asigns the payment ids 125, 365, 444, 777 to the customer. It also assigns the payment id 444, but it does not update the statistics.
To remove certain payments, please add :remove after the payment id. You can also combine it with the recalculation setting of the totals. Here is an example:

125remove,444:no_update_stats,777

The example above removes the payment with the id 125, adds the payment 777 and adds the payment 444 without refreshing the stats.


increase_purchase_count

This field accepts a number, which is added on top of the existing purchase count. If you are going to add three payments for a customer that has currently none, and you set this value to 1, your total purchase count will show 4.


increase_lifetime_value

This field accepts a decimalnumber, which is added on top of the existing lifetime value. If you are going to add one payment with a price of 20$ for a customer that has 0 lifetime value, and you set this value to 5$, the total lifetime value will show 25$.


customer_notes

Use this argument to add one or multiple customer notes to the customer. This value accepts a JSON, containing one customer note per line. Here is an example:

[
  "First Note 1",
  "First Note 2"
]

The example above adds two notes.


customer_meta

This argument allows you to add one or multiple customer meta values to your newly created customer, using a JSON string. Easy Digital Downloads uses a custom table for these meta values. Here are some examples on how you can use it:

  • Add/update/remove meta values

    This JSON shows you how to add simple meta values for your customer.

    {
      "meta_1": "test1",
      "meta_2": "test2"
    }

    The key is always the customer meta key. On the right, you always have the value for the customer meta value. In this example, we add two meta values to the customer meta. In case a meta key already exists, it will be updated.

  • Delete meta values

    You can also delete existing meta key by setting the value to ironikus-delete. This way, the meta will be removed. Here is an example:

    {
      "meta_1": "test1",
      "meta_2": "ironikus-delete"
    }

    The example above will add the meta key meta_1 with the value test1 and it deletes the meta key meta_2 including its value.

  • Add/update serialized meta values

    Sometimes, it is necessary to add serialized arrays to your data. Using the json below, you can do exactly that. You can use a simple JSON string as the meta value and we automatically convert it to a serialized array once you place the identifier ironikus-serialize in front of it. Here is an example:

    {
      "meta_1": "test1",
      "meta_2": "ironikus-serialize{\"test_key\":\"wow\",\"testval\":\"new\"}"
    }

    This example adds a simple meta with meta_1 as the key and test1 as the value. The second meta value contains a json value with the identifier ironikus-serialize in the front. Once this value is saved to the database, it gets turned into a serialized array. In this example, it would look as followed:

    a:2:{s:8:"test_key";s:3:"wow";s:7:"testval";s:3:"new";}


user_id

This argument allows you to assign a user to the Easy Digital Downloads customer. In case the user id is not defined, we will automatically try to match the primary email with a WordPress user.


create_if_none

This argument allows you to create a customer in case it does not exist yet. Please set this argument to yes to create the customer. Default: no. In case the user does not exist, we use the email from the customer_value argument or in case you used a different value, we use the emfial from the customer_email argument.


do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_update_customer action was fired (It also fires if the user was not successfully updated, but you can check if the user id is set or not to determine if it worked).
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 2 );
function my_custom_callback_function( $customer_id, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $customer_id (integer)

    The customer id of the newly created customer. 0 or false if something went wrong.
  2. $return_args (array)

    An array containing the information we will send back as the response to the initial webhook caller. This includes all of in the request set data.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_delete_customer

This webhook action allows you to delete a customer within Easy Digital Downloads.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_delete_customer Details
customer_value
Required
(String) The actual value you want to use to determine the customer. In case you havent set the get_customer_by argument or you set it to email, place the customer email in here.
get_customer_by (String) The type of value you want to use to fetch the customer from the database. Possible values: email, customer_id, user_id. Default: email
delete_records Set this argument to "yes" if you want to delete all of the customer records (payments) from the database. More info is within the description.
do_action Advanced: Register a custom action after WP Webhooks fires this webhook. More info is within the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
customer_id (Integer) The ID of the customer
get_customer_by (String) The type of value you want to use to fetch the customer from the database. Possible values: email, customer_id, user_id. Default: email
customer_value (String) The additional emails you set within the additional_emails argument.
delete_records Set this argument to "yes" if you want to delete all of the customer records (payments) from the database.
customer_data (array) The Data from the EDD_Customer class.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "The user was successfully created.",
    "customer_id": "5",
    "get_customer_by": "email",
    "customer_value": "jondoe@domain.test",
    "delete_records": false,
    "customer_data": []
}

This webhook action is used to delete a customer for Easy Digital Downloads within your WordPress system via a webhook call.
The description is uniquely made for the edd_delete_customer webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_delete_customer

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_delete_customer.
  2. As a second argument, you need to set the actual data you want to use for fetching the user. If you have chosen nothing or email for the get_customer_by argument, you need to include the customers email address here.
  3. All the other arguments are optional and just extend the update process of the EDD customer.

Tipps

  1. Deleting a customer is not the same as deleting a user. Easy Digital Downloads uses its own logic and tables for customers.
  2. You can also delete all related payment records assigned to a customer. To do that, simply set the delete_records argument to yes.
  3. Since this webhook action is very versatile, it is highly recommended to check out the Special Arguments list down below.

Special Arguments

customer_value

The value we use to determine the customer. In case you haven't set the get_user_by argument or you have set it to email, please include the customer email in here. If you have chosen the customer_id, please include the customer id and in case you set user_id, please include the user id.


get_customer_by

Customize the default way we use to fetch the customer from the backend. Possible values are email (Default), customer_id or user_id.


delete_records

This argument allows you to delete payments assigned to a customer. In case you haven't set it to yes, we only remove the user correlation to the payment.


do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_delete_customer action was fired (It also fires if the customer was not successfully deleted, but you can check if the user id is set or not to determine if it worked).
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 3 );
function my_custom_callback_function( $customer_id, $customer, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $customer_id (integer)

    The customer id of the newly created customer. 0 or false if something went wrong.
  2. $customer (object)

    The customer object from the EDD EDD_Customer class.
  3. $return_args (array)

    An array containing the information we will send back as the response to the initial webhook caller. This includes all of in the request set data.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_create_discount

This webhook action allows you to create a dicsount code within Easy Digital Downloads.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_create_discount Details
code
Required
(String) The dicsount code you would like to set for this dicsount. Only alphanumeric characters are allowed.
name (String) The name to identify the discount code.
status (String) The status of the discount code. Default: active
current_uses (Integer) A number that tells how many times the coupon code has been already used.
max_uses (Integer) The number of how often the discount code can be used in total.
amount (Mixed) The amount of the discount code. If chosen percent, use an interger, for an amount, use float. More info is within the description.
start_date (String) The start date of the availability of the discount code. More info is within the description.
expiration_date (String) The end date of the availability of the discount code. More info is within the description.
type (String) The type of the discount code. Default: percent. More info is within the description.
min_price (Mixed) The minimum price that needs to be reached to use the discount code. More info is within the description.
product_requirement A comma-separated list of download IDs that are required to apply the discount code. More info is within the description.
product_condition (String) A string containing further conditions on when the discount code can be applied. More info is within the description.
excluded_products (String) A comma-separated list, containing all the products that are excluded from the discount code. More info is within the description.
is_not_global (String) Set this argument to "yes" if you do not want to apply the discount code globally to all products. Default: no. More info is within the description.
is_single_use (String) Set this argument to "yes" if you want to limit this discount code to only a single use per customer. Default: no. More info is within the description.
do_action Advanced: Register a custom action after WP Webhooks fires this webhook. More info is within the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
data (Array) Containing all of the predefined data of the webhook, as well as the discount id in case it was successfully created.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "The discount code was successfully created.",
    "data": {
        "code": "erthsashtsw",
        "name": "Demo Discount Code",
        "status": "inactive",
        "uses": "5",
        "max": "10",
        "amount": "11.10",
        "start": "05/23/2020 00:00:00",
        "expiration": "06/27/2020 23:59:59",
        "type": "flat",
        "min_price": "22",
        "products": [
            "176",
            "772"
        ],
        "product_condition": "any",
        "excluded-products": [
            "774"
        ],
        "not_global": true,
        "use_once": true,
        "discount_id": 805
    }
}

This webhook action is used to create a discount code for Easy Digital Downloads within your WordPress system via a webhook call.
The description is uniquely made for the edd_create_discount webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_create_discount

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_create_discount.
  2. It is also required to set the code argument. Please set it to the discount code you want to apply for future orders.
  3. All the other arguments are optional and just extend the creation of the EDD discount code.

Tipps

  1. By changing the type argument, you can switch between flat or percentage based discounts. More details are down below within the Special Arguments list.

Special Arguments

status

Defines the status in which you want to create the discount code with. Possible values are active and inactive. By default, this value is set to active.


current_uses

This argument accepts a number that defines how often this discount code has been already used. Usually, you do not need to define this argument for creating a discount code.


max_uses

This argument defines the maximal number on how often this discount code can be applied. Set it to 0 for unlimited uses.


amount

The amount argument accepts different values, based on the type you set. By default, you can set this value to the number of percents you want to discount the order. E.g.: 10 will be represented as ten percent. If the type argument is set to flat, it would discount 10$ (or the currency you choose for your shop).


start_date

Set the date you want this discount code do become active. We recommend using the SQL format: 2020-03-10 17:16:18. This arguments also accepts other formats - if you have no chance of changing the date format, its the best if you simply give it a try.


expiration_date

Set the date you want this discount code do become inactive. We recommend using the SQL format: 2020-03-10 17:16:18. This arguments also accepts other formats - if you have no chance of changing the date format, its the best if you simply give it a try.


type

This argument defines the type of the discount code. If you want to use a percentage, set this argument to percent. If you would like to use a flat amount, please set it to flat. Based on the given value, you might also want to adjust the amount argument.


min_price

Set a minimum price that needs to be reached for a purchase to actually apply this discount code. Please write the price in the following format: 19.99


product_requirement

In case you want to limit the discount code to only certain downloads, this argument is made for you. Simply separate the download IDs that are required by a comma. Here is an example:

123,443

product_condition

In case you set this argument to all, it is required to have all downloads from the product_requirement argument within the cart before the coupon will be applied. If you set the argument to any, only one of the products mentioned within the product_requirement argument have to be within the cart.


excluded_products

In case you want to limit certain downloads from applying this coupon code to, this argument is made for you. Simply comma-separate the download IDs that the coupon code should ignore. Here is an example:

32,786

is_not_global

Set this argument to yes in case you do not want to apply the discount code globally on the whole order. If you set this argument to yes, it will only be applied to the downloads you defined within the product_requirement argument. Default: no


is_single_use

Set this argument to yes in case you want to limit the use of this discount code to only one time per customer. Default: no


do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_create_discount action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 3 );
function my_custom_callback_function( $discount_id, $discount, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $discount_id (integer)

    Contains the id of the newly created discount code.
  2. $discount (array)

    An array that contains the validated discount data we sent over to the EDD_Discounts() class
  3. $return_args (array)

    An array containing the information we will send back as the response to the initial webhook caller.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_update_discount

This webhook action allows you to update (or create) a dicsount code within Easy Digital Downloads.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_update_discount Details
discount_id
Required
(Mixed) The discount ID or the discount code of the discount you would like to update.
create_if_none (String) Set this value to "yes" in case the given discount does not exist and you want to create it. Default: no
code (String) The dicsount code you would like to set for this dicsount. Only alphanumeric characters are allowed.
name (String) The name to identify the discount code.
status (String) The status of the discount code.
current_uses (Integer) A number that tells how many times the coupon code has been already used.
max_uses (Integer) The number of how often the discount code can be used in total.
amount (Mixed) The amount of the discount code. If chosen percent, use an interger, for an amount, use float. More info is within the description.
start_date (String) The start date of the availability of the discount code. More info is within the description.
expiration_date (String) The end date of the availability of the discount code. More info is within the description.
type (String) The type of the discount code. Default: percent. More info is within the description.
min_price (Mixed) The minimum price that needs to be reached to use the discount code. More info is within the description.
product_requirement A comma-separated list of download IDs that are required to apply the discount code. More info is within the description.
product_condition (String) A string containing further conditions on when the discount code can be applied. More info is within the description.
excluded_products (String) A comma-separated list, containing all the products that are excluded from the discount code. More info is within the description.
is_not_global (String) Set this argument to "yes" if you do not want to apply the discount code globally to all products. Default: no. More info is within the description.
is_single_use (String) Set this argument to "yes" if you want to limit this discount code to only a single use per customer. Default: no. More info is within the description.
do_action Advanced: Register a custom action after WP Webhooks fires this webhook. More info is within the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
data (Array) Containing all of the predefined data of the webhook, as well as the discount id in case it was successfully updated (or created).

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "The discount code was successfully created.",
    "data": {
        "code": "erthsashtsw",
        "name": "Demo Discount Code",
        "status": "inactive",
        "uses": "5",
        "max": "10",
        "amount": "11.10",
        "start": "05/23/2020 00:00:00",
        "expiration": "06/27/2020 23:59:59",
        "type": "flat",
        "min_price": "22",
        "products": [
            "176",
            "772"
        ],
        "product_condition": "any",
        "excluded-products": [
            "774"
        ],
        "not_global": true,
        "use_once": true,
        "discount_id": 805
    }
}

This webhook action is used to update (or create) a discount code for Easy Digital Downloads within your WordPress system via a webhook call.
The description is uniquely made for the edd_update_discount webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_update_discount

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_update_discount.
  2. It is also required to set the discount_id argument. Please set it to either the discount id ot the discount code you want to update.
  3. All the other arguments are optional and just extend the update process of the EDD discount code.

Tipps

  1. You can also use this webhook action to create a discount code in case it does not exist yet. Simply set the argument create_if_none to yes
  2. By changing the type argument, you can switch between flat or percentage based discounts. More details are down below within the Special Arguments list.

Special Arguments

create_if_none

Set this argument to yes in case you want to create the discount code if it does not exist.


status

Defines the status in which you want to create the discount code with. Possible values are active and inactive. By default, this value is set to active.


current_uses

This argument accepts a number that defines how often this discount code has been already used. Usually, you do not need to define this argument for creating a discount code.


max_uses

This argument defines the maximal number on how often this discount code can be applied. Set it to 0 for unlimited uses.


amount

The amount argument accepts different values, based on the type you set. By default, you can set this value to the number of percents you want to discount the order. E.g.: 10 will be represented as ten percent. If the type argument is set to flat, it would discount 10$ (or the currency you choose for your shop).


start_date

Set the date you want this discount code do become active. We recommend using the SQL format: 2020-03-10 17:16:18. This arguments also accepts other formats - if you have no chance of changing the date format, its the best if you simply give it a try.


expiration_date

Set the date you want this discount code do become inactive. We recommend using the SQL format: 2020-03-10 17:16:18. This arguments also accepts other formats - if you have no chance of changing the date format, its the best if you simply give it a try.


type

This argument defines the type of the discount code. If you want to use a percentage, set this argument to percent. If you would like to use a flat amount, please set it to flat. Based on the given value, you might also want to adjust the amount argument.


min_price

Set a minimum price that needs to be reached for a purchase to actually apply this discount code. Please write the price in the following format: 19.99


product_requirement

In case you want to limit the discount code to only certain downloads, this argument is made for you. Simply separate the download IDs that are required by a comma. Here is an example:

123,443

product_condition

In case you set this argument to all, it is required to have all downloads from the product_requirement argument within the cart before the coupon will be applied. If you set the argument to any, only one of the products mentioned within the product_requirement argument have to be within the cart.


excluded_products

In case you want to limit certain downloads from applying this coupon code to, this argument is made for you. Simply comma-separate the download IDs that the coupon code should ignore. Here is an example:

32,786

is_not_global

Set this argument to yes in case you do not want to apply the discount code globally on the whole order. If you set this argument to yes, it will only be applied to the downloads you defined within the product_requirement argument. Default: no


is_single_use

Set this argument to yes in case you want to limit the use of this discount code to only one time per customer. Default: no


do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_update_discount action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 4 );
function my_custom_callback_function( $discount_id, $discount, $needs_creation, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $discount_id (integer)

    Contains the id of the newly created discount code.
  2. $discount (array)

    An array that contins the validated discount data we sent over to the EDD_Discounts() class
  3. $needs_creation (boolean)

    This value is true if the create_if_none argument is set to yes and the discount code you tried to update, was not found.
  4. $return_args (array)

    An array containing the information we will send back as the response to the initial webhook caller.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_delete_discount

This webhook action allows you to delete a dicsount code within Easy Digital Downloads.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_delete_discount Details
discount_id
Required
(Mixed) The dicsount ID or discount code of the discount you want to delete.
do_action Advanced: Register a custom action after WP Webhooks fires this webhook. More info is within the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
data (Array) Containing the discount id of the deleted discount.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "The discount code was successfully deleted.",
    "data": {
        "discount_id": 803
    }
}

This webhook action is used to delete a discount code for Easy Digital Downloads within your WordPress system via a webhook call.
The description is uniquely made for the edd_delete_discount webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_delete_discount

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_delete_discount.
  2. It is also required to set the discount_id argument. Please set it to either the discount id ot the discount code you want to delete.
  3. All the other arguments are optional and just extend the deletion of the EDD discount code.

Tipps

  1. In case you do not have the discount id, you can also use the discount code to delete the discount.

Special Arguments

do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_delete_discount action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 3 );
function my_custom_callback_function( $discount_id, $discount, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $discount_id (integer)

    Contains the id of the newly created discount code.
  2. $discount (array)

    An array that contains the validated discount data we sent over to the EDD_Discounts() class
  3. $return_args (array)

    An array containing the information we will send back as the response to the initial webhook caller.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_create_subscription

This webhook action allows you to create a subscription within Easy Digital Downloads - Recurring.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_create_subscription Details
expiration_date
Required
(String) The date for the expiration of the subscription. Recommended format: 2021-05-25 11:11:11
profile_id
Required
(String) This is the unique ID of the subscription in the merchant processor, such as PayPal or Stripe.
download_id
Required
(Integer) The ID of the download you want to connect with the subscription.
customer_email
Required
(String) The email of the customer. Please see the description for further details.
period
Required
(String) The billing period of the subscription. Please see the description for further details.
initial_amount (Mixed) The amount for the initial payment. E.g. 39.97
recurring_amount (Mixed) The recurring amount for the subscription. E.g. 19.97
transaction_id (String) This is the unique ID of the initial transaction inside of the merchant processor, such as PayPal or Stripe.
status (String) The status of the given subscription. Please see the description for further details.
created_date (String) The date of creation of the subscription. Recommended format: 2021-05-25 11:11:11
bill_times (Integer) This refers to the number of times the subscription will be billed before being marked as Completed and payments stopped. Enter 0 if payments continue indefinitely.
parent_payment_id (Integer) Use this argument to connect the subscription with an already existing payment. Otherwise, a new one is created. Please see the description for further details.
customer_id (Integer) The id of the customer you want to connect. If it is not given, we try to fetch the user from the customer_email argument. Please see the description for further details.
customer_first_name (String) The first name of the customer. Please see the description for further details.
customer_last_name (String) The last name of the customer. Please see the description for further details.
edd_price_option (Integer) The variation id for a download price option. Please see the description for further details.
gateway (String) The gateway you want to use for your subscription (and maybe payment). Please see the description for further details.
initial_tax_rate (Integer) The percentage for your initial tax rate. Please see the description for further details.
initial_tax (Float) The amount of tax for your initial tax amount. Please see the description for further details.
recurring_tax_rate (Integer) The percentage for your recurring tax rate. Please see the description for further details.
recurring_tax (Float) The amount of tax for your recurring tax amount. Please see the description for further details.
notes (String) A JSON formatted string containing one or multiple subscription notes. Please check the description for further details.
do_action Advanced: Register a custom action after WP Webhooks fires this webhook. More info is within the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
data (Array) Containing the new susbcription id, the payment id, customer id, as well as further details about the subscription.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "The subscription was successfully created.",
    "data": {
        "subscription_id": "23",
        "payment_id": 843,
        "customer_id": 8
    }
}

This webhook action is used to create a subscription for Easy Digital Downloads - Recurring within your WordPress system via a webhook call.
The description is uniquely made for the edd_create_subscription webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_create_subscription

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_create_subscription.
  2. It is also required to set the expiration_date argument. Please set it to the date of expiration. Further details are available down below within the Special Arguments list.
  3. The third argument you need to set is profile_id. The profile id is the unique ID of the subscription in the merchant processor, such as PayPal or Stripe. Further details are available down below within the Special Arguments list.
  4. It is also a requirement to define the product_id argument. Please set it to the id of the download you want to connect with the subscription. Further details are available down below within the Special Arguments list.
  5. The last required argument is the customer_email argument. Please set it to the email of the customer this subscription is for, or leave it empty if you want to create a new payment. Further details are available down below within the Special Arguments list.
  6. Please also set the period argument to the frequency you want to run the subscription it. Please see the Special Arguments section down below for further details.
  7. All the other arguments are optional and just extend the creation of the EDD Subscription.

Tipps

  1. Creating a subscription will also create a payment, except you define the parent_payment_id argument.
  2. Creating the subscription will also create a customer from the given email address of the customer_email argument, except you set the customer_id argument.

Special Arguments

expiration_date

This argument accepts a date string what contains the date of expiration of the subscription. As a format, we recommend the SQL format (2021-05-25 11:11:11), but it also accepts other formats. Please note that in case you set the status argument to trialling, this date field will be ignored since we will calculate the expiration date based on the in the product given trial period.


profile_id

This is the unique ID of the subscription in the merchant processor, such as PayPal or Stripe. It accepts any kind of string.


customer_email

This argument accepts the email of the customer you create the subscription for. In case we could not find a customer with your given data, it will be created. Please note that creating a customer does not automatically create a user within your WordPress system.


period

This is the frequency of the renewals for the subscription. Down below, you will find a list with all of the default subscription periods. Please use the slug as a value (e.g. month).

{
    "day": "Daily",
    "week": "Weekly",
    "month": "Monthly",
    "quarter": "Quarterly",
    "semi-year": "Semi-Yearly",
    "year": "Yearly"
}

transaction_id

This is the unique ID of the initial transaction inside of the merchant processor, such as PayPal or Stripe. The argument accepts any kind of string.


status

This argument allows you to customize the status of the subscription. Please use the slug of the status as a value (e.g. completed). Down below, you will find a list with all available default statuses:

{
    "pending": "Pending",
    "active": "Active",
    "cancelled": "Cancelled",
    "expired": "Expired",
    "trialling": "Trialling",
    "failing": "Failing",
    "completed": "Completed"
}

Please note that in case you choose trialling as a subscription status, we will automatically apply the given trial period instead of the given expiration date from the expiration_date argument.


created_date

This argument accepts a date string what contains the date of expiration of the subscription. As a format, we recommend the SQL format (2021-05-25 11:11:11), but it also accepts other formats. Please note that in case you set the status argument to trialling, this argument will influence the expiration date of the trial perdod, which is defined within the download itself.


parent_payment_id

This argument allows you to connect your subscription with an already existing payment. Please note that if you set this argument, the gateway argument is ignored since the gateway will be based on the gateway of the payment you try to add. If you do not set this argument, we will create a payment automatically for you.


customer_id

Use this argument to connect an already existing customer with your newly created subscription. Please use the customer id and not the user id since these are different things. Please note, that in case you leave this argument empty, we will first try to find an existing customer based on your given email within the customer_email argument, and if we cannot find any customer, we will create one for you based on the given email within the customer_email argument.


customer_first_name

This argument allows you to add a first name to the customer in case it does not exist at that point. If we could find a customer to your given email or the cucstomer id, this argument is ignored. It is only used once a new customer is created. If it is not set, we will use the email as the default name.


customer_last_name

This argument allows you to add a last name to the customer in case it does not exist at that point. If we could find a customer to your given email or the cucstomer id, this argument is ignored. It is only used once a new customer is created. If it is not set, we will use the email as the default name.


edd_price_option

In case you work with multiple price options, please define the chosen price option for your download here. Please note, that the price option needs to be available within the download you chose for the download_id argument.


gateway

Define the gateway you want to use for this subscription. Please note that if you set the parent_payment_id argument, the gateway of the payment is used and this argument is ignored. Please use the slug of the gateway (e.g. paypal). Here is a list of all currently available gateways:

{
    "paypal": "PayPal Standard",
    "manual": "Test Payment",
    "amazon": "Amazon"
}

initial_tax_rate

This argument accepts the percentage of tax that is included within your initial price. E.g.: In case you add 20, it is interpreted as 20% tax.


initial_tax

This argument accepts the amount of tax for the initial payment. E.g.: In case your tax is 13.54$, simply add 13.54


recurring_tax_rate

This argument accepts the percentage of tax that is included within your recurring price. E.g.: In case you add 20, it is interpreted as 20% tax.


recurring_tax

This argument accepts the amount of tax for the recurring payment. E.g.: In case your tax is 13.54$, simply add 13.54


notes

Use this argument to add one or multiple subscription notes to the subscription. This value accepts a JSON, containing one subscription note per line. Here is an example:

[
  "First Note 1",
  "First Note 2"
]

The example above adds two notes.


do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_create_subscription action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 5 );
function my_custom_callback_function( $subscription_id, $subscription, $payment, $customer, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $subscription_id (integer)

    Contains the id of the newly created subscription.
  2. $subscription (object)

    An object of the EDD_Subscription() class with the current subscription.
  3. $payment (object)

    An object of the EDD_Payment() class with the current related payment.
  4. $customer (object)

    An object of the EDD_Recurring_Subscriber() class with the current related customer.
  5. $return_args (array)

    An array containing the information we will send back as the response to the initial webhook caller.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_update_subscription

This webhook action allows you to update a subscription within Easy Digital Downloads - Recurring.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_update_subscription Details
subscription_id
Required
(Integer) The id of the subscription you would like to update.
expiration_date (String) The date for the expiration of the subscription. Recommended format: 2021-05-25 11:11:11
profile_id (String) This is the unique ID of the subscription in the merchant processor, such as PayPal or Stripe.
download_id (Integer) The ID of the download you want to connect with the subscription.
customer_email (String) The email of the customer in case you do not have the customer id. Please see the description for further details.
period (String) The billing period of the subscription. Please see the description for further details.
initial_amount (Mixed) The amount for the initial payment. E.g. 39.97
recurring_amount (Mixed) The recurring amount for the subscription. E.g. 19.97
transaction_id (String) This is the unique ID of the initial transaction inside of the merchant processor, such as PayPal or Stripe.
status (String) The status of the given subscription. Please see the description for further details.
created_date (String) The date of creation of the subscription. Recommended format: 2021-05-25 11:11:11
bill_times (Integer) This refers to the number of times the subscription will be billed before being marked as Completed and payments stopped. Enter 0 if payments continue indefinitely.
parent_payment_id (Integer) Use this argument to connect the subscription with an already existing payment. Please see the description for further details.
customer_id (Integer) The id of the customer you want to connect. If it is not given, we try to fetch the user from the customer_email argument. Please see the description for further details.
edd_price_option (Integer) The variation id for a download price option. Please see the description for further details.
initial_tax_rate (Integer) The percentage for your initial tax rate. Please see the description for further details.
initial_tax (Float) The amount of tax for your initial tax amount. Please see the description for further details.
recurring_tax_rate (Integer) The percentage for your recurring tax rate. Please see the description for further details.
recurring_tax (Float) The amount of tax for your recurring tax amount. Please see the description for further details.
notes (String) A JSON formatted string containing one or multiple subscription notes. Please check the description for further details.
do_action Advanced: Register a custom action after WP Webhooks fires this webhook. More info is within the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
data (Array) Containing the new susbcription id, the payment id, customer id, as well as further details about the subscription.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "The discount code was successfully deleted.",
    "data": {
        "discount_id": 803
    }
}

This webhook action is used to update an existing subscription for Easy Digital Downloads - Recurring within your WordPress system via a webhook call.
The description is uniquely made for the edd_update_subscription webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_update_subscription

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_update_subscription.
  2. It is also required to set the subscription_id argument. Please set it to the id of the subscription you would like to update. Further details are available down below within the Special Arguments list.
  3. All the other arguments are optional and just extend the update process of the EDD Subscription code.

Tipps

  1. In case you would like to update the customer but you do not have the customer id, simply provide the customer email within the customer_email argument and we will fetch the customer automatically.

Special Arguments

subscription_id

The id of the subscription you would like to update. Please note that the subscription needs to be existent, otherwise we will throw an error.


expiration_date

This argument accepts a date string what contains the date of expiration of the subscription. As a format, we recommend the SQL format (2021-05-25 11:11:11), but it also accepts other formats.


profile_id

This is the unique ID of the subscription in the merchant processor, such as PayPal or Stripe. It accepts any kind of string.


customer_email

This argument accepts the email of the customer you would like to set for the susbcription. You can set this argument in case you do not have the customer id of the customer available.


period

This is the frequency of the renewals for the subscription. Down below, you will find a list with all of the default subscription periods. Please use the slug as a value (e.g. month).

{
    "day": "Daily",
    "week": "Weekly",
    "month": "Monthly",
    "quarter": "Quarterly",
    "semi-year": "Semi-Yearly",
    "year": "Yearly"
}

transaction_id

This is the unique ID of the initial transaction inside of the merchant processor, such as PayPal or Stripe. The argument accepts any kind of string.


status

This argument allows you to customize the status of the subscription. Please use the slug of the status as a value (e.g. completed). Down below, you will find a list with all available default statuses:

{
    "pending": "Pending",
    "active": "Active",
    "cancelled": "Cancelled",
    "expired": "Expired",
    "trialling": "Trialling",
    "failing": "Failing",
    "completed": "Completed"
}


created_date

This argument accepts a date string what contains the date of expiration of the subscription. As a format, we recommend the SQL format (2021-05-25 11:11:11), but it also accepts other formats.


parent_payment_id

This argument allows you to connect your subscription with an already existing payment.


customer_id

Use this argument to connect an already existing customer with your subscription. Please use the customer id and not the user id since these are different things. Please note, that in case you leave this argument empty, we will first try to find an existing customer based on your given email within the customer_email argument, and if we found a customer with it, we will map the customer id automatically.


edd_price_option

In case you work with multiple price options, please define the chosen price option for your download here. Please note, that the price option needs to be available within the download you chose for the download_id argument.


initial_tax_rate

This argument accepts the percentage of tax that is included within your initial price. E.g.: In case you add 20, it is interpreted as 20% tax.


initial_tax

This argument accepts the amount of tax for the initial payment. E.g.: In case your tax is 13.54$, simply add 13.54


recurring_tax_rate

This argument accepts the percentage of tax that is included within your recurring price. E.g.: In case you add 20, it is interpreted as 20% tax.


recurring_tax

This argument accepts the amount of tax for the recurring payment. E.g.: In case your tax is 13.54$, simply add 13.54


notes

Use this argument to add one or multiple subscription notes to the subscription. This value accepts a JSON, containing one subscription note per line. Here is an example:

[
  "First Note 1",
  "First Note 2"
]

The example above adds two notes.


do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_update_subscription action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 4 );
function my_custom_callback_function( $subscription_id, $subscription, $sub_args, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $subscription_id (integer)

    Contains the id of the newly created subscription.
  2. $subscription (object)

    An object of the EDD_Subscription() class with the current subscription.
  3. $sub_args (array)

    An array containing all the susbcription arguments that we are sending over to the EDD_Subscription()->update() function.
  4. $return_args (array)

    An array containing the information we will send back as the response to the initial webhook caller.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_delete_subscription

This webhook action allows you to delete a subscription within Easy Digital Downloads - Recurring.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_delete_subscription Details
subscription_id
Required
(Integer) The id of the subscription you would like to delete.
keep_payment_meta (String) Set this value to "yes" if you do not want to delet the relation of the subscription on the related payment. Default: no
keep_list_of_trials (String) Set this value to "yes" to delete the list of trials of the user that are related to the given subscription id. Default: no
do_action Advanced: Register a custom action after WP Webhooks fires this webhook. More info is within the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
data (Array) Containing the new susbcription id and other arguments set during the deletion of the subscription.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "The subscription was successfully deleted.",
    "data": {
        "subscription_id": 21,
        "keep_payment_meta": false,
        "keep_list_of_trials": false
    }
}

This webhook action is used to delete an existing subscription for Easy Digital Downloads - Recurring within your WordPress system via a webhook call.
The description is uniquely made for the edd_delete_subscription webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_delete_subscription

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_delete_subscription.
  2. It is also required to set the subscription_id argument. Please set it to the id of the subscription you would like to delete. Further details are available down below within the Special Arguments list.
  3. All the other arguments are optional and just extend the deletion of the EDD Subscription.

Tipps

  1. By default, we properly erase the subsription including the relations on the customer and payments.

Special Arguments

subscription_id

The id of the subscription you would like to delete. Please note that the subscription needs to be existent, otherwise we will throw an error.


keep_payment_meta

Set this value to yes to keep the payment meta (meta key on the payment: _edd_subscription_payment). Usually, it makes sense to remove this relation as well. That's why this value is deleted by default. Please only set it to yes in case you need to keep the meta key.


keep_list_of_trials

Set this value to yes to keep the meta entry for the list of trials (meta key on the user: edd_recurring_trials). Usually, it makes sense to remove this relation as well. That's why this value is deleted by default. Please only set it to yes in case you need to keep the meta key.


do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_delete_subscription action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 3 );
function my_custom_callback_function( $subscription_id, $subscription, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $subscription_id (integer)

    Contains the id of the deleted subscription.
  2. $subscription (object)

    An object of the EDD_Subscription() class with the currently deleted subscription.
  3. $return_args (array)

    An array containing the information we will send back as the response to the initial webhook caller.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_create_license

This webhook action allows you to create a license within Easy Digital Downloads - Software Licensing.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_create_license Details
download_id
Required
(Integer) The id of the download you want to associate with the license. Please see the description for further details.
payment_id
Required
(Integer) The id of the payment you want to associate with the license. Please see the description for further details.
price_id (String) In case you work with multiple pricing options (variations) within the same product, please set the pricing id here. Please see the description for further details.
cart_index (Integer) The numerical index in the cart items array of the product the license key is associated with. Please see the description for further details.
existing_license_ids (String) A JSON formatted string of existing license ids. Please see the description for further information.
parent_license_id (Integer) Set the parent id of this license in case you want to use this license as a child license. Please see the description for further details.
activation_limit (Integer) A number representing the amount of possible activations at the same time. set it to 0 for unlimited activations. Please see the description for further details.
license_length (Integer) The length of the license key.
expiration_date (String) In case you want to customize the expiration date, you can define the date here. Otherwise it will be calculated based on the added product. Please see the description for further details.
is_lifetime (String) Set this value to "yes" to mark the license as a lifetime license. Default: no
manage_sites (String) A JSON formatted string containing one or multiple site urls. Please see the description for further details.
logs (String) A JSON formatted string containing one or multiple logs. Please see the description for further details.
license_meta (String) A JSON formatted string containing one or multiple meta values. Please see the description for further details.
license_action (String) Do additional, native actions using the license. Please see the description for further details.
do_action Advanced: Register a custom action after WP Webhooks fires this webhook. More info is within the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
data (Array) Containing the new license id and other arguments set during the creation of the license.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "The license was successfully created.",
    "data": {
        "license_id": 17,
        "download_id": 285,
        "payment_id": 843,
        "price_id": "2",
        "cart_index": 0,
        "license_options": {
            "activation_limit": 0,
            "license_length": "32",
            "expiration_date": 1621654140,
            "is_lifetime": true
        },
        "license_meta": "{\n  \"meta_1\": \"test1\",\n  \"meta_2\": \"ironikus-serialize{\\\"test_key\\\":\\\"wow\\\",\\\"testval\\\":\\\"new\\\"}\"\n}",
        "logs": "[\n  {\n    \"title\": \"Log 1\",\n    \"message\": \"This is my description for log 1\"\n  },\n  {\n    \"title\": \"Log 2\",\n    \"message\": \"This is my description for log 2\",\n    \"type\": null\n  }\n]"
    }
}

This webhook action is used to create a license for Easy Digital Downloads within your WordPress system via a webhook call.
The description is uniquely made for the edd_create_license webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_create_license

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_create_license.
  2. It is also required to set the download_id argument. Please set it to the download id you want to connect with the license.
  3. Another required argument is the payment_id argument. Please set it to the payment id you want to connect the license with.
  4. All the other arguments are optional and just extend the creation of the EDD license.

Tipps

  1. This webhook creates the license by default with the status inactive, which will automatically switch to active once the user activates his first site.
  2. Please note that the download you would like to connect, must have licensing activated within the product. Otherwise we throw an error.

Special Arguments

download_id

The download id of the download (product) you need to relate with the license. Please note that the product needs to have licensing activated. We will use this download to fetch certain information as expiration, pricing, bundles, etc.


payment_id

The payment id of the payment you need to relate with the license. It will be used to assign the payment with the newly created license. EDD also uses this argument to assign the user to the license, as well as the customer.


price_id

In case you work with pricing options (variations) for your download, please set the pricing id of the variation price you want to use here. The pricing id is called Download file ID on the edit-download page.


cart_index

The identifier of the given download within the cart array. You can use this argument to associate the license with a specifc product wiithin the payment.


existing_license_ids

Use this argument to add one or multiple, existing licenses to the subscription using the license id. This value accepts a JSON, containing one license id per line. Here is an example:

[
  342,
  365
]

The example above adds two licenses.
Please note: Defining ids within this argument causes the added licenses to bbe added as child-licenses (the parent will be set to this license).


parent_license_id

Use this argument to set a parent license for the newly created license.


activation_limit

In case you would like to customize the licensing slots for your license (the amount of wesbites that can be added), you can use this argument. Please set it to e.g. 20 to allow 20 licensing slots. If you leave it empty, the values re fetched accordingly from the given download. If you set this argument to 0, the license will contain unlimited license slots.


license_length

The length of the license key itself. In case you set this argument to 64, the license key will look as followed:

d96ef9c6e8d4259c11bf5f7bad4f6d67232daddee75cced747de0aed7d2d6c99

expiration_date

You can use this argument to customize the expiration date. It allows you to set most kind of date formats, but we suggest you using the SQL format: 2021-05-25 11:11:11


is_lifetime

Set the value to yes to never expire this license. Default: no. Please note that setting this argument to yes will ignore the expiration date.


manage_sites

Use this argument to add and/or remove sites on a license. It accepts a JSON formatted string containg the site URLs. Here is an example:

[
  "https://demo.com",
  "https://demo.demo",
  "remove:https://demo3.demo"
]

The example above adds two new site URLs. It also removes one site URL. To remove a site URL, please place remove: in front of the site URL.


logs

Use this argument to add one or multiple log entries to the license. This value accepts a JSON formated string. Here is an example:

[
  {
    "title": "Log 1",
    "message": "This is my description for log 1"
  },
  {
    "title": "Log 2",
    "message": "This is my description for log 2",
    "type": null
  }
]

The example above adds two logs. The type key can contain a single term slug, single term id, or array of either term slugs or ids. For further details on the type key, please check out the $terms variable within the wp_set_object_terms() function:https://developer.wordpress.org/reference/functions/wp_set_object_terms/


license_meta_arr

This argument allows you to add/update or remove one or multiple license meta values to your newly created license, using a JSON string. Easy Digital Downloads uses a custom table for these meta values. Here are some examples on how you can use it:

  • Add/update meta values

    This JSON shows you how to add simple meta values for your license.

    {
      "meta_1": "test1",
      "meta_2": "test2"
    }

    The key is always the license meta key. On the right, you always have the value for the license meta value. In this example, we add two meta values to the license meta. In case a meta key already exists, it will be updated.

  • Delete meta values

    You can also delete existing meta key by setting the value to ironikus-delete. This way, the meta will be removed. Here is an example:

    {
      "meta_1": "test1",
      "meta_2": "ironikus-delete"
    }

    The example above will add the meta key meta_1 with the value test1 and it deletes the meta key meta_2 including its value.

  • Add/update/remove serialized meta values

    Sometimes, it is necessary to add serialized arrays to your data. Using the json below, you can do exactly that. You can use a simple JSON string as the meta value and we automatically convert it to a serialized array once you place the identifier ironikus-serialize in front of it. Here is an example:

    {
      "meta_1": "test1",
      "meta_2": "ironikus-serialize{\"test_key\":\"wow\",\"testval\":\"new\"}"
    }

    This example adds a simple meta with meta_1 as the key and test1 as the value. The second meta value contains a json value with the identifier ironikus-serialize in the front. Once this value is saved to the database, it gets turned into a serialized array. In this example, it would look as followed:

    a:2:{s:8:"test_key";s:3:"wow";s:7:"testval";s:3:"new";}


license_action

This argument allows you to fire further native features of the licensing class. Please find further details down below:

  • Enable licenses

    This value allows you to enable the license and all of its child licenses. It does it by checking on the activation count and if some sites are active, it will set the license to active, otherwise it will set it to inactive.

    enable
  • Disable licenses

    This value allows you to disable the license and all of its child licenses. It will set the license to disabled.

    disable


do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_create_license action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 3 );
function my_custom_callback_function( $license_id, $license, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $license_id (Integer)

    Contains the id of the newly created license.
  2. $license (integer)

    Contains the EDD_SL_License() object of the license.
  3. $return_args (array)

    An array containing the information we will send back as the response to the initial webhook caller.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_update_license

This webhook action allows you to update a license within Easy Digital Downloads - Software Licensing.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_update_license Details
license_id
Required
(Mixed) The license id or the license key of the license you would like to update. Please see the description for further details.
download_id (Integer) The id of the download you want to associate with the license. Please see the description for further details.
payment_id (Integer) The id of the payment you want to associate with the license. Please see the description for further details.
license_key (String) A new license key for the susbcription. Please see the description for further details.
price_id (String) In case you work with multiple pricing options (variations) within the same product, please set the pricing id here. Please see the description for further details.
cart_index (Integer) The numerical index in the cart items array of the product the license key is associated with. Please see the description for further details.
status (String) The status of the given license. Please see the description for further details.
parent_license_id (Integer) Set the parent id of this license in case you want to use this license as a child license. Please see the description for further details.
activation_limit (Integer) A number representing the amount of possible activations at the same time. set it to 0 for unlimited activations. Please see the description for further details.
date_created (String) In case you want to customize the creation date, you can define the date here. Please see the description for further details.
expiration_date (String) In case you want to customize the expiration date, you can define the date here. Otherwise it will be calculated based on the added product. Please see the description for further details.
manage_sites (String) A JSON formatted string containing one or multiple site urls. Please see the description for further details.
logs (String) A JSON formatted string containing one or multiple logs. Please see the description for further details.
license_meta (String) A JSON formatted string containing one or multiple meta values. Please see the description for further details.
license_action (String) Do additional, native actions using the license. Please see the description for further details.
do_action Advanced: Register a custom action after WP Webhooks fires this webhook. More info is within the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
data (Array) Containing the license id, as well as the license key and other arguments set during the update of the license.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "The license was successfully updated.",
    "data": {
        "license_id": 17,
        "download_id": 176,
        "payment_id": 711,
        "price_id": "2",
        "cart_index": 0,
        "license_options": {
            "download_id": 176,
            "payment_id": 711,
            "price_id": "2",
            "expiration": 1621690140,
            "customer_id": "1",
            "user_id": "1"
        },
        "license_meta": "{\n  \"meta_5\": \"test5\",\n  \"meta_6\": \"ironikus-serialize{\\\"test_key\\\":\\\"wow\\\",\\\"testval\\\":\\\"new\\\"}\"\n}",
        "license_key": "e5e52aa45bb0e7c82a471e8234f6e427",
        "logs": "[\n  {\n    \"title\": \"Log 5\",\n    \"message\": \"This is my description for log 1\"\n  },\n  {\n    \"title\": \"Log 6\",\n    \"message\": \"This is my description for log 2\",\n    \"type\": null\n  }\n]"
    }
}

This webhook action is used to update a license for Easy Digital Downloads within your WordPress system via a webhook call.
The description is uniquely made for the edd_update_license webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_update_license

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_update_license.
  2. It is also required to set the license_id argument. You can set it to either the license id or the license key.
  3. All the other arguments are optional and just extend the creation of the EDD license.

Tipps

  1. In case you would like to set the license to a lifetime validity, simply set the expiration_date argument to 0.

Special Arguments

license_id

This argument accepts either the numeric license id or the license key that was set for the license. E.g. 4fc336680bf576cc0298777278ceb15a


download_id

The download id of the download (product) you want to relate with the license. Please note that the product needs to have licensing activated.


payment_id

The payment id of the payment you want to relate with the license. It will be used to assign the user to the license, as well as the customer.


license_key

This argument allows you to update the license key for the given license. Alternatively, you can also set the argument value to regenerate to automatically regenerte the license key.


price_id

In case you work with pricing options (variations) for your downloads, use this argument to set the pricing id of the variation price. The pricing id is called Download file ID on the edit-download page.


cart_index

The identifier of the given download within the cart array. You can use this argument to associate the license with a specifc product wiithin the payment.



parent_license_id

Use this argument to set a parent license for the updated license.


activation_limit

In case you would like to customize the licensing slots for your license (the amount of wesbites that can be added), you can use this argument. Please set it to e.g. 20 to allow 20 licensing slots. If you set this argument to 0, the license will contain unlimited license slots.


date_created

You can use this argument to customize the creation date. It allows you to set most kind of date formats, but we suggest you using the SQL format: 2021-05-25 11:11:11


expiration_date

You can use this argument to customize the expiration date. It allows you to set most kind of date formats, but we suggest you using the SQL format: 2021-05-25 11:11:11. If you would like to never expire the license, set this argument to 0.


manage_sites

Use this argument to add and/or remove sites on a license. It accepts a JSON formatted string containg the site URLs. Here is an example:

[
  "https://demo.com",
  "https://demo.demo",
  "remove:https://demo3.demo"
]

The example above adds two new site URLs. It also removes one site URL. To remove a site URL, please place remove: in front of the site URL.


logs

Use this argument to add one or multiple log entries to the license. This value accepts a JSON formated string. Here is an example:

[
  {
    "title": "Log 1",
    "message": "This is my description for log 1"
  },
  {
    "title": "Log 2",
    "message": "This is my description for log 2",
    "type": null
  }
]

The example above adds two logs. The type key can contain a single term slug, single term id, or array of either term slugs or ids. For further details on the type key, please check out the $terms variable within the wp_set_object_terms() function:https://developer.wordpress.org/reference/functions/wp_set_object_terms/


license_meta_arr

This argument allows you to add/update or remove one or multiple license meta values to your newly created license, using a JSON string. Easy Digital Downloads uses a custom table for these meta values. Here are some examples on how you can use it:

  • Add/update meta values

    This JSON shows you how to add simple meta values for your license.

    {
      "meta_1": "test1",
      "meta_2": "test2"
    }

    The key is always the license meta key. On the right, you always have the value for the license meta value. In this example, we add two meta values to the license meta. In case a meta key already exists, it will be updated.

  • Delete meta values

    You can also delete existing meta key by setting the value to ironikus-delete. This way, the meta will be removed. Here is an example:

    {
      "meta_1": "test1",
      "meta_2": "ironikus-delete"
    }

    The example above will add the meta key meta_1 with the value test1 and it deletes the meta key meta_2 including its value.

  • Add/update/remove serialized meta values

    Sometimes, it is necessary to add serialized arrays to your data. Using the json below, you can do exactly that. You can use a simple JSON string as the meta value and we automatically convert it to a serialized array once you place the identifier ironikus-serialize in front of it. Here is an example:

    {
      "meta_1": "test1",
      "meta_2": "ironikus-serialize{\"test_key\":\"wow\",\"testval\":\"new\"}"
    }

    This example adds a simple meta with meta_1 as the key and test1 as the value. The second meta value contains a json value with the identifier ironikus-serialize in the front. Once this value is saved to the database, it gets turned into a serialized array. In this example, it would look as followed:

    a:2:{s:8:"test_key";s:3:"wow";s:7:"testval";s:3:"new";}


license_action

This argument allows you to fire further native features of the licensing class. Please find further details down below:

  • Enable licenses

    This value allows you to enable the license and all of its child licenses. It does it by checking on the activation count and if some sites are active, it will set the license to active, otherwise it will set it to inactive.

    enable
  • Disable licenses

    This value allows you to disable the license and all of its child licenses. It will set the license to disabled.

    disable


do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_update_license action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 3 );
function my_custom_callback_function( $license_id, $license, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $license_id (Integer)

    Contains the id of the newly created license.
  2. $license (integer)

    Contains the EDD_SL_License() object of the license.
  3. $return_args (array)

    An array containing the information we will send back as the response to the initial webhook caller.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_renew_license

This webhook action allows you to renew a license within Easy Digital Downloads - Software Licensing.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_renew_license Details
license_id
Required
(Mixed) The license id or the license key of the license you would like to renew. Please see the description for further details.
payment_id
Required
(Integer) The payment id of the payment you want to use to process the renewal.
do_action Advanced: Register a custom action after WP Webhooks fires this webhook. More info is within the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
data (Array) Containing the license id, as well as the associated payment id of the license.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "The license was successfully renewed.",
    "data": {
        "license_id": 17,
        "payment_id": 843
    }
}

This webhook action is used to renew a license for Easy Digital Downloads within your WordPress system via a webhook call.
The description is uniquely made for the edd_renew_license webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_renew_license

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_renew_license.
  2. It is also required to set the license_id argument. You can set it to either the license id or the license key.
  3. You also need to define the payment id of the payment you want to use to process the renewal.
  4. All the other arguments are optional and just extend the creation of the EDD license.

Tipps

  1. It is required that your payment is existent before you try to process a renewal. Otherwise it fails.

Special Arguments

license_id

This argument accepts either the numeric license id or the license key that was set for the license. E.g. 4fc336680bf576cc0298777278ceb15a


payment_id

The payment id of the payment you want to use for the renewal of the license. We will take, for example, the duration from the product within the payment.


do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_renew_license action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 3 );
function my_custom_callback_function( $license_id, $license, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $license_id (Integer)

    Contains the id of the renewed license.
  2. $license (integer)

    Contains the EDD_SL_License() object of the license.
  3. $return_args (array)

    An array containing the information we will send back as the response to the initial webhook caller.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

edd_delete_license

This webhook action allows you to delete a license within Easy Digital Downloads - Software Licensing.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to edd_delete_license Details
license_id
Required
(Mixed) The license id or the license key of the license you would like to delete. Please see the description for further details.
do_action Advanced: Register a custom action after WP Webhooks fires this webhook. More info is within the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )
data (Array) Containing the license id, as well as the license object.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "The license was successfully deleted.",
    "data": {
        "license_id": "4fc336680bf576cc0298777278ceb15a",
        "license": {
            "ID": 16
        }
    }
}

This webhook action is used to delete a license for Easy Digital Downloads within your WordPress system via a webhook call.
The description is uniquely made for the edd_delete_license webhook action.
In case you want to first understand how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use edd_delete_license

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to edd_delete_license.
  2. It is also required to set the license_id argument. You can set it to either the license id or the license key.
  3. All the other arguments are optional and just extend the creation of the EDD license.

Tipps

  1. In case you already deleted the license and there is no license with your given id or key anymore, we will also throw an error.

Special Arguments

license_id

This argument accepts either the numeric license id or the license key that was set for the license. E.g. 4fc336680bf576cc0298777278ceb15a


do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the edd_delete_license action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 3 );
function my_custom_callback_function( $license_id, $license, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $license_id (Integer)

    Contains the id of the deleted license.
  2. $license (integer)

    Contains the EDD_SL_License() object of the license.
  3. $return_args (array)

    An array containing the information we will send back as the response to the initial webhook caller.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

send_email

This webhook action allows you to send an email from your WordPress site.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to send_email Details
send_to
Required
(string) Comma-separated list of email addresses you want to send the message to.
subject
Required
(string) Email subject
message
Required
(string) Message contents
headers (string) A JSON formatted string contaiing additional settings for the email such as CC, BCC, From etc. - Please see the description for further details.
attachments (string) A JSON formatted string contaiing attachments that should be added to the email. Please see the description for further information.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful.
data (array) Further details about the sent data.

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "Email successfully sent.",
    "data": {
        "send_to": "demo@demo.demo",
        "subject": "This is my email Subject",
        "message": "This is my HTML message!",
        "headers": [
            "Content-Type: text/html; charset=UTF-8",
            "From: Sender Name ",
            "Cc: Receiver Name ",
            "Cc: onlyemail@someemail.demo",
            "Bcc: bccmail@someemail.demo",
            "Reply-To: Reply Name "
        ],
        "attachments": [
            "/Your/full/server/path/wp-content/uploads/2020/06/my-custom-file.jpg"
        ]
    }
}

This webhook action is used to send an email from your WordPress system via a webhook call.
The description is uniquely made for the send_email webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use send_email

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to send_email.
  2. It is also required to set the argument send_to, which contains a simple email or a comma-separated list of emails you want to sent the mail to.
  3. Another required argument is subject, which contains the email subject you want to use for your email.
  4. The last required argument is the message argument, which contains the email body or the main content you want to show within your email.
  5. All the other arguments are optional and just extend the fetching of the posts.

Tipps

  1. To use HTML within your email, you need to set the content type to text/html. Please see the headers argument within the Special Arguments list for further details.
  2. You can also set further settings like CC emails or BCC emails. Please see the headers argument within the Special Arguments list for further details.

Special Arguments

send_to

This argument should contain the email address(es) you want to send this email to. To use multiple ones, simply separate them with a comma:

demoemail@somedomain.demo,anotheremail@somedomain.demo

headers

This argument allows you to add further settings to your email using a JSON formatted string. Down below you will find a predefined JSON with the most common settings. If you want to read further on what's possible, you can checkout the following documentation:
https://developer.wordpress.org/reference/functions/wp_mail/

The example below shows common settings within the formatted JSON for the headers argument. Explanations for each line are down below.

[
  "Content-Type: text/html; charset=UTF-8",
  "From: Sender Name ",
  "Cc: First CC Name ",
  "Cc: onlyemail@someemail.demo",
  "Bcc: bccmail@someemail.demo",
  "Reply-To: Reply Name "
]
  1. Content-Type: This entry show you how you can customize the default content type.
  2. Cc: This line allows you to show a custom from address. You can either use the simply email or the notation in the example to show further details about the receiver.
  3. Cc: You can also define multiple times the Cc or Bcc entries if you want to send it to multiple persons. Also, this example shows how you can use only the email.
  4. Bcc: The Bcc entry allows the same settings as the Cc entry.
  5. Reply-To: This entry allows you to specify a different reply address for your email. You can either use the seen notation or a simple email as seen in the Cc example.

attachments

This argument allows you to attach one or multiple files to the email using a JSON formatted string. If you want to read further on what's possible, you can check out the following documentation:
https://developer.wordpress.org/reference/functions/wp_mail/

The example below shows how you can use this argument. Explanations for each line are down below.

[
  "/Your/full/server/path/wp-content/uploads/2020/06/my-custom-file.jpg",
  "{content-dir}/uploads/2020/06/another-file.png"
]
  1. Direct path: The fist line adds a jpeg image to the email. It does it by using the direct path of the image on the server.
  2. Dynamic path: In case you do not want to hardcode the dynamic path, you can also use our {content-dir} tag, which automatically adds the direct path.

do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the send_email action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 2 );
function my_custom_callback_function( $check, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $check (bool)

    Returns true if the email was sent and false if not.
  2. $return_args (array)

    Contains the response data of the request, which also include the complete validated data we used for sending the email.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

set_terms

Connect whole taxonomy terms to a post.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to set_terms Details
object_id
Required
The object to relate to. (Post ID)
taxonomy
Required
The context in which to relate the term to the object. (Taxonomy slug)
terms The terms you want to set. Please see the description for more information.
append Please set this value to "yes" in case you want to append the taxonomies. If set to no, all previous entries to the defined taxonomies will be deleted. Default "no"
do_action Advanced: Register a custom action after WP Webhooks fires this webhook. More infos are in the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
data (mixed) The taxonomy term ids on success or wp_error on failure.
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

$return_args = array(
	'success' => false,
	'msg' => '',
	'data' => '',
);
        

This webhook action is used to assign a whole taxonomy term to a post via a webhook call.
This description is uniquely made for the set_terms webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use set_terms

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to set_terms.
  2. It is also required to set the post id of the post you want to assign the taxonomy term to. You can do that by using the object_id argument.
  3. The last required argument is taxonomy. Please set it to the slug of the taxonomy you would like to assign.
  4. All the other arguments are optional and just extend the process of assigning a taxonomy to a post.

Special Arguments

terms

To append taxonomy terms, simple separate them with a comma. You can either use a single term slug, single term id, or array of either term slugs or ids. Here is an example:

term-1,term-2,term-3

Important: Passing an empty value will remove all related terms.


append

Set this argument to yes if you to append the taxonomies. If the argument is set to no, all existing taxonomies on the given post (via the object_id argument) will be removed before the new ones are added. Default is no


do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the set_terms action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 5 );
function my_custom_callback_function( $return_args, $object_id, $terms, $taxonomy, $append ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $return_args (array)

    Contains all the data we send back to the webhook action caller. The data includes the following key: msg, success, data
  2. $object_id (integer)

    Contains the post id of the post you want to assign the taxonomies to.
  3. $terms (string)

    Contains the value of the terms argument that was set within the webhook call.
  4. $taxonomy (string)

    Contains the taxonomy slug of the taxonomy you want to assign to the given post.
  5. $append (bool)

    Contains true if the append argument was set to yes and false if it was set to no.

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.

manage_term_meta

Create, update and delete taxonomy term meta via a webhook call.
Argument Description More
action
Required
Always required. Determines which webhook action you want to target. (Alternatively, set this value as a query parameter within the URL). For this webhook action, please set it to manage_term_meta Details
taxonomy
Required
(String) The slug of the taxonomy you want to update the items of.
term_value
Required
(Mixed) The identifier of the term value. This can be the term id, name or slug. If you want to change the value type, use the get_term_by argument. Default: term id
manage_meta_data
Required
(String) A JSON formatted string containing all of the term meta values you want to create/update/delete. Please see the description for further details.
get_term_by (String) An identifier on what term_value data you want to use to fetch the term. Default: term_id - Please see the description for further details.
do_action Advanced: Register a custom action after WP Webhooks fires this webhook. More infos are in the description.
Argument Description
success (Bool) True if the action was successful, false if not. E.g. array( 'success' => true )
data (mixed) The taxonomy term id on success or wp_error on failure, including other values from the request.
msg (string) A message with more information about the current request. E.g. array( 'msg' => "This action was successful." )

Here is an example of all the available fields. The fields may vary based on custom extensions, third party plugins or different values.

{
    "success": true,
    "msg": "Taxonomy term meta was upated successfully.",
    "data": {
        "term_id": "91",
        "taxonomy": "category",
        "get_term_by": false,
        "term_value": "91",
        "manage_meta_data": {
            "success": true,
            "msg": "The meta data was successfully executed.",
            "data": {
                "add_term_meta": [
                    {
                        "meta_key": "first_add_custom_key",
                        "meta_value": "Some custom value",
                        "unique": false,
                        "response": 26
                    },
                    {
                        "meta_key": "second_add_custom_key",
                        "meta_value": {
                            "some_array_key": "Some array Value"
                        },
                        "unique": true,
                        "response": 27
                    }
                ],
                "update_term_meta": [
                    {
                        "meta_key": "update_custom_key",
                        "meta_value": "Some custom value",
                        "prev_value": false,
                        "response": 28
                    },
                    {
                        "meta_key": "second_update_custom_key",
                        "meta_value": "The new value",
                        "prev_value": "The previous value",
                        "response": 29
                    }
                ]
            }
        },
        "do_action": ""
    }
}
        

This webhook action is used to update taxonomy term meta on a taxonomy term via a webhook call.
This description is uniquely made for the manage_term_meta webhook action.
In case you want to first understand on how to setup webhook actions in general, please check out the following manuals:
https://ironikus.com/docs/article-categories/get-started/

How to use manage_term_meta

  1. The first argument you need to set within your webhook action request is the action argument. This argument is always required. Please set it to manage_term_meta.
  2. It is also required to set the taxonomy argument. This must contain the taxonomy slug.
  3. Another argument that needs to be set is the term_value argument, which should contain either the term id, the term slug or the term name. Please see the Special Arguments list for further details.
  4. Lastly, it is required to add the manage_meta_data argument, which must contain a JSON formatted string as stated below within the Special Arguments list.
  5. All the other arguments are optional and just extend the process of managing the taxonomy term meta.

Special Arguments

taxonomy

Since taxonomy term slugs are not unique outside of the taxonomy, it is required to set the taxonomy slug. Please note, that it must be the slug of the taxonomy and not the name or label.


term_value

The term value contains either the term id, the term slug or the term name. Which value you set must be determined within the get_term_by argument. Default is the term id


get_term_by

This argument determines the type for the term_value argument. Possible values are: id (term id), slug, or name. Default: id


manage_meta_data

This argument integrates the full features of managing term related meta values.

Please note: This argument is very powerful and requires some good understanding of JSON. It is integrated with the commonly used functions for managing term meta within WordPress. You can find a list of all avaialble functions here:

Down below you will find a complete JSON example that shows you how to use each of the functions above.

We also offer JSON to array/object serialization for single term meta values. This means, you can turn JSON into a serialized array or object.
This argument accepts a JSON construct as an input. This construct contains each available function as a top-level key within the first layer and the assigned data respectively as a value. If you want to learn more about each line, please take a closer look at the bottom of the example.

{
   "add_term_meta":[
      {
        "meta_key": "first_custom_key",
        "meta_value": "Some custom value"
      },
      {
        "meta_key": "second_custom_key",
        "meta_value": { "some_array_key": "Some array Value" },
        "unique": true
      } 
    ],
   "update_term_meta":[
      {
        "meta_key": "first_custom_key",
        "meta_value": "Some custom value"
      },
      {
        "meta_key": "second_custom_key",
        "meta_value": "The new value",
        "prev_value": "The previous value"
      } 
    ],
   "delete_term_meta":[
      {
        "meta_key": "first_custom_key"
      },
      {
        "meta_key": "second_custom_key",
        "meta_value": "Target specific value"
      } 
    ]
}

Down below you will find a list that explains each of the top level keys.

  1. add_term_meta

    This key refers to the add_term_meta() function of WordPress: https://developer.wordpress.org/reference/functions/add_term_meta/

    In the example above, you will find two entries within the add_term_meta key. The first one shows the default behavior using only the meta key and the value. This causes the meta key to be created without checking upfront if it exists - that allows you to create the meta value multiple times.
    As seen in the second entry, you will find a third key called unique that allows you to check upfront if the meta key exists already. If it does, the meta entry is neither created, nor updated. Set the value to true to check against existing ones. Default: false
    If you look closely to the second entry again, the value included is not a string, but a JSON construct, which is considered as an array and will therefore be serialized. The given value will be saved to the database in the following format: a:1:{s:14:"some_array_key";s:16:"Some array Value";}
  2. update_term_meta

    This key refers to the update_term_meta() function of WordPress: https://developer.wordpress.org/reference/functions/update_term_meta/

    The example above shows you two entries for this function. The first one is the default set up thats used in most cases. Simply define the meta key and the meta value and the key will be updated if it does exist and if it does not exist, it will be created.
    The third argument, as seen in the second entry, allows you to check against a previous value before updating. That causes that the meta value will only be updated if the previous key fits to whats currently saved within the database. Default: ''
  3. delete_term_meta

    This key refers to the delete_term_meta() function of WordPress: https://developer.wordpress.org/reference/functions/delete_term_meta/

    Within the example above, you will see that only the meta key is required for deleting an entry. This will cause all meta keys on this term, with the same key, to be deleted.
    The second argument allows you to target only a specific meta key/value combination. This gets important if you want to target a specific meta key/value combination and not delete all available entries for the given term. Default: ''

Some tipps:

  1. You can include the value for this argument as a simple string to your webhook payload or you integrate it directly as JSON into your JSON payload (if you send a raw JSON response).
  2. Changing the order of the functions within the JSON causes the term meta to behave differently. If you, for example, add the delete_term_meta key before the update_term_meta key, the meta values will first be deleted and then added/updated.
  3. The webhook response contains a validted array that shows each initialized meta entry, as well as the response from its original WordPress function. This way you can see if the meta value was adjusted accordingly.
do_action

The do_action argument is an advanced webhook for developers. It allows you to fire a custom WordPress hook after the manage_term_meta action was fired.
You can use it to trigger further logic after the webhook action. Here's an example:

Let's assume you set for the do_action parameter fire_this_function. In this case, we will trigger an action with the hook name fire_this_function. Here's how the code would look in this case:

add_action( 'fire_this_function', 'my_custom_callback_function', 20, 2 );
function my_custom_callback_function( $term_id, $return_args ){
    //run your custom logic in here
}

Here's an explanation to each of the variables that are sent over within the custom function.

  1. $term_id (integer)

    Contains the taxonomy term id of the taxonomy term you assigned the taxonomies meta to.
  2. $return_args (array)

    Contains all the data we send back to the webhook action caller. The data includes the following key: msg, success, data

This area allows you to test your webhook endpoint directly within your browser tab. Once you have instaled the plugin, you will see a dropdown that offers the currently available webhook urls you can use for testing. Within this web view, the functionality is deactivated.