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:coupon— the affiliate’s coupon code.click_id— the click ID, if you stored it when the visitor arrived.referral_code— the affiliate’s referral code, the value ofref=in their link.asset_idandsource_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 itsexternal_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.
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 samecustomer_id are attributed to the same affiliate.
Update a customer
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 addtm_ 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.