Skip to main content
Postbacks let your server report sales and sign-ups directly, without code in the browser. Use them when the purchase happens in your backend, in an app, or on a platform where you can’t run tapfiliate.js. Each postback is a single GET or POST request. Authenticate it with your API key in the X-Api-Key header, as described in Authentication.

Who referred the visitor

To attribute a conversion or customer, send one of these. If you send several, the first one in this list wins:
  1. coupon — the affiliate’s coupon code.
  2. click_id — the click ID, if you stored it when the visitor arrived.
  3. referral_code — the affiliate’s referral code, the value of ref= in their link.
  4. asset_id and source_id — from the affiliate’s link.

Create a conversion

A successful request returns 200 with the created conversion:

Update a conversion

Approve or disapprove a conversion by its external_id, and correct its amount if you need to. Commission amounts are recalculated. Every update can change the approval of the conversion’s commissions, so the key’s user needs the Approve commissions permission as well as access to commissions. Without it the request returns 403.
An update replaces the conversion’s meta data with the meta_data you send. If you leave meta_data out, the stored meta data is deleted. To keep it, send it again with every update.An update accepts up to 40 keys. A key has up to 64 characters and only letters, digits, spaces, _ and -. A value has up to 255 characters. If meta_data breaks one of these rules, the request returns 400 and changes nothing.A conversion can be created with a key that an update rejects, for example order.id. An update can’t keep such meta data: with it the request returns 400, and without meta_data it is deleted. If you plan to update conversions, follow these rules when you create them.
If amount is 0, commission amounts are not recalculated. The conversion amount becomes 0, and the commissions keep the amounts they had, also when you send status: approved. For a full refund, send status: disapproved. If Tapfiliate Pay is active on your account, an update doesn’t change a commission that is already approved: its amount and its approval stay as they are. The conversion still gets the new amount, and the request returns 200, not the 409 commission_approved error. If the conversion’s first commission is final ("final": true), the request returns 200, but the conversion’s amount and meta data stay as they are. A final commission keeps its amount and approval.

Create a customer

Track a sign-up before the first payment. Later conversions with the same customer_id are attributed to the same affiliate.

Update a customer

An update replaces the customer’s meta data with the meta_data you send, and deletes it if you leave meta_data out. The rules for keys and values are the same as for a conversion, but a customer has up to 20 keys.

Passing affiliate data through

Affiliates can add tm_ parameters to their links, for example ?tm_foo=bar&tm_baz=qux. To keep this data, read the parameters from the landing URL and send them as meta_data, here { "foo": "bar", "baz": "qux" }.
Track a test conversion before you launch your program to check the whole flow.