GET /v1/referrals/me — Referral overview
https://api.triport.io/v1/referrals/meReturns the authenticated user's referral overview: their primary code, tier, commission rate, paid-invitee count, and earnings balance.
GET /v1/referrals/me is the snapshot endpoint for the referral console. It
returns everything needed to render a user's referral dashboard in a single
call: their shareable primary code, an optional custom slug, the tier they have
reached and its human-readable label, the commission rate in basis points, how
many of their invitees have become paying customers, and their current earnings
balance broken into pending / available / lifetime buckets. If the user was
themselves referred by someone, the referrer's display name is included.
Call it once on page load. The endpoint requires a valid session cookie — it is
part of the console surface, not the public RPC surface — and takes no query
parameters. For the detailed reward, invitee, and payout lists, use the
read-side endpoints (/v1/referrals/rewards, /v1/referrals/invitees,
/v1/referrals/payouts).
All monetary fields are integers in micro-units (millionths of the account currency). Divide by 1,000,000 to get the display value.
Parameters
This endpoint takes no path, query, or body parameters. Authentication is carried entirely by the session cookie.
_(none)_—optionalnl_session cookie.Response
When the user has no custom slug, custom_slug is null. When the user was not
referred by anyone, inviter_display is null.
primary_codestringcustom_slugstring | nullnull if none is set.tierintegertier_labelstringtier (e.g. "Silver").rate_bpsintegerpaid_inviteesintegerbalanceobjectbalance.pending_microintegerbalance.available_microintegerbalance.lifetime_microintegerinviter_displaystring | nullnull.Errors
All errors share the standard envelope: { "error": "<tag>" }.
| Code | Meaning | When it happens |
|---|---|---|
401 | unauthenticated | No valid session cookie was presented (missing, expired, or invalid). |
405 | method_not_allowed | A non-GET method was used on this path. |
500 | internal | An unexpected server-side error occurred while building the overview. |
See errors.md for the full error envelope and shared conventions.
Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io/v1/referrals/me", {
credentials: "include", // sends the nl_session cookie
headers: { "Content-Type": "application/json" },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const overview = await res.json();
console.log(overview.primary_code, overview.balance.available_micro);TypeScript SDK (@triport/sdk)
import { TriportClient } from "@triport/sdk";
const client = new TriportClient({ baseUrl: "https://api.triport.io" });
// Console SDK uses the browser session cookie automatically.
const overview = await client.referrals.getOverview();
console.log(overview.tier_label, overview.paidInvitees);Python (triport-sdk)
from triport import TriportClient
client = TriportClient(
base_url="https://api.triport.io",
session_cookie=TRIPORT_SESSION, # nl_session value
)
overview = client.referrals.get_overview()
print(overview["primary_code"], overview["balance"]["available_micro"])Notes
- Micro-units: every
*_microfield is an integer in millionths. Format for display asvalue / 1_000_000. - Read-only snapshot: this endpoint never mutates state. To set or remove a
custom slug use
POST/DELETE/v1/referrals/code. - Related endpoints: detailed lists live at
/v1/referrals/rewards,/v1/referrals/invitees, and/v1/referrals/payouts. - Auth scope: this is a console (session-cookie) endpoint, not an API-key
RPC endpoint. It cannot be called with a
BearerAPI key.