Skip to main content

Referrals API

Referral programs that Orbit customers run for their end-users — not Orbit’s own referral program. Define a program, issue per-user referral codes, track conversions, run a leaderboard, and approve payouts. Base path: /api/v1/referrals Authentication: API key (X-API-Key) or session JWT. Program create, update, delete, code issuance, and payout approval require the owner, admin, or developer role; reads only need authentication.

Using the SDKs

Python (same call via the SDK’s escape hatch):
The Python SDK is core-scope — it wraps the 8 core resources (messaging, voice, contacts, campaigns, verify, numbers) and reaches everything else through the generic client.request() escape hatch above. See the Python SDK. Returns the typed ApiResponse envelope. See the SDK index at SDK quickstart.

Programs

Create a program

POST /api/v1/referrals/programs Creates the program enabled unless you pass enabled: false. reward_type is:
  • credit — paid into your wallet balance when you mark a conversion paid.
  • discount_code — a redeemable code minted and returned on payout.
  • custom — a payout record you fulfill yourself.
The referrer_reward and referee_reward blocks carry amount (minor units for credit, percentage for discount_code), an optional 3-letter currency, an optional providerId to pin a fulfillment provider, and freeform metadata. Omit referee_reward for a single-sided program.
Update any field with PUT /api/v1/referrals/programs/{id} using a partial body — send only what changes. Deleting a program cascade-removes its codes and conversions; prefer enabled: false when the program might come back.

Codes & conversions

Issue a per-referrer code

POST /api/v1/referrals/programs/{id}/codes The endpoint is mint-or-get: calling it again for the same contact and program returns the existing code instead of a duplicate.
Build the share link from the returned code: https://api.orbit.devotel.io/r/AbCdEf23.

Read the leaderboard

GET /api/v1/referrals/programs/{id}/leaderboard?limit=25
Each row is a referrer code with its counters and the referrer label. limit defaults to 25 and maxes at 100 — for program-wide aggregates use the totals endpoint (documented in the Referral programs guide), not a sum over the leaderboard page.

Pay a conversion

POST /api/v1/referrals/programs/{id}/conversions/{conversionId}/pay Approve a pending conversion and fulfill the reward. The endpoint is scoped by program id: a conversion that belongs to another program returns 404.
The response carries the conversion with reward_status: "paid" plus a fulfillments array — one entry per rewarded side with its provider and delivery status. For discount_code programs the fulfillment includes the minted redeemable code the referrer receives.
The customer-facing redirect at /r/:code is mounted at the API root (no /api prefix) so referral links can be branded short URLs. It’s not authenticated — on each click it records the visit, sets an attribution cookie, and redirects to the program’s target_url with ?ref_code=<code> appended.

See also

  • Referral programs guide — end-to-end walkthrough: funnel mechanics, fraud guards, dashboard surface, and a worked example
  • Incentives — the reward engine referral payouts route through