ClickCaravan

Developers

Server-to-server first

Send conversions from your backend with a signed request. Click ids arrive on your landing page as cc_click_id; store it with the order.

  • HMAC-SHA256 signed
  • Idempotent on order id
  • Postbacks and webhooks
Hands holding a phone above a laptop keyboard

Conversion API

POST https://clickcaravan.com/v1/conversions
X-CC-Key: <key prefix>
X-CC-Timestamp: <unix seconds>
X-CC-Signature: hex(HMAC-SHA256(secret, timestamp + "." + body))
Content-Type: application/json

{ "click_id": "0193…", "goal": "sale", "order_id": "A-1001",
  "amount": "125.00", "currency": "USD", "customer_ref": "cus_123" }

Idempotent on goal + order_id: retry as often as you like, it pays once. Refunds: POST /v1/refunds with { "order_id": "A-1001" }.

Postback (S2S)

GET https://clickcaravan.com/postback?key=<full key>&click_id={click_id}&goal=sale&order_id={order}&amount={amount}

First-party tag

<script src="https://clickcaravan.com/t.js" defer></script>
<!-- stores cc_click_id in a first-party cookie; read it at checkout: -->
ClickCaravan.clickId()

Thank-you page (no server changes)

Where it is switched on for your network, the same tag can report the sale from your order confirmation page with a publishable key. It reports only visitors who came through a partner link, only from your own website, once per order id and at most once per partner click, and each one waits for you to approve it because the amount comes from the browser.

<script src="https://clickcaravan.com/t.js" data-key="ccpk_…" data-goal="sale" data-order-id="A-1001" data-amount="125.00"></script>

Webhooks

Where outbound webhooks are switched on, add an HTTPS URL in the back office and we POST JSON when a conversion is created, approved, rejected or reversed and when a payout is marked paid. Each request is signed like the Conversion API (X-CC-Signature, X-CC-Timestamp) and retried with backoff for up to 72 hours; X-CC-Delivery stays the same on every retry.

Embeddable partner widgets

Where widgets are switched on for your network, put a Join our partner program form, a partner dashboard (balances, link, recent conversions) or a referral-link box inside your own app with one tag. Each opens in a frame served by ClickCaravan in your brand, and only the websites you list in API & tracking may show it.

<div id="cc-dashboard"></div>
<script src="https://clickcaravan.com/embed.js" data-network="your-network" data-widget="dashboard"
        data-token="TOKEN-FROM-YOUR-SERVER" data-target="#cc-dashboard" async></script>

data-widget is signup (add data-program="program-slug"), dashboard or referral. The dashboard and referral widgets show one partner’s own numbers, so your server signs a widget token for the partner signed in to your app, with a key that has the widgets permission. No cookies are involved:

payload = base64url(JSON {"sub": "<partner email, id, coupon or link code>", "iat": <unix s>, "exp": <unix s>, "jti": "<16-64 random chars>", "widget": "dashboard"})
token   = "ccw1." + key_prefix + "." + payload + "." + hex(HMAC-SHA256(secret, "ccw1." + key_prefix + "." + payload))

A token lives at most 10 minutes (exp − iat ≤ 600) and opens one page load: make a new one for each page view. With widget set it works for that widget only. The Node SDK does it for you: widgetToken({ key, partner: user.email, widget: 'dashboard' }). Optional: data-theme="dark" or "system".

OpenAPI and the Node SDK

The API is described in /v1/openapi.json (OpenAPI 3.1). A small Node SDK (trackConversion, refund, webhook signature check, widgetToken) is available on request.

Mobile apps

Pass the click id into your app through your own deep link (the {click_id} macro), send it to your backend with the signup or purchase, and call the Conversion API from there. Never put a secret key in an app. We don’t integrate with mobile measurement partners (AppsFlyer, Adjust, Branch) yet.

Keys are created in the back office under API & tracking and shown once.