Track referral link click (PUBLIC)

Overview

Public attribution endpoint: records a click on a referral link identified by its referral code and increments that code's total_click counter. Called by the SPA/landing page before login. Returns the referring company's public identity so the sign-up flow can pre-attribute the lead.

Prerequisites

  • No authentication — this endpoint is public.

Base URL

EnvironmentURL
Productionhttps://production-api.shoutaboutus.com
Developmenthttps://development-api.shoutaboutus.com

Endpoint

POST /api/v1/referral/click

Authentication

  • No bearer token required.

  • Public — no auth. Lives in the pre-login reference group.

Rate limit

  • 100 requests/min per IP.

Request body

FieldTypeRequiredDescription
codestringRequiredMust be an existing referral code. The referral code that was clicked.
ipstringOptionalClient IP recorded against the click for attribution/dedup.
{
  "code": "AbCdEf1234",
  "ip": "192.168.1.1"
}

How it works

  • 200{ data: { status, message, company } }; company is { id, name, bundle_id } of the referring company (or null).
  • 422code missing or not found in referral_codes.
  • 400{ status: error } if the click row fails to persist ('Something went wrong! Please try again.').

Response

200 OK · 200

{
  "data": {
    "status": "success",
    "message": "Click added successfully",
    "company": {
      "id": 1,
      "name": "Example Name",
      "bundle_id": 1
    }
  }
}

422 Validation error · 422

{
  "message": "The selected code is invalid.",
  "errors": {
    "code": [
      "The selected code is invalid."
    ]
  }
}

Errors

StatusMeaning
400Returned { status: error } if the click row fails to persist
422Validation error
500Unexpected server error

Example request

curl --request POST \
  --url "https://production-api.shoutaboutus.com/api/v1/referral/click" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{"code": "AbCdEf1234", "ip": "192.168.1.1"}'

Did this page help you?