Read the widget customer's referral data

Embed
Preview of the card
<a href="https://referalli.com/docs/ref-gettorgtokenwidgetme"><img src="https://referalli.com/docs/_api/public/orgs/07f432f4-34b9-46a7-aaad-c0e395d2e4f9/spaces/2bf4f614-3630-4fbf-85f9-5ecafa6b7d97/pages/3b655fa2-71e7-4c08-953e-03d5f4fe8dd9/social-card.svg?v=3e7ae33eec8b" alt="Read the widget customer's referral data" width="600" height="315"></a>
GET https://referalli.com/t/{orgToken}/widget/me

Called by the widget with Authorization: Widget <token> (a token minted by your backend). Returns the customer's link, code, share URLs, progress, balances and the friend's reward; their referrals (a masked label, never a name or email) and commissions (with releasesAt, when a pending one is approved), newest first, 20 at a time (?referralsAfter= / ?commissionsAfter= with nextCursors); payout (methodStatus none, pending or ready, nextRunDate, minThresholdMinor); terms (url, summary); program.howItWorksMd; and portalLink, to POST for a portal sign-in. code, coupon and the link path share one spelling when they are the same code (canonicalCode is it lowercased); every code lookup is case-insensitive. A token reads only its own partner. 401 when the token is missing, expired or for another merchant.

Auth: none.

Parameters

orgToken
string
path
required
referralsAfter
string
query
commissionsAfter
string
query

Code samples

cURL
curl -X GET "https://referalli.com/t/{orgToken}/widget/me"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{
  "program": {
    "id": "string",
    "name": "string",
    "howItWorksMd": "string"
  },
  "partner": {
    "displayName": "string"
  },
  "code": "string",
  "canonicalCode": "string",
  "coupon": "string",
  "link": "string",
  "share": {
    "x": "string",
    "facebook": "string",
    "linkedin": "string",
    "whatsapp": "string",
    "email": "string"
  },
  "progress": {
    "clicks": 0,
    "signups": 0,
    "payingCustomers": 0
  },
  "earnings": [
    {
      "currency": "string",
      "pending": 0,
      "approved": 0,
      "paid": 0
    }
  ],
  "refereeReward": {
    "kind": "string",
    "bps": 0,
    "amountMinor": 0,
    "capMinor": 0,
    "currency": "string",
    "on": "string"
  },
  "referrals": [
    {
      "id": "string",
      "label": "string",
      "status": "string",
      "createdAt": "2024-01-01T00:00:00Z"
    }
  ],
  "commissions": [
    {
      "id": "string",
      "amountMinor": 0,
      "currency": "string",
      "status": "pending",
      "releasesAt": "2024-01-01T00:00:00Z",
      "createdAt": "2024-01-01T00:00:00Z"
    }
  ],
  "nextCursors": {
    "referralsAfter": "string",
    "commissionsAfter": "string"
  },
  "payout": {
    "methodStatus": "none",
    "method": "string",
    "nextRunDate": "string",
    "minThresholdMinor": 0,
    "currency": "string"
  },
  "terms": {
    "url": "string",
    "summary": "string"
  },
  "portalLink": "string"
}
Schema
program
object
required
Show child parameters
id
string
required
name
string
required
howItWorksMd
string
required
The program's settings.howItWorksMd; empty when unset.
partner
object
required
Show child parameters
displayName
string
required
code
string
required
The code as issued (one spelling for code, coupon and link when they are the same code). Matching is case-insensitive everywhere.
canonicalCode
string
required
The code lowercased, for comparing or storing.
coupon
string
required
link
string
required
share
object
required
Show child parameters
x
string
required
facebook
string
required
linkedin
string
required
whatsapp
string
required
email
string
required
progress
object
required
Show child parameters
clicks
integer
required
signups
integer
required
payingCustomers
integer
required
earnings
object[]
required
Show child parameters
currency
string
required
pending
integer
required
Integer minor units (cents).
approved
integer
required
Integer minor units (cents).
paid
integer
required
Integer minor units (cents).
refereeReward
object
required
Show child parameters
kind
string
required
bps
integer
amountMinor
integer
Integer minor units (cents).
capMinor
integer
Integer minor units (cents).
currency
string
required
on
string
required
referrals
object[]
required
Newest first, 20 at a time; the next page with ?referralsAfter=nextCursors.referralsAfter.
Show child parameters
id
string
required
label
string
required
A masked label (the last characters of your customerRef); never a name or email.
status
string
required
createdAt
string
required
commissions
object[]
required
Newest first, 20 at a time; the next page with ?commissionsAfter=nextCursors.commissionsAfter.
Show child parameters
id
string
required
amountMinor
integer
required
Net of reversals and adjustments.
currency
string
required
status
string
required
pending | approved | paid | reversed
releasesAt
string
required
When a pending commission is approved (its hold ends); null otherwise.
createdAt
string
required
nextCursors
object
required
Show child parameters
referralsAfter
string
required
commissionsAfter
string
required
payout
object
required
Show child parameters
methodStatus
string
required
none: no payout method; pending: one is chosen but its details are incomplete; ready: it can be paid.
none | pending | ready
method
string
required
nextRunDate
string
required
The next scheduled payout day (YYYY-MM-DD), or null when payouts are not scheduled.
minThresholdMinor
integer
required
The balance needed before a payout, in currency.
currency
string
required
terms
object
required
Show child parameters
url
string
required
The program's termsUrl, else its public join page, else null.
summary
string
required
The commission rule in one sentence (English), else the program's termsMd.
portalLink
string
required
POST it with the same widget token for a single-use partner-portal sign-in link.
400 The request is invalid. error.code is one of:
Example
{
  "error": {
    "code": "validation_error",
    "message": "the body or query failed validation, an unknown field was sent, the body is not valid json, or a session call has no `x-org-id`",
    "details": [
      {
        "code": "invalid_format",
        "path": [
          "destinationUrl"
        ],
        "message": "Invalid URL"
      }
    ],
    "docs_url": "https://referalli.com/docs/errors-and-limits#validation_error"
  }
}
Schema
error
object
required
Show child parameters
code
string
required
message
string
required
details
requestId
string
docs_url
string
required
The docs entry for this error code: what it means and how to fix it.
Headers
x-request-id
string
This request's id (req_…), matching the server logs. On every response.
401 Missing or invalid credentials. error.code is one of:
Example
{
  "error": {
    "code": "unauthorized",
    "message": "no credentials, an unknown, revoked or expired api key or session, or a signature that did not verify",
    "docs_url": "https://referalli.com/docs/errors-and-limits#unauthorized"
  }
}
Schema
error
object
required
Show child parameters
code
string
required
message
string
required
details
requestId
string
docs_url
string
required
The docs entry for this error code: what it means and how to fix it.
Headers
x-request-id
string
This request's id (req_…), matching the server logs. On every response.
404 No such resource. error.code is one of:
Example
{
  "error": {
    "code": "not_found",
    "message": "the resource does not exist in this org (ids from other orgs look the same), a referenced id does not exist, a list cursor is not in the list, or the endpoint does not exist",
    "docs_url": "https://referalli.com/docs/errors-and-limits#not_found"
  }
}
Schema
error
object
required
Show child parameters
code
string
required
message
string
required
details
requestId
string
docs_url
string
required
The docs entry for this error code: what it means and how to fix it.
Headers
x-request-id
string
This request's id (req_…), matching the server logs. On every response.
429 Rate limited. error.code is one of:
Example
{
  "error": {
    "code": "rate_limited",
    "message": "an endpoint limit or the per-key quota was exceeded",
    "docs_url": "https://referalli.com/docs/errors-and-limits#rate_limited"
  }
}
Schema
error
object
required
Show child parameters
code
string
required
message
string
required
details
requestId
string
docs_url
string
required
The docs entry for this error code: what it means and how to fix it.
Headers
x-request-id
string
This request's id (req_…), matching the server logs. On every response.
Retry-After
integer
Seconds until a retry can succeed.
RateLimit-Limit
integer
The quota bucket's size (the burst).
RateLimit-Remaining
integer
Requests that can be made right now.
RateLimit-Reset
integer
Seconds until the bucket is full again.
500 Unexpected server error. error.code is one of:
Example
{
  "error": {
    "code": "internal_error",
    "message": "retry with backoff",
    "requestId": "req_8f2c1d4e5a6b7c8d",
    "docs_url": "https://referalli.com/docs/errors-and-limits#internal_error"
  }
}
Schema
error
object
required
Show child parameters
code
string
required
message
string
required
details
requestId
string
docs_url
string
required
The docs entry for this error code: what it means and how to fix it.
Headers
x-request-id
string
This request's id (req_…), matching the server logs. On every response.
default Any other error, in the same envelope.
Example
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {},
    "requestId": "string",
    "docs_url": "string"
  }
}
Schema
error
object
required
Show child parameters
code
string
required
message
string
required
details
requestId
string
docs_url
string
required
The docs entry for this error code: what it means and how to fix it.
Updated