Segment

Send Referalli's referral, commission and payout events to a Segment source as identify and track calls, with your own write key.

Embed
Preview of the card
<a href="https://referalli.com/docs/segment"><img src="https://referalli.com/docs/_api/public/orgs/07f432f4-34b9-46a7-aaad-c0e395d2e4f9/spaces/2bf4f614-3630-4fbf-85f9-5ecafa6b7d97/pages/c92de480-555b-4a6f-9ead-3f3c3077fe05/social-card.svg?v=3e7ae33eec8b" alt="Segment" width="600" height="315"></a>

Connect a Segment source with its write key, and Referalli sends identify and track calls through Segment's HTTP Tracking API. From there they reach every destination you've connected in Segment.

Events

Referalli event

Segment track event

userId

referral.created

Referral Created

The customer (customerRef)

commission.earned

Commission Earned

The partner

commission.reversed

Commission Reversed

The partner

commission.settled

Commission Settled

The partner

payout.sent / payout.failed

Payout Sent / Payout Failed

The partner

partner.applied / enrolled / approved

Partner Applied / Enrolled / Approved

The partner

  • Track properties: the event's fields (as in webhooks) plus eventId. Amounts stay in integer minor units (amountMinor) with their currency.

  • Customers: a customer is identified under the id you attributed them with, usually your own user id, with the traits referredByPartnerId and referallyReferralId.

  • Partners: a partner is identified under their externalRef when they have one (your own user id for them), otherwise as referally_partner_<id>. Their traits are email, name, referallyPartnerId and referallyPartnerStatus.

Every message has a unique messageId, so Segment deduplicates retries.

Connect

  1. In Segment, add an HTTP API source (or use an existing server source) and copy its write key.

  2. In Referalli, open Settings → Integrations → Segment, paste the key, and pick the events to send (all by default).

  3. Click Test connection. It sends a Referalli Connection Test track event; check the source's debugger in Segment. Segment accepts any key at the API, so the debugger is the real check.

API

Call

Body

Notes

PUT /v1/integrations/segment

{ "writeKey"?: "…", "events"?: ["referral.created", …] | null, "status"?: "active" | "paused" }

writeKey is required the first time; events: null sends all of them. Owner or admin.

POST /v1/integrations/segment/test

none

{ ok, error }

DELETE /v1/integrations/segment

none

Disconnects; queued messages are dropped.

GET /v1/integrations/deliveries?kind=segment

none

Recent batches and their status, with retry.

Messages are sent in batches of up to 100 per connection. A failed batch is retried with exponential backoff for 3 days, and a 429 waits as long as Retry-After asks.

Updated