Skip to content

Referral invite

3 operations in the WP Waterfall API.

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

NameInTypeDescription
code requiredpathstring

Responses

StatusBodyDescription
200ReferralInviteThe invite
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
404ProblemNo such referral link
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemToo many reads from this address

200 response fields

NameTypeDescription
inviter requiredstringThe first name of the person who shared the link, or the company name.
currency requiredstring
credit_cents requiredintegerWhat the new customer gets after their first payment. Range: 0 to any.

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

NameInTypeDescription
Idempotency-Key requiredheaderstringSend 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

NameTypeDescription
code requiredstring

Responses

StatusBodyDescription
200ReferralVisitResultWhether the visit was recorded
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
409ProblemThe current state does not allow this: the same change is already running, or another change got there first.
422ProblemThe code is missing or too long
429ProblemToo many visits from this address
503ProblemThe program is not set up on this server

200 response fields

NameTypeDescription
recorded requiredboolean