Get a program's terms

Embed
Preview of the card
<a href="https://referalli.com/docs/ref-getv1programsidterms"><img src="https://referalli.com/docs/_api/public/orgs/07f432f4-34b9-46a7-aaad-c0e395d2e4f9/spaces/2bf4f614-3630-4fbf-85f9-5ecafa6b7d97/pages/0820f8e4-4ca2-419b-bae6-2f4858a07858/social-card.svg?v=3e7ae33eec8b" alt="Get a program's terms" width="600" height="315"></a>
GET https://referalli.com/v1/programs/{id}/termsScope programs:read

The program's commission terms for product copy, from its latest commission rule version (ruleVersion): the base (percentBps, or amountMinor and currency), how long it recurs, the hold, and summary, the same sentence in each partner-portal locale (en, es, de, fr, pt, it, nl, sv, ja, zh), built deterministically from the rule, such as "20% of every payment for 12 months" or "$50.00 for the first payment only". Bounties are added (", plus $5.00 per signup"); rule conditions add "(conditions apply)"; overrides, tiers or new-vs-expansion rates set ratesVary and add "(rates vary)" rather than quote one rate. With ?locale=de or an Accept-Language header the response also names the chosen locale and its sentence as text (an unsupported language gets en). Bounty event names are kept as written. Partner-group rates and promotions are not included. Publishing a new rule version changes the terms on the next read. 404 when the program has no rule yet. Program-scoped keys read their own programs.

Auth: an API key with programs:read, or a session of any role.

Scopes: programs:read, programs:write, read, full, admin.

Parameters

id
string
path
required
locale
string
query
x-org-id
string
header
With a session: the org to act in (the user must be a member). Not used with API keys, which belong to one org.
referalli-mode
string
header
test runs a session request against the org's test data. With an API key it must match the key's mode (400 mode_mismatch otherwise). The header name from before the rename is still accepted.
live | test

Code samples

cURL
curl -X GET "https://referalli.com/v1/programs/{id}/terms" \
  -H "Authorization: Bearer $REFERALLI_API_KEY" \
  -H "x-org-id: <value>" \
  -H "referalli-mode: <value>"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{
  "programId": "string",
  "ruleVersion": 0,
  "base": {
    "kind": "string",
    "percentBps": 0
  },
  "recurring": {
    "type": "string"
  },
  "upcoming": {},
  "holdDays": 0,
  "capPerReferral": {
    "amountMinor": 0,
    "currency": "string"
  },
  "signupWindowDays": 0,
  "trafficSources": [
    "string"
  ],
  "countries": {
    "allow": [
      "string"
    ],
    "block": [
      "string"
    ]
  },
  "caps": {
    "conversionsPerDay": 0,
    "conversionsPerMonth": 0,
    "commissionPerMonthMinor": 0,
    "currency": "string"
  },
  "ratesVary": true,
  "summary": {
    "en": "string",
    "es": "string",
    "de": "string",
    "fr": "string",
    "pt": "string",
    "it": "string",
    "nl": "string",
    "sv": "string",
    "ja": "string",
    "zh": "string"
  },
  "locale": "string",
  "text": "string",
  "draft": true
}
Schema
programId
string
required
ruleVersion
integer
required
The commission rule version these terms come from (the latest).
base
object
required
recurring
object
required
upcoming
object
A later rule version published with an effectiveAt still in the future: its full terms plus effectiveAt. Absent when none.
holdDays
integer
required
capPerReferral
object
required
The rule's cap per referred customer: the most one referral earns its partner, over every payment.
Show child parameters
amountMinor
integer
required
Integer minor units (cents).
currency
string
required
signupWindowDays
integer
required
The program's signupToConversionDays when set (null at the 365-day default): a payment more than this many days after sign-up earns nothing.
trafficSources
string[]
required
The traffic sources the program allows; null when it does not restrict them.
countries
object
required
The program's country targeting; null when none is set.
Show child parameters
allow
string[]
block
string[]
caps
object
required
The program's conversion caps; null when none are set.
Show child parameters
conversionsPerDay
integer
conversionsPerMonth
integer
commissionPerMonthMinor
integer
currency
string
ratesVary
boolean
required
Overrides, tiers or new-vs-expansion rates can change the rate a partner earns.
summary
object
required
The same sentence in each partner-portal locale.
Show child parameters
en
string
required
es
string
required
de
string
required
fr
string
required
pt
string
required
it
string
required
nl
string
required
sv
string
required
ja
string
required
zh
string
required
locale
string
With ?locale= or Accept-Language: the locale chosen (en when the one asked for is not supported).
text
string
With ?locale= or Accept-Language: the summary in locale.
draft
boolean
The latest rule is a draft: it accrues nothing, and partners and the join page see no terms until a version without draft is published.
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.
403 Authenticated, but not allowed. error.code is one of:
Example
{
  "error": {
    "code": "forbidden",
    "message": "the wrong role, a key without the needed scope (the message names it",
    "docs_url": "https://referalli.com/docs/errors-and-limits#forbidden"
  }
}
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