Referral invite
3 operations in the WP Waterfall API.
- getWho shared a referral link, and what the new customer gets
- getFollow a referral link
- postRecord a visit that arrived with a referral code
Who shared a referral link, and what the new customer gets
get/referrals/invite/{code}Permalink to Who shared a referral link, and what the new customer gets
- Dashboard session only, no API key
No sign-in. Answers the first name of the person who shared the link (or the company name) and the credit a new customer gets after their first payment. An unknown, switched off, or malformed code answers 404. Limited to 30 reads a minute per address, and 429 past that.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
code required | path | string |
Responses
| Status | Body | Description |
|---|---|---|
200 | ReferralInvite | The invite |
400 | Problem | The request could not be read: bad JSON, a bad header, or a malformed value. |
404 | Problem | No such referral link |
422 | Problem | The request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field. |
429 | Problem | Too many reads from this address |
200 response fields
| Name | Type | Description |
|---|---|---|
inviter required | string | The first name of the person who shared the link, or the company name. |
currency required | string | |
credit_cents required | integer | What the new customer gets after their first payment. Range: 0 to any. |
Follow a referral link
get/referrals/links/{code}Permalink to Follow a referral link
- Dashboard session only, no API key
No sign-in. Records the click, sets the first-party referral cookie unless one is already set, and redirects with 302 to the sign-up page with ?ref. An unknown code still redirects to the marketing site, and sets nothing. Limited per address.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
code required | path | string |
Responses
| Status | Body | Description |
|---|---|---|
302 | Redirect to the sign-up page or the marketing site | |
400 | Problem | The request could not be read: bad JSON, a bad header, or a malformed value. |
404 | Problem | The thing in the path does not exist, or it belongs to another company. The answer is the same for both. |
422 | Problem | The request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field. |
429 | Problem | Too many visits from this address |
503 | Problem | The program is not set up on this server |
Record a visit that arrived with a referral code
post/referrals/visitsPermalink to Record a visit that arrived with a referral code
- Dashboard session only, no API key
No sign-in. The dashboard posts the code from ?ref once. The answer sets the same first-party cookie as the referral link and never moves the browser. recorded is false for an unknown or switched off code, and when an earlier referral stands. Limited per address.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key required | header | string | Send a fresh unique value on every POST: a POST without it answers 422. The answer is stored for 24 hours, so a retry with the same key and body returns the first answer, and the same key with a different body returns 422. |
Request body application/json, required, ReferralVisitRequest
Fields
| Name | Type | Description |
|---|---|---|
code required | string |
Responses
| Status | Body | Description |
|---|---|---|
200 | ReferralVisitResult | Whether the visit was recorded |
400 | Problem | The request could not be read: bad JSON, a bad header, or a malformed value. |
409 | Problem | The current state does not allow this: the same change is already running, or another change got there first. |
422 | Problem | The code is missing or too long |
429 | Problem | Too many visits from this address |
503 | Problem | The program is not set up on this server |
200 response fields
| Name | Type | Description |
|---|---|---|
recorded required | boolean |