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.

POST/api/v1/sites/{id}/affiliate/conversions
Push commissions from any source. Needs the import scope.
ParamTypeDescription
externalIdreqstringYour own id for this conversion. It is the idempotency key: replaying a batch updates instead of adding.
networkreqstringamazon, rakuten, awin… free text, used to group.
datereqstringISO timestamp or YYYY-MM-DD.
commissionreqnumberYour earnings. Negative for a return or a clawback.
refstringThe click reference from your SubID. This is what ties the commission to a visit and a channel.
statusstringpending, approved or declined. Default: pending.
currencystringThree letters. Default: EUR.
merchant / productId / orderIdstringKept 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.

GET/api/v1/sites/{id}/affiliate/revenue
Earnings by page, product, placement or merchant.
ParamTypeDescription
dimensionstringpage (default), product, placement or merchant.
from / todateAbsolute window. Or use range.
rangestring7d, 30d, 90d…
response
{
  "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.

GET/api/v1/sites/{id}/affiliate/conversions
Read back what was imported.

Returns commissions, statuses and dates, plus whether each one is attributable. Click references are never returned: they identify a visitor.