affiliate
Commissions in, earnings out
Push conversions from any network, and read what each page, product or placement actually earns. Built for publishers who live on affiliate revenue.
/api/v1/sites/{id}/affiliate/conversionsimport scope.| Param | Type | Description |
|---|---|---|
| externalIdreq | string | Your own id for this conversion. It is the idempotency key: replaying a batch updates instead of adding. |
| networkreq | string | amazon, rakuten, awin… free text, used to group. |
| datereq | string | ISO timestamp or YYYY-MM-DD. |
| commissionreq | number | Your earnings. Negative for a return or a clawback. |
| ref | string | The click reference from your SubID. This is what ties the commission to a visit and a channel. |
| status | string | pending, approved or declined. Default: pending. |
| currency | string | Three letters. Default: EUR. |
| merchant / productId / orderId | string | Kept for context, never used for matching. |
curl -X POST "https://datalenk.com/api/v1/sites/3/affiliate/conversions" \
-H "Authorization: Bearer dlk_live_…" -H "Content-Type: application/json" \
-d '{ "conversions": [
{ "externalId": "amz-2026-08-25-001", "network": "amazon",
"date": "2026-08-25", "commission": 0.21, "currency": "EUR",
"ref": "v8f2a1c9", "productId": "B01ABCDEF" } ] }'Why ref changes everything
With a click reference, a commission is tied to the visit that produced it: you learn which channel, which page and which search query earned the money. Without it, the commission is still recorded and still counted in your totals, but it belongs to no channel. The response tells you how many of your conversions carry one, so a silent drop in attribution does not go unnoticed.
The reference is the value our tracker puts in your affiliate links, minus the dl_ prefix. Amazon reports do not carry it at all, which is why Amazon earnings show up per product rather than per channel.
/api/v1/sites/{id}/affiliate/revenue| Param | Type | Description |
|---|---|---|
| dimension | string | page (default), product, placement or merchant. |
| from / to | date | Absolute window. Or use range. |
| range | string | 7d, 30d, 90d… |
{
"range": "last 30 days",
"dimension": "page",
"data": [
{ "key": "/best-road-bikes", "label": "/best-road-bikes",
"pageviews": 4120, "visitors": 3180, "impressions": 2890, "clicks": 214,
"ctr": 7.4, "earnings": 38.10, "revenuePerClick": 0.18, "rpm": 9.25,
"attributable": true }
]
}The attributable flag
false means the earnings on that row come from a source that reports by product rather than by click — Amazon today. The amount is real, the channel behind it is not knowable. We surface the distinction rather than blending the two, because a number whose origin you cannot tell is worth less than an annotated one.
/api/v1/sites/{id}/affiliate/conversionsReturns commissions, statuses and dates, plus whether each one is attributable. Click references are never returned: they identify a visitor.