Action: Add referral

Create a referral within AffiliateWP via a webhook call.
On this page you will find further information about the Add referral action and how to use it via WP Webhooks, as well as via other external services such as Integromat, Pabbly, Integrately, or Zapier.
The Add referral action is part of our AffiliateWP integration.

Webhook setup guide

This section aims to help you getting started with the Add referral action.
Simply select one of your prefered automation manuals down below and start automating your WordPress website in no time.

Arguments

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

The id or email of the related user. (Optional in case affiliate_id is set).

affiliate_id *

The id of the related affiliate. (Optional in case user_id is set).

amount

The amount that is paid to the affiliate.

description

A description for this referral.

reference

A reference for this referral. Usually this would be the transaction ID of the associated purchase.

parent_id

An id of a different referral you want to associate as a parent.

currency

An custom currency code such as EUR. Please note that the currency will only have effect it is is selected within the settings of AffiliateWP.

campaign

Set a referral campaign. This can be a referral you created for a specific project. E.g. Summer Promotion

context

The context usually is the slug of the payment provider. E.g. fastspring or paypal. You can also use the third-party integration.

custom

Add any kind of data to your referral.

date

The date and time of creation of the referral. In case nothing is set, the current time is used.

type

The referral type. E.g.: sale

products

In case you use a third-party integration, you can also relate specific products to your referral.

status

The status of your current referral. E.g.: unpaid

do_action

Advanced: Register a custom action after this webhook was fired.

Connection examples

Get inspired on how to use the AffiliateWP action. Down below you will find various examples with our other integrations.
When a post was trashed via The WordPress Logo for our integration WordPress, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When a product was created via The Woocommerce Logo for our integration Woocommerce, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When a product was updated via The Woocommerce Logo for our integration Woocommerce, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When broken links have been detected via The Broken Link Checker Logo for our WP Webhooks integration Broken Link Checker, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When a group access was removed via The LearnDash Logo for our WP Webhooks integration LearnDash, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When a form was submitted via The Elementor Logo for our WP Webhooks integration Elementor, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When an affiliate status was changed via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When a custom link was clicked via The WP Webhooks Logo for our WP Webhooks integration WP Webhooks, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When a payments status was changed via The Easy Digital Downloads Logo for our integration Easy Digital Downloads, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When a license was activated via The Easy Digital Downloads Logo for our integration Easy Digital Downloads, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When a user has logged in via The WordPress Logo for our integration WordPress, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When an order was created via The Paid Membership Pro Logo for our WP Webhooks integration Paid Memberships Pro, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When a customer was created via The Woocommerce Logo for our integration Woocommerce, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When a membership has expired via The Paid Membership Pro Logo for our WP Webhooks integration Paid Memberships Pro, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When a form was submitted via The HappyForms Logo for our WP Webhooks integration HappyForms, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When a plugin was deactivated via The WordPress Logo for our integration WordPress, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When a post was deleted via The WordPress Logo for our integration WordPress, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When a referral status changed via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When a comment was created via The WordPress Logo for our integration WordPress, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When a booking status was updated via The Amelia Logo for our WP Webhooks integration Amelia, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.
When a topic was completed via The LearnDash Logo for our WP Webhooks integration LearnDash, add a referral via The AffiliateWP Logo for our WP Webhooks integration AffiliateWP.

More available endpoints

Down below you will find a list of all available triggers and actions for the AffiliateWP integration.
If you want to learn more about a specific endpoint, simply click on it.
Full disclosure: When clicking on some of the links on our website and purchasing the related product and/or service, we may earn a commission free of any additional cost for you.