Skip to main content
POST
cURL
Creates or updates one referral program, in the catalog’s shape. Its rewards must be active rewards of the environment (unknown_reward). A change applies to referrals from then on; referrals already rewarded keep what they got. The catalog’s referralPrograms writes the same programs. Needs the Catalog permission at Write.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
id
string
required

Your ID for the program: letters, numbers, _ or -. It can't be changed.

Required string length: 1 - 100
Pattern: ^[a-zA-Z0-9_-]+$
name
string
required

Shown in the dashboard.

Required string length: 1 - 120
referrerRewardId
string
required

The reward the referrer gets: a coupon or a grant.

Required string length: 1 - 100
trigger
enum<string>
required

signup: both rewards when the referee redeems the code. first_payment: the referrer's reward (and a referee grant) when the referee first pays for a plan.

Available options:
signup,
first_payment
refereeRewardId
string | null

The reward the new customer gets. Null or left out: only the referrer is rewarded.

Required string length: 1 - 100
planIds
string[] | null

first_payment only: the paid plans whose first payment counts, every version of each. Null or left out: any paid plan.

Minimum array length: 1
Required string length: 1 - 100
maxRewardsPerReferrer
integer | null

The most referrer rewards one referrer gets. Null: no limit.

Required range: x <= 2147483647

Response

The program as written.

item
object
required
changed
boolean
required