jan.kowalski@demo-saas.example Log out
JA
AffiWave/API & webhooks

API & webhooks

Integrate tracking and conversions via API and server-side events

API keys

New API key
NamePrefixStatusLast used
Production backend ak_1cb0b48b Active 2026-10-02 15:07
Edit

Webhook endpoints

New webhook
EndpointEventsStatus
https://demo-saas.example/webhooks/affiwave conversion.created conversion.approved payout.paid Active
Edit

Each delivery is a POST with a JSON body. When a secret is set, header carries an HMAC-SHA256. Failing endpoints are retried; after repeated failures a webhook is auto-disabled. X-AffiWave-Signature: t=<ts>,v1=<hmac>

Webhook logs

TimeEndpointEventCode
Oct 2, 17:07:56 https://demo-saas.example/webhooks/affiwave payout.paid failed
Oct 2, 17:07:56 https://demo-saas.example/webhooks/affiwave payout.paid failed
Oct 2, 17:07:54 https://demo-saas.example/webhooks/affiwave payout.paid failed
Oct 2, 17:07:54 https://demo-saas.example/webhooks/affiwave payout.paid failed
Oct 2, 17:07:52 https://demo-saas.example/webhooks/affiwave payout.paid failed
Oct 2, 17:07:52 https://demo-saas.example/webhooks/affiwave payout.paid failed

Tracking script

This pixel reports a completed order to AffiWave - place it on your order confirmation page. Unlike the server-side API request (section next to it), no token needs to be passed here: the "token" (an affiliate's tracking-link identifier - the same one that appears in the /r/{token} URL you send them) is picked up automatically from the cookie the browser received when the visitor clicked that link.

<!-- Paste on your order confirmation page -->
<img src="https://affiwave.com/px/c.gif?order_id=ORD-1042&amount=49.99&currency=USD"
     width="1" height="1" style="display:none" alt="">

Alternative: attribution via coupon

A coupon code used on an order identifies the affiliate - add it to the pixel as a coupon parameter and the conversion is attributed to that affiliate, even without a prior click on their link.

<!-- Attribution via coupon instead of the cookie token -->
<img src="https://affiwave.com/px/c.gif?coupon=SUMMER10&order_id=ORD-1042&amount=49.99&currency=USD"
     width="1" height="1" style="display:none" alt="">

Server-side conversion

Record a conversion from your backend once an order is confirmed, using your API key (scope conversions:write). This call is server-to-server, with no customer browser involved - so the pixel's attribution cookie is NOT available here. You have to pass the token yourself in the request body, and your app must have stored it somewhere earlier (e.g. read it when the customer arrived via the affiliate link and attach it to the order). If you are not doing that, it is simpler to use the coupon field instead (see example below) - that is your own order data, with no tracking to set up beforehand.

// POST https://affiwave.com/api/conversion
curl -X POST https://affiwave.com/api/conversion \
  -H "Authorization: Bearer ak_ab12cd34.<secret>" \
  -H "Content-Type: application/json" \
  -d '{
    "token": "AFF-9X2K-7QPL",
    "external_order_id": "ORD-1042",
    "amount": "49.99",
    "currency": "USD"
  }'

Simpler: attribution via coupon (no tracking needed)

A coupon code used on an order identifies the affiliate - pass it in the coupon field instead of a token; it is data you already have on the order, so there is nothing to track beforehand.

// POST https://affiwave.com/api/conversion
curl -X POST https://affiwave.com/api/conversion \
  -H "Authorization: Bearer ak_ab12cd34.<secret>" \
  -H "Content-Type: application/json" \
  -d '{
    "coupon": "SUMMER10",
    "external_order_id": "ORD-1042",
    "amount": "49.99",
    "currency": "USD"
  }'