Tapfiliate works with n8n through n8n's standard HTTP Request and Webhook nodes. You use the Tapfiliate REST API to send data into Tapfiliate, and Tapfiliate Triggers to send events out to n8n. This guide covers both directions, with HubSpot as the example.
In This Article
We will cover:
How the n8n Integration Works
n8n connects to Tapfiliate in two directions. You can use either one or both in the same workflow.
n8n → Tapfiliate (REST API). An event in another tool, such as a new HubSpot contact or a deal moved to Closed Won, makes n8n create a conversion or a customer in Tapfiliate. This is how you reward affiliates for CRM events.
Tapfiliate → n8n (Triggers and webhooks). An event in Tapfiliate, such as a new affiliate or a new conversion, makes Tapfiliate send a request to an n8n Webhook node. n8n then passes the data on, for example to create a contact in HubSpot.
What You Need Before Starting
An active Tapfiliate account.
Your Tapfiliate API key (Profile → API key).
Access to Triggers in your Tapfiliate dashboard, if you want to send Tapfiliate events to n8n. If you don't see Triggers, contact us at support@tapfiliate.com.
An n8n account or instance.
For CRM setups: a way to store the Tapfiliate referral identifier in your CRM, for example a custom field for the referral code, a coupon code or the click ID.
Send Conversions and Customers from n8n to Tapfiliate
Use the n8n HTTP Request node to call the Tapfiliate REST API. The general flow looks like this:
Trigger node (for example HubSpot) → IF node (optional filter) → HTTP Request node (Tapfiliate)
Step 1: Add the trigger for your CRM event
Start the workflow with the n8n trigger for the event you want to reward, for example a new contact or a deal moving to a certain stage. Make sure the data coming out of this step includes the affiliate identifier you stored in your CRM (referral code, coupon code or click ID).
Step 2: Filter out non-affiliate events (optional)
Add an IF node that continues only when the referral identifier is not empty. This stops visitors who did not come through an affiliate from generating conversions.
Step 3: Configure the HTTP Request node
Add an HTTP Request node and set it up like this:
Method: POST
URL (create a conversion):
https://api.tapfiliate.com/1.6/conversions/URL (create a customer):
https://api.tapfiliate.com/1.6/customers/Headers:
X-Api-Keywith your API key,Content-Type: application/jsonandAccept: application/jsonBody: JSON, as in the examples below
Example: create a conversion
{
"referral_code": "janejameson",
"external_id": "DEAL-1042",
"amount": 250.00,
"currency": "USD",
"customer_id": "contact-8841",
"meta_data": { "source": "hubspot" }
}Instead of hard-coded values, use n8n expressions to map the fields from the previous node. The field names in your expressions depend on the data your CRM node returns.
Example: create a customer
{
"referral_code": "janejameson",
"customer_id": "contact-8841",
"status": "lead"
}Fields to know
Affiliate identifier (required). A conversion needs one of: referral code, customer ID, click ID, coupon code, tracking ID, or an asset ID with a source ID. If you send more than one, Tapfiliate uses this order, from highest to lowest: customer ID, coupon, referral code, click ID, asset ID with source ID, tracking ID.
external_id. A unique ID for each conversion, such as a deal or order number. It has to be unique for every conversion, which also helps you avoid duplicates.
amount and currency. The conversion amount and the three-letter ISO currency code. If you leave out the currency, the program's default currency is used.
customer_id. The ID of the customer in your system. Depending on your program settings, it is used for recurring or lifetime commissions.
status (customers). The starting status of a customer:
trial,leadornew. If you leave it out, it isnew. For a customer,customer_idis required, plus one affiliate identifier.meta_data. Optional key-value pairs stored with the conversion or customer.
Example scenarios
Contact creation: new HubSpot contact → IF referral code exists → create a customer in Tapfiliate.
Deal-based commission: new HubSpot deal → create a conversion with the deal amount.
Closed-won payout: deal updated → IF stage is Closed Won → create a conversion with the revenue value.
Multi-stage rewards: send a separate conversion for each stage (lead, qualified, closed), each with its own unique external_id and amount.
The same logic applies to other CRMs. For more CRM examples, see How to Integrate CRMs with Tapfiliate Using Make.com. Full API details are in the API reference.
Send Tapfiliate Events to n8n
Use an n8n Webhook node to receive events from Tapfiliate Triggers.
Step 1: Create the Webhook node in n8n
Add a Webhook node as the first node of a new workflow.
Set the HTTP method to POST.
Copy the production URL of the node and activate the workflow. The test URL only works while n8n is waiting for a test event.
Step 2: Create the trigger in Tapfiliate
1. Go to Triggers in your Tapfiliate dashboard and click New trigger.
2. Choose the event. Available events include Affiliate created, Affiliate approved for program, Conversion created, Commission created, Commission updated, Customer created and Payment created.
3. Optionally add filters, for example to fire only for one program.
4. Under the action, choose Webhook or Webhook (custom):
Webhook sends the object in the same format as the API reference. For Conversion created, you receive a conversion.
Webhook (custom) lets you set your own headers and payload. Use the merge tags from the
{…}menu to insert event data. Choose this option when you need an authentication header.
5. Paste the n8n production URL. It has to be a public http:// or https:// address. Requests to private or internal network addresses are blocked.
6. Save the trigger.
Step 3: Pass the data on in n8n
After the Webhook node, add the node for the system you want to update. For example, add a HubSpot node that creates or updates a contact, and map the affiliate's name and email from the Tapfiliate payload.
Securing the webhook
Tapfiliate webhooks are not signed. To check that a request really comes from Tapfiliate, use Webhook (custom), add your own secret header such as Authorization, and set the Webhook node in n8n to require the same header. Use an https URL.
More on Triggers: Webhooks and Event-Driven Workflows and the webhooks documentation.
Test and Verify Your Setup
For n8n → Tapfiliate:
Run the workflow in n8n with a test record that has a valid affiliate identifier.
Check that the HTTP Request node returns a success response.
In Tapfiliate, check Conversions or Customers for the new entry and confirm it is assigned to the right affiliate.
For Tapfiliate → n8n:
Click Test action on the trigger in Tapfiliate. The current test limit is 20 requests per day.
Check that n8n receives the request and the workflow runs.
Confirm the final action happened, for example the HubSpot contact was created.
Key Notes and Best Practices
Always store the Tapfiliate referral identifier in your CRM, so n8n can send it with each conversion.
Use a unique external_id for every conversion to avoid duplicates.
Make your n8n workflow answer webhooks with a 2xx status quickly and do the slower work afterwards.
Make the workflow safe to run twice: use the object's ID from the payload to skip events you have already processed.
If the API answers 429 Too Many Requests, wait and retry. The limits are described in the API reference.
Test every workflow with real test data before you switch it on for your program.
Need More Help?
If you have questions or something in this guide is unclear, contact us at support@tapfiliate.com.