TikTok Events API for affiliates: the request, the event name and the checks
November 28, 2026 · Hoplytic team · 5 min read
Read the video transcript
TikTok's pixel can't see an affiliate sale. So how do you tell TikTok about it?
You need a pixel and an Events API access token from TikTok Events Manager. Your tracker saves the TTCLID for every TikTok click. And sales must come back with your click ID.
Each event carries your pixel ID, the event name, the sale time, the order ID, the TTCLID, and your commission with a currency.
TikTok's current list names the sale event Purchase. Older setups used Complete Payment. Send exactly the one your campaign optimizes for, and never both for the same sale.
Read the code in TikTok's answer, because a two hundred status alone doesn't mean accepted. And use the order ID as event ID so retries don't double count.
Hoplytic stores the TTCLID and user agent with each TikTok click. Add TikTok under Send back, and each sale is posted as one event within about twenty seconds. The event name defaults to Purchase.
The full guide is right below. Hoplytic: ad tracking made simple.
Key points
- TikTok's pixel can't see an affiliate sale, so the sale has to arrive as a server event carrying the ttclid from the original click.
- TikTok's current standard event list names the sale event Purchase; older setups used CompletePayment, so check which one your optimization goal uses.
- A 200 HTTP status is not proof of success: read the code field in TikTok's JSON answer, where 0 means accepted.
- Use the network's order ID as event_id so retries and status updates don't count as extra purchases.
- TikTok counts a sale for an ad only inside the ad group's attribution window, so accepted events can still show zero conversions.
TikTok's algorithm learns fast, but only from what you tell it. With affiliate offers the purchase happens on the merchant's site, so TikTok sees nothing unless your server reports each sale through the Events API with the click ID from the ad.
Short answer: store the ttclid with each TikTok click, and when the network reports the sale, POST an event to TikTok's Events API with your pixel ID as event_source_id, the event name your campaign optimizes for (Purchase in TikTok's current list), the sale time, the order ID as event_id, the ttclid under user, and your commission as the value. Then check the code in TikTok's answer.
For the macros on the ad URL and getting cost in, see TikTok Ads affiliate tracking. This guide is about the server event.
What you need
- A pixel in TikTok Events Manager. Note its ID (also called the pixel code).
- An Events API access token, generated in the pixel's settings in Events Manager.
- The ttclid, saved by your tracker for every TikTok click, plus the browser user agent if you keep it.
- Sales that come back with your click ID, by network postback, API sync or report upload.
The request
Trackers commonly send events to the v1.3 track endpoint with the token in an Access-Token header:
POST https://business-api.tiktok.com/open_api/v1.3/event/track/
Access-Token: <TOKEN>
Content-Type: application/json
{
"event_source": "web",
"event_source_id": "CQ8H2KJC77U3F1A",
"data": [{
"event": "Purchase",
"event_time": 1795867925,
"event_id": "ORD-88412",
"user": {
"ttclid": "<stored ttclid value>",
"user_agent": "Mozilla/5.0 (Linux; Android 15) ..."
},
"properties": { "value": 24.50, "currency": "USD", "content_type": "product" }
}]
}
TikTok changes its API versions and field names from time to time, so check the current Events API reference in TikTok's developer portal before you build your own sender.
| Field | What goes in it |
|---|---|
event_source | web for website events. |
event_source_id | Your pixel ID. |
event | The standard event name, for example Purchase for a sale. Lead offers use a lead event such as Submit Form or Complete Registration. Use TikTok's exact event code. |
event_time | Unix time in seconds (UTC) when the sale happened. |
event_id | The network's order or transaction ID, for deduplication. |
user.ttclid | The click ID TikTok added to the ad click. This is what ties the sale to the ad. |
properties.value, currency | Your commission or the order value, with a three-letter currency code. |
Purchase or CompletePayment?
For years the sale event was CompletePayment, and many tutorials and tools still send it. TikTok's current standard events page lists Purchase and does not list CompletePayment. Integration vendors report that TikTok still accepts CompletePayment and maps it to Purchase, but that's their report, not a promise. For a new setup:
- Use
Purchase. - Check which event your campaign's optimization goal is set to in Ads Manager, and send exactly that one.
- Don't send both for the same sale: that's two events for one purchase.
Reading TikTok's answer
TikTok answers with JSON that includes a code and a message. HTTP 200 alone doesn't mean the event was accepted: a code other than 0 is a rejection, and the message says why. Log the full answer for each sale. When you see a rejection, the usual causes are:
- Wrong or expired token, or a token generated for a different pixel.
- Wrong pixel ID in
event_source_id. - A time problem: milliseconds instead of seconds, a local time zone, or a server clock that's off.
- An unknown event name, for example a typo or a custom name where the campaign expects a standard event.
Don't retry a rejected event in a loop. Fix the cause, then resend.
Deduplication and resends
Send the network's order ID as event_id on every event. When the network first reports a sale as pending and later as approved, or your sender retries after a timeout, TikTok can recognize the repeat instead of counting a second purchase. If you also run the TikTok pixel on your own landing page with a purchase event (rare for affiliates), the pixel and server must use the same event ID for the same sale.
Testing
- In Events Manager, open the pixel's Test events tab and copy the test event code.
- Add
"test_event_code": "TEST12345"at the top level of the request, next todata. - Send one event with a real ttclid from a click on your own ad, and watch it appear in Test events.
- Remove the test code once it works. Test events don't count for optimization.
When accepted events show zero conversions
- No ttclid on the click. A link shortener, an in-app browser quirk or a redirect that dropped the query string. Count how many of your sales actually carried a ttclid.
- Outside the attribution window. TikTok credits a sale to an ad only within the ad group's click window. Long sales cycles fall outside it.
- Delayed reporting. TikTok can take some hours to show server events in Ads Manager. Wait a day before you change anything.
- Wrong event for the goal. Purchases arrive, but the campaign optimizes for a different event.
Remember that TikTok's numbers will never equal your network's. TikTok counts by its windows, the network counts what it pays. Judge profit on the network's commission; see network vs tracker discrepancies.
Pending or approved sales?
TikTok learns better from fast signals. If your network approves most sales within a few days, send them when first reported. If many are rejected later (common with some lead offers), send approved sales only, and accept that TikTok will learn more slowly. Whatever you choose, be consistent within one campaign. For leads and sales on the same offer, see tracking leads and sales separately.
Doing it in Hoplytic
Hoplytic stores the ttclid and user agent with each TikTok click. Under Send back, add TikTok with your pixel ID and access token; each sale is posted as one event with the network's transaction ID as event_id, within about 20 seconds of the network reporting it, and Hoplytic reads TikTok's code to decide whether it was accepted. The event name field defaults to Purchase; type CompletePayment there if an older campaign still optimizes for it. A test event code field is there for testing.
Questions people ask
Do I need the TikTok pixel on my site to use the Events API?
You need a pixel (event source) and its ID, because server events are sent to it, but the pixel code does not have to run on your pages. Affiliates often send server events only.
Should I use CompletePayment or Purchase?
TikTok's standard events page lists Purchase and no longer lists CompletePayment, and integration vendors report that CompletePayment is mapped to Purchase. For a new setup use Purchase, and make sure it matches the event your campaign optimizes for.
Where do I find the ttclid?
TikTok adds ttclid to the landing page URL of ad clicks by itself. Your tracker has to store it at the moment of the click, because it is not available later.
Why does TikTok show fewer conversions than my network?
TikTok only credits sales from clicks that carried a ttclid and that fall inside its attribution window. Organic visitors, clicks where a redirect dropped the ttclid, and late sales are not counted.
More in Conversion tracking
Also: tracking glossary · ad platform macros · Markdown copy