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. For the read side of the loop with full response bodies (the redirect’s 302, a pending conversion, a leaderboard row, and a paid payout), follow the referral conversion loop walkthrough. 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
Node uses the typedorbit.referrals.* helpers; Python reaches the same endpoints through the generic client.request() escape hatch; Go, Ruby, and PHP use plain HTTP clients (no SDK dependency) against the same endpoints:
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.
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.
List programs
GET /api/v1/referrals/programs
Returns every program in your workspace, including disabled ones.
Get a program
GET /api/v1/referrals/programs/{id}
Fetches one program by id. Returns 404 when no program with that id exists in your workspace.
Update a program
PUT /api/v1/referrals/programs/{id}
Update any field with 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.
Delete a program
DELETE /api/v1/referrals/programs/{id}
Cascade-removes the program’s codes and conversions. Responds 204 No Content; 404 when no program with that id exists.
204 No Content operation says so inline — the response body is empty.
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.
code: https://api.orbit.devotel.io/r/AbCdEf23.
Read the leaderboard
GET /api/v1/referrals/programs/{id}/leaderboard?limit=25
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.
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.
/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