November 4, 2026
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
- What you need before starting
- Send conversions and customers from n8n to Tapfiliate
- Send Tapfiliate events to n8n
- Test and verify your setup
- Key notes and best practices
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/json - Body: JSON, as in the examples below
Example: create a customer
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. A customer ID on its own is enough only for a customer that already exists in Tapfiliate, has an affiliate and is in a program with lifetime/recurring commissions; for a new customer, or without these commissions, also send one of the other identifiers, or the conversion is rejected. If you send more than one, Tapfiliate decides the affiliate in the order described in Create a conversion: an existing customer’s customer ID first, then coupon, click ID, referral code, asset ID with source ID, tracking ID. If that customer has no affiliate, the conversion is rejected. With lifetime/recurring commissions, the conversion goes to that customer’s affiliate, or is rejected if the customer is canceled or has reached the recurring limit; without them, the customer ID doesn’t decide the affiliate. Of the other identifiers, only the first one in this order counts: if it isn’t valid (for example, an unknown coupon or click ID), the conversion is rejected, even if a later one is valid.
- 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.
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. If you write the payload as JSON, add the headerContent-Typewith the valueapplication/json: Webhook (custom) does not send it on its own, and without it the n8n Webhook node does not read the payload as JSON.
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 asAuthorization, 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. Use a test affiliate’s identifier, not a real affiliate’s: the test conversion creates a real commission for the affiliate it is credited to. If the record has a referral code, coupon code or click ID, each of them must be that test affiliate’s: a real affiliate’s coupon code or click ID can take precedence over the test affiliate’s referral code. Use a test customer made for this test too, not a real customer: if your workflow creates the customer itself, even when it then sends a conversion with that customer’s ID, a customer ID that isn’t in Tapfiliate yet, because creating a customer that already exists fails with a duplicate error; if it only sends a conversion and the customer ID is its only affiliate identifier, a customer recorded in Tapfiliate when they signed up through the test affiliate’s link. If the conversion carries the customer ID of a real customer who is already in Tapfiliate, it can go to that customer’s affiliate instead of the test affiliate, and cancelling the test customer afterwards would cancel a real one. After the test, disapprove the test commission in the conversion, and cancel the test customer on the Customers page, so that in a program with lifetime or recurring commissions they don’t keep earning a commission every period. See How can I test if my integration is working correctly?
- 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.
- Click Test action on the trigger in Tapfiliate. The test builds the request from the most recent item of the kind the event is about that already exists in your account, whatever filters the trigger has. The event’s name doesn’t narrow it down either: for Affiliate approved for program, the test sends the affiliate who most recently joined any of your programs, whether approved, pending or disapproved; for Commission updated, it sends the most recently created commission, not the one updated last. If you have no such item yet, the test fails; test again once you have one. The request is real: it goes to your n8n URL in the same form as a live delivery, only with an empty
Tap-Trigger-Action-Id, so skipping repeated requests by that header, as described in Key Notes and Best Practices, doesn’t stop it. Tapfiliate sends it again every time you click Test action, up to the test limit of 20 test requests per 5 minutes. Before you click, check what your workflow does with such a request. - 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: skip requests whose
Tap-Trigger-Action-Idheader is not empty and has already been processed. Don’t use the object’s ID for this: an event such as Commission updated fires more than once for the same object. A test request sent with Test action has an emptyTap-Trigger-Action-Id. - 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.