Skip to main content
November 9, 2026
Each request must have a header with the user’s authentication key. X-Api-Key: #Your key# You can find and manage X-Api-Key on your Profile page.
Your X-Api-Key - has to be saved in secure storage (e.g. database, environment variables).
Basic concepts Postback API endpoints accept both GET and POST requests.
When creating a request with the GET method, you need to pass all the necessary parameters in the request URL:
When creating a request with the POST method, you need to pass all the necessary parameters in the request body:
Required parameters:
1. external id A unique id for this conversion. It can be anything that is meaningful to you, like an order number, user id, email address etc. This id has to be unique for every conversion.
2. You have to also send one of the parameters:
• referral code An affiliate’s referral code. This corresponds to the value of ref= in their referral link
• coupon The affiliate’s coupon code.
• click id The click id. Used to add additional reporting information.
• asset id and source id Both of them together: one without the other is not enough.
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 these parameters, or the conversion is rejected.
If more than one of them is sent, then one will be used, according to priority (from highest to lowest): coupon, click_id, referral_code, asset_id and source_id. Only the first one you send 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. A customer id of a customer that already exists in Tapfiliate is checked before all of them: it can decide the affiliate or get the conversion rejected, as described in Create a conversion.
If necessary, you can add additional parameters to the request:
• amount The conversion amount (number).
• currency The three letter ISO currency code.If not passed, the default program currency will be used.
• customer id The id for this customer in your system. The customer id should be unique for each customer. Depending on your program settings, this can be used for recurring / lifetime commissions. You can read more about this here.
• meta data Additional data for the conversion (object).
• user agent The client’s user agent string. Used for statistics and fraud detection.
• ip The client’s IPv4 address. Used for fraud detection, and the conversion’s country in your reports is the location of this IP. If ip holds an IPv6 address or any other text that isn’t an IPv4 address, even a single space, the request is rejected and no conversion is created. If ip is sent empty (ip= in the URL or "ip": "" in the body), the request is accepted, but the conversion gets no IP and no country, and none of the IPs below is used instead. If you leave ip out, Tapfiliate uses the IP saved for a known customer (customer id), then the IP of the click the conversion is matched to, and otherwise the IP the request came from – that is your server, so the country would be your server’s. A customer created by a conversion is saved with the IP the request came from, not with the conversion’s ip: every later conversion of that customer sent without ip gets your server’s country too. To report your buyers’ countries, pass the buyer’s IPv4 address in every conversion, including later conversions of the same customer. If you don’t have the buyer’s IPv4 address, for example because they have only an IPv6 address, leave the ip field out of the request entirely: don’t send it empty.
Implementation for PHP Implementation for WordPress and WooCommerce: If you use WooCommerce, use the official Tapfiliate plugin: it tracks orders without custom code. Besides the order amount, it sends a customer ID, the coupon codes used in the order and the commission types set on your products or product categories. For a free first order of a subscription it records a trial customer instead of a conversion. If you track orders with your own code instead, send every field the plugin sends, in the same form. Recurring commissions with a custom checkout describes it order by order for tapfiliate.js. From your server, follow the custom checkout recipe in our developer docs and send:
  • External ID. The WooCommerce order ID as external_id, as the plugin does. If WooCommerce is also connected to Tapfiliate, the connection uses the same ID: with another ID, an order it tracks too is paid twice, and refunds and cancellations from WooCommerce don’t reach your conversion.
  • Amount. The order subtotal after discounts, without tax and shipping, not the order total.
  • Currency. The order currency as currency.
  • Free first order of a subscription. If the order contains a subscription and its amount is 0, for example a free trial or a first period paid fully with a coupon, send no conversion. Create a customer with the status trial, the customer ID and the order’s referral data, such as its click ID or coupon. Without referral data, skip it.
  • Several items. If the order has more than one item, whatever your commission types, send commissions with one entry per item: its commission_type (default if the item has none) and its sub_amount, the item subtotal minus its share of the order discount, split in proportion to the item subtotals (0 for a free item). With a fixed commission, each item earns it once. For an order with one item, send amount and the item’s commission_type, if it has one. The fields are in Create a conversion.
  • Customer ID. Send as customer_id, as a string, the ID the plugin sends: the billing email. If the plugin option “Enable Tapfiliate Lifetime and Recurring commissions for registered users only” is on, it is the customer_id from the WooCommerce table wc_customer_lookup, of the row of the logged-in user or, for a buyer who isn’t logged in, of the registered user with the billing email. It is not the WordPress user ID and not the order’s customer ID; for a buyer without an account the plugin then sends no customer ID. With another ID, customers you already track are not recognised, and a number instead of a string is rejected.
  • Coupon. If the order used an affiliate’s coupon, send its code as coupon, also when you have no click ID for the order. Send only affiliates’ codes: an unknown code can make the request fail, even with a click ID. Which identifier is used when you send several is explained in Which identifier wins.
  • Items, optionally. The plugin also sends the order items as meta_data: product1, product2 and so on, each with the item name and quantity. They don’t change commissions.
  • Lifetime or recurring commissions. Send every order with customer_id, also orders without a click ID or coupon. An order of a returning customer then goes to the affiliate who referred them, within the limits of your recurring settings. Expect these errors and don’t treat them as failures, unlike the recipe’s sample code: Missing tracking parameter value and no customer found for customer id: … for an order without referral data from a customer Tapfiliate doesn’t know under this ID (a new customer, or one tracked under another ID), and Customer is capped… or Recurring cap or recurring period exceeded… once a customer has reached your recurring limits or was canceled. Every order then carries the customer ID above, so set Recurring commissions of your commission types to Smart connected, not Time based (see Smart Connected): with Time based, Tapfiliate also creates a conversion for the customer every Recurrence interval, on top of the orders you send. See the recurring commissions recipe.
Note: S2S/Postback tracking is an advanced feature. As such, set up of this feature falls outside the scope of our support. You may need a developer to assist in setting this up.