Sign in

Create referral

POST https://{organization}.myguper.com/api/register/customer/referral

Records a "who-referred-whom" relationship between two customers. Each person can only have one active referrer at a time:

  • If no referral exists for person, one is created.
  • If a referral exists and is still active (expiredAt > now), the endpoint refuses to switch the referrer (HTTP 409). Sending the same referrer with a new expiredAt extends the window.
  • If the existing referral has already expired, the new payload replaces it.

Try-it values populated from environment ACME (Demo)


Authentication

Token

Send your user token in the x-guper-authorization header.

Headers

Name Type Description
x-guper-authorization * string User token issued by Guper.
Content-Type * string Always `application/json` for endpoints that accept a JSON body.

Request body

Content-Type: application/json

{
    "person": 620287,
    "referrer": 609961,
    "expiredAt": "2026-12-31 23:59:59"
}

Responses

{
    "person": 620287,
    "referrer": 609961,
    "expiredAt": "2026-12-31T23:59:59-03:00",
    "createdAt": "2026-05-03T10:00:00-03:00"
}
Copied to clipboard