Demo docs: examples are illustrative.
Referral API

Create a referrer

POST
/referrers

Enroll one of your customers in a program and generate their share link.

Authorization

apiKey
headerAuthorizationBearer <token>

Use a secret key such as sk_test_... in test mode or sk_live_... in production.

Header Parameters

Idempotency-Key?string

A unique key that makes retries safe. Keys expire after 24 hours.

Formatuuid

Request Body

application/json
  1. body
program_id*string

The program to enroll this customer in.

external_id*string

Your own user ID for this customer.

email*string
Formatemail
name?string
metadata?

Up to 20 string key-value pairs for your own use.

Response Body

The referrer was created.

application/json
  1. response
id*string
program_id*string
external_id*string
email*string
Formatemail
name?string|null
referral_code*string
share_url*string
Formaturi
stats?
metadata?

Up to 20 string key-value pairs for your own use.

created_at*string
Formatdate-time
Example Request
curl -X POST 'https://api.referralapi.example/v1/referrers' \  -H 'Content-Type: application/json' \  -d '{  "program_id": "prog_8Hq2LmN4",  "external_id": "user_1042",  "email": "maya@example.com"}'
Example Response
{  "id": "ref_3kT9wQx2",  "program_id": "string",  "external_id": "string",  "email": "user@example.com",  "name": "string",  "referral_code": "MAYA-20",  "share_url": "https://acme.example/?ref=MAYA-20",  "stats": {    "clicks": 0,    "signups": 0,    "conversions": 0  },  "metadata": {    "property1": "string",    "property2": "string"  },  "created_at": "2019-08-24T14:15:22Z"}