Pay per call
Pay partners for qualified phone calls with your own Twilio account, or any call tracker that can send a signed webhook.
Give each partner a tracking phone number. When a caller dials it and the call qualifies, the partner earns a flat amount, once. Referalli holds no telephony key: you connect your own Twilio account, or point CallRail, Ringba, Invoca, Retreaver or any tool that can POST JSON at a signed webhook.
Turn it on
curl -X PATCH https://referalli.com/v1/programs/$PROGRAM \
-H "Authorization: Bearer $KEY" -H "content-type: application/json" \
-d '{"payPerCall": {"enabled": true, "amountMinor": 2500, "currency": "usd",
"minDurationSec": 60, "dedupeHours": 24, "forwardTo": "+14155550100"}}'A call pays the partner amountMinor when it was answered, lasted at least minDurationSec (default 60), and the same caller has not already had a paid call in this program within dedupeHours (default 24). The caller's number is never stored, only a hash. The earning goes through the normal ledger: the rule's hold, group hold, caps and a blocked partner apply, and a program whose latest commission rule is a draft earns nothing. Each call pays once, however often the provider redelivers it. forwardTo (E.164) is your real line, which Twilio numbers ring.
Twilio
Connect your account. The auth token is sealed and never returned.
curl -X PUT https://referalli.com/v1/call-connections/twilio \ -H "Authorization: Bearer $KEY" -H "content-type: application/json" \ -d '{"accountSid": "AC...", "authToken": "..."}'Assign a partner a number. Referalli buys a US local number in your Twilio account (in
areaCodeif you send one) and points its voice URL athttps://referalli.com/webhooks/calls/twilio/<token>:curl -X POST https://referalli.com/v1/programs/$PROGRAM/call-numbers \ -H "Authorization: Bearer $KEY" -H "content-type: application/json" \ -d '{"partnerId": "ptr_...", "areaCode": "415"}'
Calls to the number are checked against X-Twilio-Signature with your auth token, rung through to forwardTo, and recorded when the forwarded leg ends. DELETE /v1/programs/{id}/call-numbers/{numberId} releases the number in Twilio and stops tracking it.
Any other call tracker (webhook)
PUT /v1/call-connections/webhookwith{}. The response carrieswebhookUrland a signingsecret, shown once (PUT again to rotate).Register a number you bought in your own provider:
POST /v1/programs/{id}/call-numberswith{"partnerId": "ptr_...", "number": "+14155550100"}.Have the tracker POST each finished call to
webhookUrl:{ "callId": "rg_8a1f3c", "to": "+14155550100", "from": "+16505550123", "durationSec": 184, "status": "completed", "startedAt": "2026-11-18T10:12:00Z" }Sign the raw body:
X-Referalli-Signature: sha256=<hex HMAC-SHA256 of the raw body keyed with the secret>.const sig = 'sha256=' + crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
to must be a number you assigned. status is completed or answered for a connected call; anything else is recorded as an unpaid call. The answer says whether it paid: { "qualified": true, "reason": null, "commissionId": "cme_..." }, or why not (too_short, repeat_caller, status, unknown_number, program_disabled, cap_reached).
CallRail, Ringba, Invoca, Retreaver
Each of these can send a webhook when a call ends. Create a webhook (CallRail "post-call webhook", Ringba "pixel", Invoca "signal", Retreaver "webhook") that POSTs the JSON above to your webhookUrl. If the tool cannot compute an HMAC itself, send its call event to a small function of yours that maps the fields and signs the body.
Show the partner's number on your site
Visitors who arrive through a partner can see that partner's number instead of yours, so calls from your site count too. Add data-calls="swap" to the tracking script tag and mark each phone number with data-referalli-phone:
<script src="https://referalli.com/t/<orgToken>/aff.js" data-calls="swap" async></script>
<a href="tel:+14155550100" data-referalli-phone>(415) 555-0100</a>When the visitor has a live referral from a partner who has a number in a pay-per-call program, the script loads a small calls.js and replaces the text (and the tel: link) of the marked elements only. Everyone else sees your number. The number is cached for the browser session. Nothing loads without data-calls="swap".
See the calls
GET /v1/calls?programId=...&partnerId=... lists calls with qualified on each. Partners see their own numbers at GET /v1/partner/call-numbers.